about summary refs log tree commit diff
path: root/configure
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2015-06-25 02:37:04 -0700
committerH.J. Lu <hjl.tools@gmail.com>2015-06-25 02:49:53 -0700
commitcc08749b2d1c68284b25b157fbbe1ff219495cae (patch)
tree0b0f104c2866770c1983e521184869f3829b40f6 /configure
parent45a8f0e6629d7772b9fa1aef0389bc51a094424d (diff)
downloadglibc-cc08749b2d1c68284b25b157fbbe1ff219495cae.tar.gz
glibc-cc08749b2d1c68284b25b157fbbe1ff219495cae.tar.xz
glibc-cc08749b2d1c68284b25b157fbbe1ff219495cae.zip
Support compilers defaulting to PIE
To support building glibc with GCC 6 configured with --enable-default-pie,
which generates PIE by default, we need to build programs as PIE.  But
elf/tst-dlopen-aout must not be built as PIE since it tests dlopen on
ET_EXEC file and PIE is ET_DYN.

	[BZ #17841]
	* Makeconfig (no-pie-ldflag): New.
	(+link): Set to $(+link-pie) if default to PIE.
	(+link-tests): Set to $(+link-pie-tests) if default to PIE.
	* config.make.in (build-pie-default): New.
	* configure.ac (libc_cv_pie_default): New.  Set to yes if -fPIE
	is default.  AC_SUBST.
	* configure: Regenerated.
	* elf/Makefile (LDFLAGS-tst-dlopen-aout): New.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure21
1 files changed, 21 insertions, 0 deletions
diff --git a/configure b/configure
index 1e4138b524..45cc7cba2b 100755
--- a/configure
+++ b/configure
@@ -596,6 +596,7 @@ mach_interface_list
 DEFINES
 static_nss
 profile
+libc_cv_pie_default
 libc_cv_pic_default
 shared
 static
@@ -7317,6 +7318,26 @@ fi
 $as_echo "$libc_cv_pic_default" >&6; }
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -fPIE is default" >&5
+$as_echo_n "checking whether -fPIE is default... " >&6; }
+if ${libc_cv_pie_default+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  libc_cv_pie_default=yes
+cat > conftest.c <<EOF
+#if defined __PIE__ || defined __pie__ || defined PIE || defined pie
+# error PIE is default.
+#endif
+EOF
+if eval "${CC-cc} -S conftest.c 2>&5 1>&5"; then
+  libc_cv_pie_default=no
+fi
+rm -f conftest.*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_pie_default" >&5
+$as_echo "$libc_cv_pie_default" >&6; }
+
+