From patchwork Tue Apr 1 10:17:36 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Ye X-Patchwork-Id: 27525 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f70.google.com (mail-yh0-f70.google.com [209.85.213.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 41FB020553 for ; Tue, 1 Apr 2014 10:17:45 +0000 (UTC) Received: by mail-yh0-f70.google.com with SMTP id c41sf24055392yho.9 for ; Tue, 01 Apr 2014 03:17:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mailing-list:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:sender :delivered-to:from:to:cc:references:in-reply-to:subject:date :message-id:mime-version:x-original-sender :x-original-authentication-results:content-type :content-transfer-encoding; bh=b0coczJEw8sGElvos/wwOoaE+fkS6zPkWAGbo7zlmy4=; b=RA0HeiRkbkngQXL2r+5WY+YYkT1tzBHxcMSauQlsZq1f2FIYVQZfPR0Km+qM1Bhs8o FGz+v6Ab79YUmuPJ8xbE2JrFA+5VryvYKbOSv2lgkdvC12TKYwWL7rqgLEbv6STymRjy GnEJLn203G1o7oUJ7WerqBHZT5VlZCib8eMc3nb95lco+nCIfTnR176RO4lVIIQmKfAx HdHFZF1ACOwTdJdL42a4FHSsxHMHGUQLZj64yfZRUKLELdL3dLemoqRfy/zmto4Vu0Nf 1PnuXS7iZ4yYmNQz1NHis8zo6jMK0yq2/uVnqglZ1/HNLS/kboA4cL0JCbHVzvw3o2iU UGqw== X-Gm-Message-State: ALoCoQk/8TgOpX8M2FuuYq3SBeHImf1KT4Q9YZQMizKzd+khbDTPlzuXZaHGsQ7uOEpxzgZaRhW1 X-Received: by 10.236.144.136 with SMTP id n8mr11782253yhj.22.1396347464917; Tue, 01 Apr 2014 03:17:44 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.37.225 with SMTP id r88ls3008747qgr.2.gmail; Tue, 01 Apr 2014 03:17:44 -0700 (PDT) X-Received: by 10.52.171.68 with SMTP id as4mr23547318vdc.0.1396347464783; Tue, 01 Apr 2014 03:17:44 -0700 (PDT) Received: from mail-vc0-x236.google.com (mail-vc0-x236.google.com [2607:f8b0:400c:c03::236]) by mx.google.com with ESMTPS id si3si3528119vcb.28.2014.04.01.03.17.44 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 01 Apr 2014 03:17:44 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c03::236 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c03::236; Received: by mail-vc0-f182.google.com with SMTP id ks9so9636639vcb.27 for ; Tue, 01 Apr 2014 03:17:44 -0700 (PDT) X-Received: by 10.221.63.1 with SMTP id xc1mr240873vcb.35.1396347464566; Tue, 01 Apr 2014 03:17:44 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.12.8 with SMTP id v8csp223228vcv; Tue, 1 Apr 2014 03:17:44 -0700 (PDT) X-Received: by 10.68.227.4 with SMTP id rw4mr30387457pbc.3.1396347463597; Tue, 01 Apr 2014 03:17:43 -0700 (PDT) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id tm7si10909986pac.475.2014.04.01.03.17.43 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Apr 2014 03:17:43 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-364304-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 15987 invoked by alias); 1 Apr 2014 10:17:31 -0000 Mailing-List: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org Precedence: list 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 Received: (qmail 15973 invoked by uid 89); 1 Apr 2014 10:17:30 -0000 X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: service87.mimecast.com Received: from service87.mimecast.com (HELO service87.mimecast.com) (91.220.42.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 01 Apr 2014 10:17:29 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Tue, 01 Apr 2014 11:17:26 +0100 Received: from SHAWIN205 ([10.1.255.212]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 1 Apr 2014 11:17:40 +0100 From: "Joey Ye" To: "'Ian Lance Taylor'" Cc: "gcc-patches" References: <000a01cf4808$67f71ce0$37e556a0$@arm.com> In-Reply-To: Subject: RE: [patch] Shorten Windows path Date: Tue, 1 Apr 2014 18:17:36 +0800 Message-ID: <000601cf4d93$9c975b50$d5c611f0$@arm.com> MIME-Version: 1.0 X-MC-Unique: 114040111172606901 X-Original-Sender: joey.ye@arm.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c03::236 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=pass header.i=@gcc.gnu.org X-Google-Group-Id: 836684582541 Ian, thanks for your comments. Please find answers and new version below: > -----Original Message----- > From: Ian Lance Taylor [mailto:iant@google.com] > Sent: 25 March 2014 21:09 > To: Joey Ye > Cc: gcc-patches > Subject: Re: [patch] Shorten Windows path > > On Tue, Mar 25, 2014 at 1:58 AM, Joey Ye wrote: > > Ping > > This code looks different on mainline. > > Writing "if ( do_canonical )" is not GCC style. Fixed > > This patch does not respect the configure option --disable-canonical-system- > headers. Solved by put is under the control of default ENABLE_CANONICAL_SYSTEM_HEADERS > > Also I personally don't actually know what the consequences would be. > Are there any downsides to canonicalizing header names? Since 4.8 system headers are by default canonicalized. This version only additionally canonical non-system headers. I can't think of any downsides. > > Ian ChangeLog.libcpp: * files.c (find_file_in_dir): Always try to shorten for DOS non-system headers. * init.c (ENABLE_CANONICAL_SYSTEM_HEADERS): Default enabled for DOS. diff --git a/libcpp/files.c b/libcpp/files.c index 7e88778..ad68682 100644 --- a/libcpp/files.c +++ b/libcpp/files.c @@ -387,8 +387,14 @@ find_file_in_dir (cpp_reader *pfile, _cpp_file *file, bool *invalid_pch) char *copy; void **pp; - /* We try to canonicalize system headers. */ - if (CPP_OPTION (pfile, canonical_system_headers) && file->dir->sysp) + /* We try to canonicalize system headers. For DOS based file + * system, we always try to shorten non-system headers, as DOS + * has a tighter constraint on max path length. */ + if (CPP_OPTION (pfile, canonical_system_headers) && file->dir->sysp +#ifdef HAVE_DOS_BASED_FILE_SYSTEM + || !file->dir->sysp +#endif + ) { char * canonical_path = maybe_shorter_path (path); if (canonical_path) diff --git a/libcpp/init.c b/libcpp/init.c index f10413a..b809515 100644 --- a/libcpp/init.c +++ b/libcpp/init.c @@ -27,8 +27,12 @@ along with this program; see the file COPYING3. If not see #include "filenames.h" #ifndef ENABLE_CANONICAL_SYSTEM_HEADERS +#ifdef HAVE_DOS_BASED_FILE_SYSTEM +#define ENABLE_CANONICAL_SYSTEM_HEADERS 1 +#else #define ENABLE_CANONICAL_SYSTEM_HEADERS 0 #endif +#endif static void init_library (void); static void mark_named_operators (cpp_reader *, int);