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 -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  <>
	    Joseph Myers  <>

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

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

Joseph S. Myers

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