This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Weaken PIE configure test to a compile test

One remaining configure test that produces different results in
bootstrap builds because it tries linking against a preexisting libc
is the test for position-independent executable support.

I propose this patch, weakening it to a compile test.  (Really it
could probably be eliminated completely and PIE support hardwired to
be on; this is just a more conservative patch, and only fairly limited
cleanups are made possible through hardwiring PIE support on.)  If for
some reason PIE support is problematic for an architecture it's
certainly better for GCC to diagnose that at compile time rather than
accept the option and then fail to link.  But given PIC support, there
isn't much more involved in PIE support, and part of what is involved
is bits of statically linked libc code being suitable for linking into
PIEs - something that of course is a property of the newly built libc,
not the old one.

Tested x86_64.  I am not aware of any systems supported by libc or
ports that do not support PIEs.  (EGLIBC has hardwired the answer to
this test to "yes" for the past five years and I see no sign of Debian
having needed to revert that for any system.)

2012-05-28  Joseph Myers  <>

	* (libc_cv_fpie): Weaken to a compile test using
	* configure: Regenerated.

diff --git a/ b/
index 6fac085..81b14c9 100644
--- a/
+++ b/
@@ -1618,18 +1618,8 @@ rm -f conftest*])
 AC_CACHE_CHECK(for -fpie, libc_cv_fpie, [dnl
-cat > conftest.c <<EOF
-int foo;
-main () { return 0;}
-			    -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD])
-  libc_cv_fpie=yes
-  libc_cv_fpie=no
-rm -f conftest*])
+LIBC_TRY_CC_OPTION([-fpie], [libc_cv_fpie=yes], [libc_cv_fpie=no])

Joseph S. Myers

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]