From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.0 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, NICE_REPLY_A,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 57704C433E7 for ; Mon, 12 Oct 2020 18:44:48 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D137520838 for ; Mon, 12 Oct 2020 18:44:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="2yqAq7cU"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ie6zixgX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D137520838 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=16zbf/nbDp/EFnwH9Ix2cYcyFV6NWTGrvxJKUwb61dI=; b=2yqAq7cUebp9wKgNDBBtWbAiK hip9Pxjq4PEeRGHQnjMNp3Sz+G/n27BBM4JIIs6bDUIWljItTcmr5bcqGigtK+eGpfqW2Baxg2SIr tRWXmYy56ELfiRopZyOP2f/bmiR9cUcTezwLjNWBLrzeLGou0vZkg2wScYHDCYyo4HsThjDc5HpTV 8FHEhzcagFpf83rFqDNtyxW5qGlomwfkLHWtGjlwQRrF24gkeRkVXit6qC44a8BGhsFT9B6WNVEbF 4pfZIWT69LZH++uhuRGFR/IZyCA7dJ5waEwmU51O2dNvgxDVCpO4IjCNYuLj4Wa0ZC2OE3X9RAUv6 JbUnnihCw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kS2mc-0005wq-Ql; Mon, 12 Oct 2020 18:42:54 +0000 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kS2ma-0005wC-Mk for linux-arm-kernel@lists.infradead.org; Mon, 12 Oct 2020 18:42:53 +0000 Received: by mail-pf1-x443.google.com with SMTP id 10so4819052pfp.5 for ; Mon, 12 Oct 2020 11:42:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=c68FH0ayGziDihZ9IYbZBNMjx/y2IsXlW9Ldybbm4jU=; b=ie6zixgXJeTa6LHBerbXDBYBBNXGY2lUgcJxg3YweIzpWPNzPLKMhG+gD+ewRcglrM Sjvtw/TFUr2XUNjqd6rgulNzpTG226xhPwQ57kxnnMeyvscqWT523AIK9kYUDgIqkYj9 k4ONBw4T1knBe+YoImKNG3lUzqrUrEeXO7C/dlyWjk1AS4OUR6xnKieDS3an+omlvd+x uFIiDJqWi4gKKoIWde0kfX1sqZqidYDU/WV9tn7EdCFLb00DXf3P/vPaotpMdZE+G9sC u/AqAL/+oTVh/3LdoRX8VFkB/hJP1UuenBgwYAyKYM6Q/XBCf2DsBKZSXL8V02RmP6tM elcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=c68FH0ayGziDihZ9IYbZBNMjx/y2IsXlW9Ldybbm4jU=; b=UvPK+iC4KdmKahnS6TAUVO3Hzs9DCjUrrnL9mreMva51X5BP1AEOIr6IYx1JD9SUPl Bll+ANO7a+inoZ6+5hP/xYW0FtxC7cg9qM6S2CYZaHZkFeIk8lYmO4hhD3vF6rVwl6Ad xPcVRPkqPmNlLGR7wmRCbBmu1QjC+pp1quwx9Pcl76czUpYu8XBXXHdyC7cdpdbe+eSr I4sn5YTNBmOhUYBurEPi1xZiEXBW3qVs3sUT/Ph6fwQ56m63BYPHg0ai9dLLHAvAgN3i GEaiJp9TaDv7Af7m1v4PIf1+ycE/7mJ2heTgNlGdzAJk/zcl/BqBpXD8n6rV8k88FQLk U6HA== X-Gm-Message-State: AOAM533zh746m9jM3p9hf5YOksJRl36FXrXtg9qfkcCikIExX5eTPOUV 9WK+vj2lATIJi+c+2eEHhhA= X-Google-Smtp-Source: ABdhPJxUl9gci4/N41y7sONJDgGFBjycbw30Mwd3jwVk5l13YuKgeIkuPnhxJyNVL46QE57cXsBv2w== X-Received: by 2002:a17:90a:b64:: with SMTP id 91mr21130861pjq.93.1602528170431; Mon, 12 Oct 2020 11:42:50 -0700 (PDT) Received: from localhost.localdomain ([2405:201:a404:280a:90bd:7a49:dcda:1fb1]) by smtp.gmail.com with ESMTPSA id f1sm19566915pfe.145.2020.10.12.11.42.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 12 Oct 2020 11:42:49 -0700 (PDT) Subject: Re: [PATCH v2 2/2] kbuild: use interpreters to invoke scripts To: Lukas Bulwahn References: <20201012170631.1241502-1-ujjwalkumar0501@gmail.com> <20201012170631.1241502-3-ujjwalkumar0501@gmail.com> From: Ujjwal Kumar Message-ID: Date: Tue, 13 Oct 2020 00:12:41 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201012_144252_811351_E5163D7A X-CRM114-Status: GOOD ( 23.08 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michal Marek , linux-ia64@vger.kernel.org, Kees Cook , linux-kbuild@vger.kernel.org, Masahiro Yamada , Nick Desaulniers , linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, Nathan Chancellor , linux-kernel-mentees@lists.linuxfoundation.org, Andrew Morton , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 12/10/20 11:50 pm, Lukas Bulwahn wrote: > > > On Mon, 12 Oct 2020, Ujjwal Kumar wrote: > >> We cannot rely on execute bits to be set on files in the repository. >> The build script should use the explicit interpreter when invoking any >> script from the repository. >> >> Link: https://lore.kernel.org/lkml/20200830174409.c24c3f67addcce0cea9a9d4c@linux-foundation.org/ >> Link: https://lore.kernel.org/lkml/202008271102.FEB906C88@keescook/ >> >> Suggested-by: Andrew Morton >> Suggested-by: Kees Cook >> Suggested-by: Lukas Bulwahn >> Signed-off-by: Ujjwal Kumar >> --- >> Makefile | 4 ++-- >> arch/arm64/kernel/vdso/Makefile | 2 +- >> arch/arm64/kernel/vdso32/Makefile | 2 +- >> arch/ia64/Makefile | 4 ++-- >> arch/nds32/kernel/vdso/Makefile | 2 +- >> scripts/Makefile.build | 2 +- >> scripts/Makefile.package | 4 ++-- >> 7 files changed, 10 insertions(+), 10 deletions(-) >> >> diff --git a/Makefile b/Makefile >> index 0af7945caa61..df20e71dd7c8 100644 >> --- a/Makefile >> +++ b/Makefile >> @@ -1256,7 +1256,7 @@ include/generated/utsrelease.h: include/config/kernel.release FORCE >> PHONY += headerdep >> headerdep: >> $(Q)find $(srctree)/include/ -name '*.h' | xargs --max-args 1 \ >> - $(srctree)/scripts/headerdep.pl -I$(srctree)/include >> + $(PERL) $(srctree)/scripts/headerdep.pl -I$(srctree)/include >> >> # --------------------------------------------------------------------------- >> # Kernel headers >> @@ -1312,7 +1312,7 @@ PHONY += kselftest-merge >> kselftest-merge: >> $(if $(wildcard $(objtree)/.config),, $(error No .config exists, config your kernel first!)) >> $(Q)find $(srctree)/tools/testing/selftests -name config | \ >> - xargs $(srctree)/scripts/kconfig/merge_config.sh -m $(objtree)/.config >> + xargs $(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh -m $(objtree)/.config >> $(Q)$(MAKE) -f $(srctree)/Makefile olddefconfig >> >> # --------------------------------------------------------------------------- >> diff --git a/arch/arm64/kernel/vdso/Makefile b/arch/arm64/kernel/vdso/Makefile >> index edccdb77c53e..fb07804b7fc1 100644 >> --- a/arch/arm64/kernel/vdso/Makefile >> +++ b/arch/arm64/kernel/vdso/Makefile >> @@ -65,7 +65,7 @@ $(obj)/%.so: $(obj)/%.so.dbg FORCE >> # Generate VDSO offsets using helper script >> gen-vdsosym := $(srctree)/$(src)/gen_vdso_offsets.sh >> quiet_cmd_vdsosym = VDSOSYM $@ >> - cmd_vdsosym = $(NM) $< | $(gen-vdsosym) | LC_ALL=C sort > $@ >> + cmd_vdsosym = $(NM) $< | $(CONFIG_SHELL) $(gen-vdsosym) | LC_ALL=C sort > $@ >> >> include/generated/vdso-offsets.h: $(obj)/vdso.so.dbg FORCE >> $(call if_changed,vdsosym) >> diff --git a/arch/arm64/kernel/vdso32/Makefile b/arch/arm64/kernel/vdso32/Makefile >> index 7f96a1a9f68c..617c9ac58156 100644 >> --- a/arch/arm64/kernel/vdso32/Makefile >> +++ b/arch/arm64/kernel/vdso32/Makefile >> @@ -205,7 +205,7 @@ quiet_cmd_vdsomunge = MUNGE $@ >> gen-vdsosym := $(srctree)/$(src)/../vdso/gen_vdso_offsets.sh >> quiet_cmd_vdsosym = VDSOSYM $@ >> # The AArch64 nm should be able to read an AArch32 binary >> - cmd_vdsosym = $(NM) $< | $(gen-vdsosym) | LC_ALL=C sort > $@ >> + cmd_vdsosym = $(NM) $< | $(CONFIG_SHELL) $(gen-vdsosym) | LC_ALL=C sort > $@ >> >> # Install commands for the unstripped file >> quiet_cmd_vdso_install = INSTALL32 $@ >> diff --git a/arch/ia64/Makefile b/arch/ia64/Makefile >> index 703b1c4f6d12..86d42a2d09cb 100644 >> --- a/arch/ia64/Makefile >> +++ b/arch/ia64/Makefile >> @@ -27,8 +27,8 @@ cflags-y := -pipe $(EXTRA) -ffixed-r13 -mfixed-range=f12-f15,f32-f127 \ >> -falign-functions=32 -frename-registers -fno-optimize-sibling-calls >> KBUILD_CFLAGS_KERNEL := -mconstant-gp >> >> -GAS_STATUS = $(shell $(srctree)/arch/ia64/scripts/check-gas "$(CC)" "$(OBJDUMP)") >> -KBUILD_CPPFLAGS += $(shell $(srctree)/arch/ia64/scripts/toolchain-flags "$(CC)" "$(OBJDUMP)" "$(READELF)") >> +GAS_STATUS = $(shell $(CONFIG_SHELL) $(srctree)/arch/ia64/scripts/check-gas "$(CC)" "$(OBJDUMP)") >> +KBUILD_CPPFLAGS += $(shell $(CONFIG_SHELL) $(srctree)/arch/ia64/scripts/toolchain-flags "$(CC)" "$(OBJDUMP)" "$(READELF)") > > Here is an instance of what Masahiro-san pointed out being wrong. > > Ujjwal, will you send a v3? Following is the quoted text from the reply mail from Masahiro >> -GAS_STATUS = $(shell $(srctree)/arch/ia64/scripts/check-gas "$(CC)" "$(OBJDUMP)") >> -KBUILD_CPPFLAGS += $(shell $(srctree)/arch/ia64/scripts/toolchain-flags "$(CC)" "$(OBJDUMP)" "$(READELF)") >> +GAS_STATUS = $($(CONFIG_SHELL) $(srctree)/arch/ia64/scripts/check-gas "$(CC)" "$(OBJDUMP)") >> +KBUILD_CPPFLAGS += $($(CONFIG_SHELL) $(srctree)/arch/ia64/scripts/toolchain-flags "$(CC)" "$(OBJDUMP)" "$(READELF)") > > > > These changes look wrong to me. > > $($(CONFIG_SHELL) -> $(shell $(CONFIG_SHELL) > >From the above text, I understand as follows: That my proposed change: $(shell $(src...) -> $($(CONFIG_SHELL) $(src...) is WRONG and in the next line he suggested the required correction. That being: $($(CONFIG_SHELL) -> $(shell $(CONFIG_SHELL) Which is in v2 of the patch series. Lukas, please correct me if I'm wrong so that I can work on v3 if required. Also, Nathan reviewed both the patches in v1 of this series. So, should I be the one who adds his tag in next iterations? Thanks Ujjwal Kumar _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel