From patchwork Sun Mar 25 23:09:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 10306989 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D25A160212 for ; Sun, 25 Mar 2018 23:09:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BDB8B28D6D for ; Sun, 25 Mar 2018 23:09:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ADEE129158; Sun, 25 Mar 2018 23:09:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1B6E028D6D for ; Sun, 25 Mar 2018 23:09:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751776AbeCYXJh (ORCPT ); Sun, 25 Mar 2018 19:09:37 -0400 Received: from mail-wm0-f54.google.com ([74.125.82.54]:37152 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751204AbeCYXJh (ORCPT ); Sun, 25 Mar 2018 19:09:37 -0400 Received: by mail-wm0-f54.google.com with SMTP id r131so5352219wmb.2 for ; Sun, 25 Mar 2018 16:09:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=lx2p2Wp8yr44TeK4sPrx0qxUDRmq2znJcOIaSTI7g4M=; b=HGoAaQ4MCkILt6nx8sCdosqp9CcYY1ThFQEFQ9iLIC4TcRcMg9WmkOfb3p/fw4HKqJ ZBZwxPM4OPzx3tdej5hJkuv3OowOrDgbbasL/uafCQeXv/yuRIhjv5Vu/WtdR/oCI+Gc eKo/SOnArM7F1VvgZzJoKbxZAaFV0Ie7uHz1A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=lx2p2Wp8yr44TeK4sPrx0qxUDRmq2znJcOIaSTI7g4M=; b=SmnlZ9SeL7rqM7a4yNM2cp/8a/tc20HfvLw4e3ZecHgskSF7WUoCdaOgbPaHgqv7Lc SmXVeUy2Nnr37y6z85IhjCIH8Ipu+UU6bfGY5cCa1KQM+PcIMCzFdsWFpbOxobj9kzXO SAI3+hEfBfvjkrWQG3eUDw6nPRZXHOh5wnlvglI+ZlancSBx2JDHZAtIxh5am9idOCtD NpR05HHHV28BjduGq93+gRD5gu9eQ2Q9/nvPQTQV8VKlZ/dEzbvQdMFPtb5JErHVmyNy cGNfBp33mB98nwr1aJqNK/tncLfT8R63gSCUuADIAdPiMbuJHBpBC8l4CblVVt1IdcZ+ WzMQ== X-Gm-Message-State: AElRT7HadpmKWpRP4Bpjv3o2acUX+/kgauY4xA1N/VByJjmKWWAm6VFV TD3cnktPDMDW+CIQMj6A5frGuG6daA8= X-Google-Smtp-Source: AG47ELskLFl2Z+sGf4JcZx/ag0pTydo9mf4Nlc2ENOKLo360480/vNQ3qAXiUtcIvY5jIacvwpzkZw== X-Received: by 10.80.164.65 with SMTP id v1mr30851816edb.282.1522019375589; Sun, 25 Mar 2018 16:09:35 -0700 (PDT) Received: from prevas-ravi.waoo.dk (dhcp-5-186-126-104.cgn.ip.fibianet.dk. [5.186.126.104]) by smtp.gmail.com with ESMTPSA id d30sm9347966edd.79.2018.03.25.16.09.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 25 Mar 2018 16:09:34 -0700 (PDT) From: Rasmus Villemoes To: linux-kbuild@vger.kernel.org, Masahiro Yamada , Douglas Anderson , Nick Desaulniers , Matthias Kaehlcke Cc: Michal Marek , Josh Poimboeuf , Peter Zijlstra , Rasmus Villemoes , linux-kernel@vger.kernel.org Subject: [PATCH 2/1] Kbuild: fix # escaping in .cmd files for future Make Date: Mon, 26 Mar 2018 01:09:16 +0200 Message-Id: <20180325230918.23161-1-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180325223239.14778-1-linux@rasmusvillemoes.dk> References: <20180325223239.14778-1-linux@rasmusvillemoes.dk> Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The latest official Make release is 4.2.1 from mid-2016, but the current git release has this relevant note in the 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. Prepare for whatever future Make release contains that change by fixing up the .cmd file escaping - without this, make always thinks the command string has changed and hence rebuilds everything. Signed-off-by: Rasmus Villemoes --- So the previous patch made everything build, but building again revealed that this central place very much also needed fixing. scripts/Kbuild.include | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index 065324a8046f..7a926e4688f4 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include @@ -10,6 +10,7 @@ space := $(empty) $(empty) space_escape := _-_SPACE_-_ right_paren := ) left_paren := ( +pound := \# ### # Name of target with a '.' as filename prefix. foo/bar.o => foo/.bar.o @@ -328,7 +329,7 @@ endif # (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.