aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Kaganovich <mahatma@eu.by>2016-10-20 22:01:39 +0200
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2017-04-06 10:52:42 -0300
commitf0a8620883f1769c5161c5389373a7e828f7eaf9 (patch)
tree3aac17e37fa3d6f7744b9f567834fc6e73ecd0ee
parent058b5a41d56b9a8860dede14d97dd443792d064b (diff)
downloadglibc-f0a8620883f1769c5161c5389373a7e828f7eaf9.tar
glibc-f0a8620883f1769c5161c5389373a7e828f7eaf9.tar.gz
glibc-f0a8620883f1769c5161c5389373a7e828f7eaf9.tar.bz2
glibc-f0a8620883f1769c5161c5389373a7e828f7eaf9.zip
configure: accept __stack_chk_fail_local for ssp support too [BZ #20662]
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 (cherry picked from commit c7409aded44634411a19b0b7178b7faa237835e6)
-rw-r--r--ChangeLog9
-rwxr-xr-xconfigure8
-rw-r--r--configure.ac8
3 files changed, 19 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 66bbb17fd3..c06114015b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2017-04-06 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-08-26 Florian Weimer <fweimer@redhat.com>
[BZ #20432]
diff --git a/configure b/configure
index 8fe59377ea..ee49f286af 100755
--- a/configure
+++ b/configure
@@ -6252,12 +6252,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
diff --git a/configure.ac b/configure.ac
index 3c766b7409..5932138bbd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1603,12 +1603,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],