From patchwork Thu May 31 23:38:22 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans-Peter Nilsson X-Patchwork-Id: 162245 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 094E9B6FF4 for ; Fri, 1 Jun 2012 09:38:47 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1339112329; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Received:Received:Date:Message-Id:From:To: Subject:MIME-Version:Content-Type:Content-Transfer-Encoding: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=iOK5DSG5+zLL4Z6PXgFf jIq6tMg=; b=Ef+2DodkFxzrcgy7rdPN32jtShv7VBPv5+DZs5qjZSx7sV/NcnXk CK93ypzADi13SrME/8bsIdUWNrkehGzKQGAMgP6P0I68JF/PojlwVyOMgAdx+BLr esojIkiVAyvC7S1s8R53QtmW5CfvISaWyTUTUfCOcXpNI6feFY0oWhU= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:Received:Received:Received:Date:Message-Id:From:To:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=jOZriiagRZoqQmhtoc2x7QYIPr/g24jB19B6jaZ0P0eNDWRVqWr5DVEis2QpvU PYD2EIcvkQCzPQy4USXLEZ80SPRvUJ+WDmSLhh0Ym3IOk6gqewpxEUGcj2bMBN3n H0ig9pEXiUZ0SuXxoNZbIUONiGACv2sas9sZuxw7kbwY4=; Received: (qmail 13959 invoked by alias); 31 May 2012 23:38:44 -0000 Received: (qmail 13951 invoked by uid 22791); 31 May 2012 23:38:44 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL, BAYES_00, RCVD_IN_HOSTKARMA_NO, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from anubis.se.axis.com (HELO anubis.se.axis.com) (195.60.68.12) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 31 May 2012 23:38:27 +0000 Received: from localhost (localhost [127.0.0.1]) by anubis.se.axis.com (Postfix) with ESMTP id 65C0D19E36 for ; Fri, 1 Jun 2012 01:38:25 +0200 (CEST) Received: from anubis.se.axis.com ([127.0.0.1]) by localhost (anubis.se.axis.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id OUMnC7w6MXVN for ; Fri, 1 Jun 2012 01:38:22 +0200 (CEST) Received: from seth.se.axis.com (seth.se.axis.com [10.0.2.172]) by anubis.se.axis.com (Postfix) with ESMTP id AEFA919E20 for ; Fri, 1 Jun 2012 01:38:22 +0200 (CEST) Received: from ignucius.se.axis.com (ignucius.se.axis.com [10.88.21.50]) by seth.se.axis.com (Postfix) with ESMTP id 920483E0F2; Fri, 1 Jun 2012 01:38:22 +0200 (CEST) Received: from ignucius.se.axis.com (localhost [127.0.0.1]) by ignucius.se.axis.com (8.12.8p1/8.12.8/Debian-2woody1) with ESMTP id q4VNcMmt006319; Fri, 1 Jun 2012 01:38:22 +0200 Received: (from hp@localhost) by ignucius.se.axis.com (8.12.8p1/8.12.8/Debian-2woody1) id q4VNcMWq006315; Fri, 1 Jun 2012 01:38:22 +0200 Date: Fri, 1 Jun 2012 01:38:22 +0200 Message-Id: <201205312338.q4VNcMWq006315@ignucius.se.axis.com> From: Hans-Peter Nilsson To: gcc-patches@gcc.gnu.org Subject: [RFA:] fix bug in configure header-probing for stack protector support in target C library MIME-Version: 1.0 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org This patch fixes target-header-probing for cross-builds that aren't using sysroot (just --target and --prefix), as in the difference for crisv32-axis-linux-gnu with an eglibc-2.15-based port: brgds, H-P --- cllog.prev Thu May 31 22:00:10 2012 +++ cllog Thu May 31 22:00:09 2012 @@ -1276,7 +1276,7 @@ checking linker --as-needed support... y checking linker --build-id support... yes checking linker *_sol2 emulation support... no checking linker --sysroot support... yes -checking __stack_chk_fail in target C library... no +checking __stack_chk_fail in target C library... yes checking sys/sdt.h in the target C library... no checking dl_iterate_phdr in target C library... unknown Using ggc-page for garbage collection. Without this patch, the non-existing directory target_header_dir=NONE/crisv32-axis-linux-gnu/sys-include is probed due to exec_prefix=NONE, duh. There's code setting a separate variable test_exec_prefix that is then used to handle this kind of testing for sysroot configures, but it is inside code only executed if --with-sysroot is used. There's no reason for it being there as it's not depending on the processing done there or on sysroot settings. So let's move it to before the with-sysroot stuff and use it when setting target_header_dir. Tested configuring for crisv32-axis-linux-gnu and building past this part (build completes successfully with the expected observable change as per the use in gcc.c); no difference for --with-sysroot. Ok to commit? gcc: Fix configure test for "stack protector support in target C library". * configure.ac (test_prefix, test_exec_prefix): Move setting from inside sysroot handling to before and outside it. * configure: Regenerate. --- gcc.prev/gcc/configure.ac 2012-05-25 14:28:50.000000000 +0200 +++ gcc/gcc/configure.ac 2012-05-31 21:20:07.000000000 +0200 @@ -747,6 +747,17 @@ AC_ARG_WITH(build-sysroot, [SYSROOT_CFLAGS_FOR_TARGET=]) AC_SUBST(SYSROOT_CFLAGS_FOR_TARGET) +if test "x$prefix" = xNONE; then + test_prefix=/usr/local +else + test_prefix=$prefix +fi +if test "x$exec_prefix" = xNONE; then + test_exec_prefix=$test_prefix +else + test_exec_prefix=$exec_prefix +fi + AC_ARG_WITH(sysroot, [AS_HELP_STRING([[--with-sysroot[=DIR]]], [search for usr/lib, usr/include, et al, within DIR])], @@ -759,16 +770,6 @@ AC_ARG_WITH(sysroot, TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"$(TARGET_SYSTEM_ROOT)\"' CROSS_SYSTEM_HEADER_DIR='$(TARGET_SYSTEM_ROOT)$${sysroot_headers_suffix}$(NATIVE_SYSTEM_HEADER_DIR)' - if test "x$prefix" = xNONE; then - test_prefix=/usr/local - else - test_prefix=$prefix - fi - if test "x$exec_prefix" = xNONE; then - test_exec_prefix=$test_prefix - else - test_exec_prefix=$exec_prefix - fi case ${TARGET_SYSTEM_ROOT} in "${test_prefix}"|"${test_prefix}/"*|\ "${test_exec_prefix}"|"${test_exec_prefix}/"*|\ @@ -4528,11 +4529,11 @@ if test x$host != x$target || test "x$TA if test "x$with_headers" != x; then target_header_dir=$with_headers elif test "x$with_sysroot" = x; then - target_header_dir="${exec_prefix}/${target_noncanonical}/sys-include" + target_header_dir="${test_exec_prefix}/${target_noncanonical}/sys-include" elif test "x$with_build_sysroot" != "x"; then target_header_dir="${with_build_sysroot}${native_system_header_dir}" elif test "x$with_sysroot" = xyes; then - target_header_dir="${exec_prefix}/${target_noncanonical}/sys-root${native_system_header_dir}" + target_header_dir="${test_exec_prefix}/${target_noncanonical}/sys-root${native_system_header_dir}" else target_header_dir="${with_sysroot}${native_system_header_dir}" fi