[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[patches] PATCH: Hardwire -fpie configuration test



I've committed the patch below.

In the EGLIBC bootstrap build process, EGLIBC's configure-time test to
see if the -fpie option works fails, because linking an -fpie
executable requires libc_nonshared.a (via Scrt1.o), which we have not
yet built.  However, on suitably recent versions of binutils and GCC
(which we test for elsewhere in the configuration process), fpie
should work.

The consequences of this test failing are minor; nscd is linked
without -fpie, and the elf/tst-pie1.c test doesn't run.  However, it's
not ideal for the EGLIBC process to require a third build pass to get
consistent behavior.  So simply hard-wiring the result is the simplest
solution.

This patch has been tested on i386-none-linux-gnu and
powerpc-linux-gnuspe.

ChangeLog.eglibc:
2007-06-22  Jim Blandy  <jimb@xxxxxxxxxxxxxxxx>

	* configure.in: Hardware test for have-fpie to 'yes'.
	* configure: Regenerated.

Index: configure.in
===================================================================
--- configure.in	(revision 2599)
+++ configure.in	(revision 2600)
@@ -1577,20 +1577,11 @@
   rm -f conftest*])
   AC_SUBST(libc_cv_z_execstack)
 
-  AC_CACHE_CHECK(for -fpie, libc_cv_fpie, [dnl
-  cat > conftest.c <<EOF
-int foo;
-main () { return 0;}
-EOF
-  if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -pie -fpie
-			      -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD])
-  then
-    libc_cv_fpie=yes
-  else
-    libc_cv_fpie=no
-  fi
-  rm -f conftest*])
-
+  dnl A build-and-link test for this fails during a bootstrap build,
+  dnl since we haven't yet built startup files needed for the link.
+  dnl However, we require versions of GCC and binutils that are new
+  dnl enough that -fpie should always work.
+  libc_cv_fpie=yes
   AC_SUBST(libc_cv_fpie)
 
   AC_CACHE_CHECK(for --hash-style option,