From patchwork Wed Feb 8 00:13:59 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Klose X-Patchwork-Id: 140043 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 4C078B6EEA for ; Wed, 8 Feb 2012 11:14:23 +1100 (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=1329264864; h=Comment: DomainKey-Signature:Received:Received:Received:Received: Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Mailing-List:Precedence: List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=KOiObh1nGx+0srEZZUb28taiV7A=; b=s8k4kWQSBjK7x/9 QVXKJ3zQhgXfWY6oct0FvX8PZK//tqXaJanhI4j3WnxnHiap+Mi3AgFyqwbvUR3j gGwmdFW8NLwAioE8uOv2chRi/12deHMRsZ1dHv3kwKtbaF8M7YmusLcFA80RPCbJ 315UzS93Qrqm6rydDWmb6IkJ58B0= 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:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=oJJgUW8fHbVaMQ2aWRTRb7tkJJDIztduVUf0CjJMqgFdLqySHzjqdG9sjET5c6 yYEzLCxwGLp88wuoQNOy43MvevU6RmRuRFRXL5ROrrWvaEllM9OoKDuaGzCtsJm3 KQjJXylH0wExIhSFlqHwGyz1b/S3DixCYBdLPPcpTwKAM=; Received: (qmail 8011 invoked by alias); 8 Feb 2012 00:14:19 -0000 Received: (qmail 7999 invoked by uid 22791); 8 Feb 2012 00:14:17 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, TW_GX X-Spam-Check-By: sourceware.org Received: from youngberry.canonical.com (HELO youngberry.canonical.com) (91.189.89.112) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 08 Feb 2012 00:14:04 +0000 Received: from [108.60.121.129] (helo=[10.10.0.102]) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1RuvAg-00032g-Pk; Wed, 08 Feb 2012 00:14:02 +0000 Message-ID: <4F31BE47.2020506@ubuntu.com> Date: Wed, 08 Feb 2012 01:13:59 +0100 From: Matthias Klose User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120203 Thunderbird/11.0 MIME-Version: 1.0 To: "Joseph S. Myers" CC: GCC Patches Subject: Re: [patch] avoid '//' prefixes when sysroot is set to '/' References: <4F2024FC.8060200@ubuntu.com> <4F21646A.2030501@ubuntu.com> In-Reply-To: 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 On 26.01.2012 18:57, Joseph S. Myers wrote: > On Thu, 26 Jan 2012, Matthias Klose wrote: > >> On 25.01.2012 17:45, Joseph S. Myers wrote: >>> On Wed, 25 Jan 2012, Matthias Klose wrote: >>> >>>> This can end up in generation for dependency files, and other files >>>> parsing >>>> the output. The solution I came up with is to check for sysroot set to '/' >>>> and >>>> special case this in two places. Afaics, there are no other places. >>> >>> I could imagine a sysroot path that isn't just '/' but ends with '/' >>> resulting in duplicate '/' in the middle of the path - although that's not >>> a correctness issue in the way that '//' at the start could be, maybe the >>> best check is actually for '/' at end of sysroot (in which case skip the >>> '/' at the start of the path within the sysroot)? >> >> as in the attached trailing.diff? built and regression tested. > > Yes, that's OK (with copyright date updates in incpath.c). there is one more issue, when configuring --with-sysroot=/ --with-gxx-include-dir=/usr/include/c++/4.7 in that the leading / is stripped away in configure.ac. This case needs an explicit check. Ok for the trunk? Matthias * configure.ac (gcc_gxx_include_dir): Don't strip a `/' sysroot value. --- a/src/gcc/configure.ac +++ b/src/gcc/configure.ac @@ -149,7 +149,9 @@ if test "${with_sysroot+set}" = set; then gcc_gxx_without_sysroot=`expr "${gcc_gxx_include_dir}" : "${with_sysroot}"'\(.*\)'` if test "${gcc_gxx_without_sysroot}"; then - gcc_gxx_include_dir="${gcc_gxx_without_sysroot}" + if test x${with_sysroot} != x/; then + gcc_gxx_include_dir="${gcc_gxx_without_sysroot}" + fi gcc_gxx_include_dir_add_sysroot=1 fi fi