This is the mail archive of the libc-alpha@sourceware.org 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 -fstack-protector configure test to a compile test


One remaining configure test that gives different results in a
bootstrap configuration from when libc is already available (not yet
the only such test) is that for -fstack-protector support in the
compiler.  To eliminate this difference, I propose this patch that
weakens that link test to a compile test, using the new
LIBC_TRY_CC_OPTION.  (That this test is using -Werror suggests that
the main thing it is testing for is a warning GCC may give if the
particular configuration doesn't support -fstack-protector.)

Tested x86_64.

2012-03-21  Thomas Schwinge  <thomas@codesourcery.com>
	    Joseph Myers  <joseph@codesourcery.com>

	* configure.in (libc_cv_ssp): Use LIBC_TRY_CC_OPTION instead of a
	link test.
	* configure: Regenerated.

diff --git a/configure.in b/configure.in
index bb3b057..b2fed4b 100644
--- a/configure.in
+++ b/configure.in
@@ -1753,18 +1753,10 @@ fi
 AC_SUBST(fno_unit_at_a_time)
 
 AC_CACHE_CHECK(for -fstack-protector, libc_cv_ssp, [dnl
-cat > conftest.c <<EOF
-int foo;
-main () { return 0;}
-EOF
-if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -Werror -fstack-protector
-			    -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD])
-then
-  libc_cv_ssp=yes
-else
-  libc_cv_ssp=no
-fi
-rm -f conftest*])
+LIBC_TRY_CC_OPTION([$CFLAGS $CPPFLAGS -Werror -fstack-protector],
+		   [libc_cv_ssp=yes],
+		   [libc_cv_ssp=no])
+])
 AC_SUBST(libc_cv_ssp)
 
 AC_CACHE_CHECK(for -fgnu89-inline, libc_cv_gnu89_inline, [dnl

-- 
Joseph S. Myers
joseph@codesourcery.com


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