From patchwork Thu Oct 20 20:01:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Granberg X-Patchwork-Id: 78558 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp961538qge; Thu, 20 Oct 2016 13:02:19 -0700 (PDT) X-Received: by 10.98.82.75 with SMTP id g72mr4270768pfb.119.1476993738957; Thu, 20 Oct 2016 13:02:18 -0700 (PDT) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id c72si42987934pga.56.2016.10.20.13.02.18 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Oct 2016 13:02:18 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-73985-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org; spf=pass (google.com: domain of libc-alpha-return-73985-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-73985-patch=linaro.org@sourceware.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=ErZ PGOjhCU5C6u7urZWGezazF90io2N6Z7nb/+3VoEtSuto27s2KWuS2HEnfP0mf/A8 9MgvQAU+hf3GNt8nA3K1LVQr0kdy6ZZGZBowtDMuzfItVGwyUPa54algTxW8RNy9 hwPqfNqCzCu9v7zM4hVjRO/osRELR7jFaMlta8ow= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:mime-version :content-type:content-transfer-encoding; s=default; bh=uceiIJK0P 2r7+82A8wDjegDkvCA=; b=GOpY6A4MhobFHAQw84/n1BQAm0Th+dFnbU/waN8oJ iQnjhM/Bz0ewQfZV14sxAo1raVaLcT44Yp9WOH0YbufyxhQXDQH/FV2kJpbmUR9u k4Cnt5y7HjUrS7dtlO/0V987kl582W8U7uLPN5gh7zSlxaTDUcCNByG/d+OUZZuY 0A= Received: (qmail 127170 invoked by alias); 20 Oct 2016 20:02:09 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 127160 invoked by uid 89); 20 Oct 2016 20:02:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=denis, Denis, Hx-languages-length:1946, regenerated X-HELO: smtp.gentoo.org From: Magnus Granberg To: libc-alpha Subject: [PATCH] Bug 20662: checking whether x86_64-pc-linux-gnu-gcc implicitly enables -fstack-protector no (32bit gcc 6.2.0 pie and ssp enable) Date: Thu, 20 Oct 2016 22:01:39 +0200 Message-ID: <1784772.eOhSpX4WhJ@laptop1.gw.ume.nu> User-Agent: KMail/5.3.0 (Linux/4.6.4-gentoo; KDE/5.25.0; x86_64; ; ) MIME-Version: 1.0 When glibc get compile with gcc 6.2 that have been configured with --enable-default-pie and --enable-default-ssp. The check that check if the compiler use -fstack-protector as default fail on the 32bit part. checking for libgd... no checking for _FORTIFY_SOURCE predefine... yes checking whether x86_64-pc-linux-gnu-gcc -m32 -Wl,-O1 -Wl,--as-needed implicitly enables -fstack-protector... no checking whether the linker provides working __ehdr_start... yes This patch make so we look for __stack_chk_fail_local in the check. Tested on x86_64 multilib Gentoo Changelog: 2016-10-20 Magnus Granberg Denis Kaganovich * configure.ac: Add check for __stack_chk_fail_local in libc_cv_predef_stack_protector check. * configure: Regenerated. diff --git a/configure.ac b/configure.ac index a64aeb9..de42b6b 100644 --- a/configure.ac +++ b/configure.ac @@ -1667,12 +1668,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],