From patchwork Wed Sep 19 02:35:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 146994 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp153248ljw; Tue, 18 Sep 2018 19:37:26 -0700 (PDT) X-Google-Smtp-Source: ANB0VdY8CTyxnm4UTjL4acClceZv6IhrWMhzhgAHKBPDVtmtlCsFyOBZ1110L6dDp5jHb5oGB0NY X-Received: by 2002:aa7:ca51:: with SMTP id j17-v6mr57237749edt.45.1537324646540; Tue, 18 Sep 2018 19:37:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537324646; cv=none; d=google.com; s=arc-20160816; b=nCEDave86ZRyckdiCR6fEpBKo8vEEdl80lqFaxRDf03ER44YLwWjp2UvjQHknU9ajk 4LXtqvq4WDUxrISQYqP/UZdZ8URBfIfVEuTz+my6S0RhgxYH8BlD6dGA+o29da9FnYgu h8+uFBhqEumSozsCZfR2Hku5y15u2gCjSOvBm8U7DuIZDze9kXNWGBvJrcRxK/Cfs9ei krfWYqn0SfOCBvUnnuUGl+KmGprFLm3gKQUUiXOlKcKZYosPERsJokwh/paB13rdjE/o IOVpBloewhEggITrj7K+Z1WbOqyrVIWsuRpmh/KVYooDgKJOS2YRg/0hlL/15Qtpin5J hoaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :cc:mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:dkim-filter; bh=1U1F/ENPJ1a8wMAVe8IR+mOPz62zOAUVm+8Aap7Tmu0=; b=pLQIhMI7vxQoFkYuMzzTSouX/TKX06rScw0qGGRlB9NMD7Y2wD/8ySCJs6pxMynlbB AH7d4O1ZBIVvoTdiL9R3VZItsmWLB2ZQsAxedB8OEhUipIFSCOaaa1PK6lMmnMkSLvDZ +A8KVRzHFS3id93mhmLxj6bFC1nQUQxs4mgtiMYwrtlz3Cmzwk74hCB4mLSsAZ9jPGQn cNwhCS7uD4cDoN4/WHI3IZtSdXkLQ7ysC02UXUOJ172MNi4ncyPMcqBquei9I3ts/8p4 WL4w/aHoLYK+bVI4E1XwZlQjqkztx7DTvd2xFEcd4A8T6/p8g4muuR/GdqECzqRZcGLr QdLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b="ENSPyW7/"; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id q57-v6si21696579edq.188.2018.09.18.19.37.26; Tue, 18 Sep 2018 19:37:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b="ENSPyW7/"; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id 2A7D6C21C2C; Wed, 19 Sep 2018 02:37:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: * X-Spam-Status: No, score=1.3 required=5.0 tests=RCVD_IN_RP_RNBL, T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 47C41C21DED; Wed, 19 Sep 2018 02:37:19 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 59881C21E73; Wed, 19 Sep 2018 02:36:48 +0000 (UTC) Received: from conuserg-08.nifty.com (conuserg-08.nifty.com [210.131.2.75]) by lists.denx.de (Postfix) with ESMTPS id 2022CC21E1E for ; Wed, 19 Sep 2018 02:36:47 +0000 (UTC) Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-08.nifty.com with ESMTP id w8J2ZxD3027177; Wed, 19 Sep 2018 11:36:00 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com w8J2ZxD3027177 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1537324560; bh=Ww5BFutPs4hporoKLovo8Sq7FNZVRdRG9CXMsbWi2dU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ENSPyW7/3XuSV7mfkO4tvUNWubap7540bAzEAJ8reEoHBqphN+Ens6LzIgDrsZyXk Eiofzt4dLNWMCMpt6vT0xty3hY5piWuS8ZdsysA9wn5IQBs/HjmjfwpG8hrqoVUFdh qXoShWQkuWWWP1o7HcPEgIcsC9Md9bdvENT0mbUQTr3w/vynDhjzF2UPF49QHPFQAU 66/oaUVWpjFpRORlIv0DumNQUOjIT9ttfipLFGGIbeN4Qtx2R/p7ZivRy6BTnKWaTT aMsdpZtUOSP9JEvaHlyEBcmDyyZncETbRGUEgvIpco4X+IXSiiO62sfcPSQW9+ukIU tA1uqXfHg18zw== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Wed, 19 Sep 2018 11:35:56 +0900 Message-Id: <1537324557-27033-2-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1537324557-27033-1-git-send-email-yamada.masahiro@socionext.com> References: <1537324557-27033-1-git-send-email-yamada.masahiro@socionext.com> MIME-Version: 1.0 Cc: Randy Dunlap , Rasmus Villemoes Subject: [U-Boot] [PATCH 1/2] Kbuild: fix # escaping in .cmd files for future Make X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: Rasmus Villemoes [ commit 9564a8cf422d7b58f6e857e3546d346fa970191e in Linux ] I tried building using a freshly built Make (4.2.1-69-g8a731d1), but already the objtool build broke with orc_dump.c: In function ‘orc_dump’: orc_dump.c:106:2: error: ‘elf_getshnum’ is deprecated [-Werror=deprecated-declarations] if (elf_getshdrnum(elf, &nr_sections)) { Turns out that with that new Make, the backslash was not removed, so cpp didn't see a #include directive, grep found nothing, and -DLIBELF_USE_DEPRECATED was wrongly put in CFLAGS. Now, that new Make behaviour is documented in their NEWS file: * WARNING: Backward-incompatibility! Number signs (#) appearing inside a macro reference or function invocation no longer introduce comments and should not be escaped with backslashes: thus a call such as: foo := $(shell echo '#') is legal. Previously the number sign needed to be escaped, for example: foo := $(shell echo '\#') Now this latter will resolve to "\#". If you want to write makefiles portable to both versions, assign the number sign to a variable: C := \# foo := $(shell echo '$C') This was claimed to be fixed in 3.81, but wasn't, for some reason. To detect this change search for 'nocomment' in the .FEATURES variable. This also fixes up the two make-cmd instances to replace # with $(pound) rather than with \#. There might very well be other places that need similar fixup in preparation for whatever future Make release contains the above change, but at least this builds an x86_64 defconfig with the new make. Link: https://bugzilla.kernel.org/show_bug.cgi?id=197847 Cc: Randy Dunlap Signed-off-by: Rasmus Villemoes Signed-off-by: Masahiro Yamada --- scripts/Kbuild.include | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index 2c7918a..13ebddd 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include @@ -7,6 +7,7 @@ quote := " squote := ' empty := space := $(empty) $(empty) +pound := \# ### # Name of target with a '.' as filename prefix. foo/bar.o => foo/.bar.o @@ -242,11 +243,11 @@ endif # Replace >$< with >$$< to preserve $ when reloading the .cmd file # (needed for make) -# Replace >#< with >\#< to avoid starting a comment in the .cmd file +# Replace >#< with >$(pound)< to avoid starting a comment in the .cmd file # (needed for make) # Replace >'< with >'\''< to be able to enclose the whole string in '...' # (needed for the shell) -make-cmd = $(call escsq,$(subst \#,\\\#,$(subst $$,$$$$,$(cmd_$(1))))) +make-cmd = $(call escsq,$(subst $(pound),$$(pound),$(subst $$,$$$$,$(cmd_$(1))))) # Find any prerequisites that is newer than target or that does not exist. # PHONY targets skipped in both cases.