]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
configure: accept __stack_chk_fail_local for ssp support too [BZ #20662]
authorDenis Kaganovich <mahatma@eu.by>
Thu, 20 Oct 2016 20:01:39 +0000 (22:01 +0200)
committerMike Frysinger <vapier@gentoo.org>
Tue, 15 Nov 2016 19:15:19 +0000 (14:15 -0500)
When glibc is compiled with gcc 6.2 that has been configured with
--enable-default-pie and --enable-default-ssp, the configure script
fails to detect that the compiler has ssp turned on by default when
being built for i686-linux-gnu.

This is because gcc is emitting __stack_chk_fail_local but the
script is only looking for __stack_chk_fail.  Support both.

Example output:
checking whether x86_64-pc-linux-gnu-gcc -m32 -Wl,-O1 -Wl,--as-needed
implicitly enables -fstack-protector... no

ChangeLog
configure
configure.ac

index e88b7603edb7b712ad51e298c821dfc3edc52924..7b7c5115a1fc1ab221c6649b1228b2315f895fa4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2016-10-20  Denis Kaganovich  <mahatma@eu.by>
+           Magnus Granberg  <zorry@gentoo.org>
+           Mike Frysinger  <vapier@gentoo.org>
+
+       [BZ #20662]
+       * configure.ac (libc_cv_predef_stack_protector): Also check for
+       __stack_chk_fail_local symbols.
+       * configure: Regenerated.
+
 2016-11-15  Florian Weimer  <fweimer@redhat.com>
 
        * sysdeps/s390/s390-64/setjmp.S (NEED_COMPAT_SYMBOLS): New macro.
index e80e0ad56c3b025614cb7125ed79698ffe371d46..d9f8c06bca80faba35c506c452aed796c77aa97d 100755 (executable)
--- a/configure
+++ b/configure
@@ -6340,12 +6340,14 @@ echo >&5 "libc_undefs='$libc_undefs'"
 # symbols (resolved by the linker), so filter out unknown symbols.
 # This will fail to produce the correct result if the compiler
 # defaults to -fstack-protector but this produces an undefined symbol
-# other than __stack_chk_fail.  However, compilers like that have not
-# been encountered in practice.
-libc_undefs=`echo "$libc_undefs" | egrep '^(foobar|__stack_chk_fail)$'`
+# other than __stack_chk_fail or __stack_chk_fail_local. However,
+# compilers like that have not been encountered in practice.
+libc_undefs=`echo "$libc_undefs" | \
+  egrep '^(foobar|__stack_chk_fail|__stack_chk_fail_local)$'`
 case "$libc_undefs" in
 foobar) libc_cv_predef_stack_protector=no ;;
 '__stack_chk_fail
+foobar'|'__stack_chk_fail_local
 foobar') libc_cv_predef_stack_protector=yes ;;
 *) as_fn_error $? "unexpected symbols in test: $libc_undefs" "$LINENO" 5 ;;
 esac
index a64aeb9979a53cd7f69c20f6f38db75c7a1bdf49..de0a40f1a7d8c0d5f18a991586de25b51fdb6aad 100644 (file)
@@ -1667,12 +1667,14 @@ echo >&AS_MESSAGE_LOG_FD "libc_undefs='$libc_undefs'"
 # symbols (resolved by the linker), so filter out unknown symbols.
 # This will fail to produce the correct result if the compiler
 # defaults to -fstack-protector but this produces an undefined symbol
-# other than __stack_chk_fail.  However, compilers like that have not
-# been encountered in practice.
-libc_undefs=`echo "$libc_undefs" | egrep '^(foobar|__stack_chk_fail)$'`
+# other than __stack_chk_fail or __stack_chk_fail_local. However,
+# compilers like that have not been encountered in practice.
+libc_undefs=`echo "$libc_undefs" | \
+  egrep '^(foobar|__stack_chk_fail|__stack_chk_fail_local)$'`
 case "$libc_undefs" in
 foobar) libc_cv_predef_stack_protector=no ;;
 '__stack_chk_fail
+foobar'|'__stack_chk_fail_local
 foobar') libc_cv_predef_stack_protector=yes ;;
 *) AC_MSG_ERROR([unexpected symbols in test: $libc_undefs]) ;;
 esac],