From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 44403 invoked by alias); 15 Nov 2016 19:37:49 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 44394 invoked by uid 89); 15 Nov 2016 19:37:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.7 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_PASS,URIBL_RED autolearn=ham version=3.3.2 spammy= X-HELO: smtp.gentoo.org From: Mike Frysinger To: libc-alpha@sourceware.org Subject: [PATCH/committed 2.24] configure: accept __stack_chk_fail_local for ssp support too [BZ #20662] Date: Tue, 15 Nov 2016 19:37:00 -0000 Message-Id: <20161115193735.9962-1-vapier@gentoo.org> In-Reply-To: <1784772.eOhSpX4WhJ@laptop1.gw.ume.nu> References: <1784772.eOhSpX4WhJ@laptop1.gw.ume.nu> X-SW-Source: 2016-11/txt/msg00512.txt.bz2 From: Denis Kaganovich 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) --- ChangeLog | 9 +++++++++ configure | 8 +++++--- configure.ac | 8 +++++--- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index a51771c97668..1e2dcea203b4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2016-11-15 Denis Kaganovich + Magnus Granberg + Mike Frysinger + + [BZ #20662] + * configure.ac (libc_cv_predef_stack_protector): Also check for + __stack_chk_fail_local symbols. + * configure: Regenerated. + 2016-11-03 Joseph Myers * conform/Makefile ($(linknamespace-header-tests)): Also depend on diff --git a/configure b/configure index 17625e104128..9b5a48604809 100755 --- a/configure +++ b/configure @@ -6289,12 +6289,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 33bcd621804e..8277d9f72797 100644 --- a/configure.ac +++ b/configure.ac @@ -1626,12 +1626,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], -- 2.10.2