changeset 36039:826e7d2dcd7e

Revert r36098, it breaks compilation on x86-64 Linux. The original failure needs to be investigated.
author reimar
date Mon, 01 Apr 2013 18:14:24 +0000
parents 777ccea2828d
children 5ecbf382ff26
files configure
diffstat 1 files changed, 11 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/configure	Mon Apr 01 18:12:48 2013 +0000
+++ b/configure	Mon Apr 01 18:14:24 2013 +0000
@@ -2762,14 +2762,6 @@
 fi
 
 
-echocheck "PIC"
-def_pic='#define CONFIG_PIC 0'
-pic=no
-cpp_condition_check '' 'defined(__PIC__) || defined(__pic__) || defined(PIC)' &&
-  pic=yes && extra_cflags="$extra_cflags -DPIC" && def_pic='#define CONFIG_PIC 1'
-echores $pic
-
-
 # try to create a relocatable binary by default
 echocheck "relocatable binary"
 if test $relocatable = "auto" ; then
@@ -2853,6 +2845,17 @@
 fi #if x86_32
 
 
+# Check if we need to compile as PIC for this combination of architecture, toolchain,
+# gcc configuration (e.g. hardened or not) and compiler options.
+# Needs to be after the relocatable handling, since PIE changes whether we need PIC or not.
+echocheck "PIC"
+def_pic='#define CONFIG_PIC 0'
+pic=no
+cpp_condition_check '' 'defined(__PIC__) || defined(__pic__) || defined(PIC)' &&
+  pic=yes && extra_cflags="$extra_cflags -DPIC" && def_pic='#define CONFIG_PIC 1'
+echores $pic
+
+
 def_bswap='#define HAVE_BSWAP 0'
 def_ebx_available='#define HAVE_EBX_AVAILABLE 0'
 def_xmm_clobbers='#define HAVE_XMM_CLOBBERS 0'