From patchwork Fri Apr 13 13:53:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Deacon X-Patchwork-Id: 133375 Delivered-To: patch@linaro.org Received: by 10.46.84.18 with SMTP id i18csp753738ljb; Fri, 13 Apr 2018 06:53:02 -0700 (PDT) X-Google-Smtp-Source: AIpwx48lt6TaYK7tJrCwM9eDjv7MN5atNVjam4s+tHxLBdR/+y4AgfRHcrJV7ZH1t+/EcX4NwL2q X-Received: by 10.167.134.25 with SMTP id p25mr11541281pfn.93.1523627582663; Fri, 13 Apr 2018 06:53:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523627582; cv=none; d=google.com; s=arc-20160816; b=gga/w2CtTmSqfglyIjT6FTuO7/7821z6k4uVjQ0QnAj4In8M56vpgHJpmuoTyoU+Qb zGZiAs+3l8dFqA69zvSHw/xzp6CTK/SOwBgyS2gEaqiTIHLr7CabwnFsW/Zd5NpOOqsG 1q96nDSGVSjSFNEHyEuryLZW/dip5CeCYmNeQMqgpT3DAd1crT4ymV7l7Q86S9pdJ7jW DfcDLq5ebSAfuaRDgaHwqYs5e2sXi40WqOZXMmQAhoAR98PkGX60kjyrmvl1DyF2qm75 F3tSRTG/xqXjAvmTsEF9ef17Myy6mXExVwMxRFgW9Il0tSBA94Zt35cmnCXl14YM8ZKF qyDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=f8kagfF3tGlYf7B6LVxwfPEsMCgAMLkxpUL2zhzc5bQ=; b=Im2FLtQa4VfkV7Eph/oBu7e5YuooHLi+R9c1cOWJmnIoxjirEGaOwlY3kBEuCK337E lq1Uu4i4DNaZrIz5v6XGDIA3AgWaS9W3n5ONIvj6JUGy5YhXLZ8HpeNI1RAXbxujGbjP GBNpHbN8sNDQf0EVr5oLhKT2wH+rpRcColW6pzO+/vyqfyLVdoQ3i12Gvgf8OSe+AKFT ZJY5z97ME8kC2aTUSRPHrl5cyVORpoNTl1h0K6hRhdgaYQSC1bnkpKxrouV+xkfIwNyN Sv+wvl1xMGbffmDo2qUspJNU8cRXGG9fzcUEi7JEDbJrMZjUXW1/QuicFl2zrNOGc9ZG vqGw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y125si4092111pgy.91.2018.04.13.06.53.02; Fri, 13 Apr 2018 06:53:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754490AbeDMNw7 (ORCPT + 29 others); Fri, 13 Apr 2018 09:52:59 -0400 Received: from foss.arm.com ([217.140.101.70]:42684 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754450AbeDMNw4 (ORCPT ); Fri, 13 Apr 2018 09:52:56 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B9FD415B2; Fri, 13 Apr 2018 06:52:55 -0700 (PDT) Received: from edgewater-inn.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 88E113F587; Fri, 13 Apr 2018 06:52:55 -0700 (PDT) Received: by edgewater-inn.cambridge.arm.com (Postfix, from userid 1000) id 81FA41AE55DC; Fri, 13 Apr 2018 14:53:11 +0100 (BST) From: Will Deacon To: linux-kernel@vger.kernel.org Cc: Will Deacon , Jiri Olsa , Dave Martin , Arnaldo Carvalho de Melo , Ingo Molnar Subject: [PATCH] tools build: Use -Xpreprocessor instead of -Wp and leave pathnames intact Date: Fri, 13 Apr 2018 14:53:10 +0100 Message-Id: <1523627590-27612-1-git-send-email-will.deacon@arm.com> X-Mailer: git-send-email 2.1.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Build.include invokes the pre-processor via GCC in order to generate a dependency list for the input file. Since these options are passed using '-Wp,-M...,$(depfile)' it is important that $(depfile) does not contain any commas, so these are substituted with underscores. This substitution will break the build if the directory name of the output directory happens to include a comma, e.g. when using "aiaiai" for bisection testing: | cc1: fatal error: x86/tools/objtool/fixdep.o: No such file or directory | compilation terminated. | cat: /tmp/aiaiai-test-patchset.qroS/before/obj.defconfig_x86/tools/objtool/.fixdep.o.d: No such file or directory | make[5]: *** [tools/objtool/fixdep.o] Error 1 We can address this by using -Xpreprocessor instead of -Wp, which allows us to pass down an unmodified pathname. Cc: Jiri Olsa Cc: Dave Martin Cc: Arnaldo Carvalho de Melo Cc: Ingo Molnar Signed-off-by: Will Deacon --- As an aside, the way we currently pass the depfile to -MD appears to be in direct contradiction with the preprocessor documentation, although it does work with the cc1 implementation. tools/build/Build.include | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) -- 2.1.4 diff --git a/tools/build/Build.include b/tools/build/Build.include index 418871d02ebf..e1914f8e2328 100644 --- a/tools/build/Build.include +++ b/tools/build/Build.include @@ -22,9 +22,7 @@ dot-target = $(dir $@).$(notdir $@) basetarget = $(basename $(notdir $@)) ### -# The temporary file to save gcc -MD generated dependencies must not -# contain a comma -depfile = $(subst $(comma),_,$(dot-target).d) +depfile = $(dot-target).d ### # Check if both arguments has same arguments. Result is empty string if equal. @@ -89,12 +87,12 @@ if_changed = $(if $(strip $(any-prereq) $(arg-check)), \ # - per target C flags # - per object C flags # - BUILD_STR macro to allow '-D"$(variable)"' constructs -c_flags_1 = -Wp,-MD,$(depfile) -Wp,-MT,$@ $(CFLAGS) -D"BUILD_STR(s)=\#s" $(CFLAGS_$(basetarget).o) $(CFLAGS_$(obj)) +c_flags_1 = -Xpreprocessor -MD -Xpreprocessor $(depfile) -Xpreprocessor -MT -Xpreprocessor $@ $(CFLAGS) -D"BUILD_STR(s)=\#s" $(CFLAGS_$(basetarget).o) $(CFLAGS_$(obj)) c_flags_2 = $(filter-out $(CFLAGS_REMOVE_$(basetarget).o), $(c_flags_1)) c_flags = $(filter-out $(CFLAGS_REMOVE_$(obj)), $(c_flags_2)) -cxx_flags = -Wp,-MD,$(depfile) -Wp,-MT,$@ $(CXXFLAGS) -D"BUILD_STR(s)=\#s" $(CXXFLAGS_$(basetarget).o) $(CXXFLAGS_$(obj)) +cxx_flags = -Xpreprocessor -MD -Xpreprocessor $(depfile) -Xpreprocessor -MT -Xpreprocessor $@ $(CXXFLAGS) -D"BUILD_STR(s)=\#s" $(CXXFLAGS_$(basetarget).o) $(CXXFLAGS_$(obj)) ### ## HOSTCC C flags -host_c_flags = -Wp,-MD,$(depfile) -Wp,-MT,$@ $(CHOSTFLAGS) -D"BUILD_STR(s)=\#s" $(CHOSTFLAGS_$(basetarget).o) $(CHOSTFLAGS_$(obj)) +host_c_flags = -Xpreprocessor -MD -Xpreprocessor $(depfile) -Xpreprocessor -MT -Xpreprocessor $@ $(CHOSTFLAGS) -D"BUILD_STR(s)=\#s" $(CHOSTFLAGS_$(basetarget).o) $(CHOSTFLAGS_$(obj))