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.2 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, 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 73068C41604 for ; Sat, 3 Oct 2020 15:23:03 +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 16D60206DD for ; Sat, 3 Oct 2020 15:23:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Jjp+CYul"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NUELTX9M" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 16D60206DD 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:MIME-Version:Date:Message-ID:To:Subject:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=RRjuZrC5fQ+3nxINi4Zo5bS+BGbYA3wJyzQxpAD0dIY=; b=Jjp+CYulmfOrFGgFevhnuTsVEZ BNh0q5uost5SMrVPEFmZ4hn5T7YGejn8DzQ7LA13h3+CZI8J9njGwhD3LFZQ/n+EmZM6EoVqL8Nv9 0nditjy/q5aKISGwbChMjxk8y451trdRmcEqnkoQJn8ohhB+YxlyvJyTm/ItMG4uzApY4eK8w8qFm /TEgSPcmoOSyvejAboV3FHcrKvqWx0X3xHaNdBcrip8Yy9MjN9jU+t6ik4uamH3cthxoThIfdzCSG nwwvP2NpACDOF06JY3/iGGqK8PLvm3Vzujq3rI2BWqQmXyjPSLb+L4O1Kn5g5ysAKYfxcvlQFsGc/ 4Axo6NqQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kOjLx-0001Xu-0K; Sat, 03 Oct 2020 15:21:41 +0000 Received: from mail-pj1-x1042.google.com ([2607:f8b0:4864:20::1042]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kOjLv-0001Wh-Ga for linux-arm-kernel@lists.infradead.org; Sat, 03 Oct 2020 15:21:40 +0000 Received: by mail-pj1-x1042.google.com with SMTP id x2so2746609pjk.0 for ; Sat, 03 Oct 2020 08:21:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:to:cc:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=l/P8bXlpdS7hKkb+vBkGufM4cQSzKzU38G16UO2xhSM=; b=NUELTX9MYZwZ0qmChVIpQMZOA0R9gQhtJcKJYEIyKt4hhCQmyKRQ5xWatQFdNGz8i3 n5/4m0w01n8bu0nEqZz9+BZAJf8xV2EaJEIVzNRxqoWb15tw6QM607TuLmnma2j+U1cQ 7AjciRCBSUIs3WL5VW5YN778QV/uLAX4V4hvfaCGkPAzcUX3kHU/0MArU35FXsIhLdC8 o3YgTXVyfJ4/PfF8xzmFUibii6/VwBf5ozxeMGXBRr6SPD0z4l+N3g2h7wQrJQntBYy2 c+vS/eY0buy5tZ/sBpvezeca4zdKX5joK3Vu7BVpyF/oeTNpPTlYfhvNNrRiTcFVWGfS TQdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=l/P8bXlpdS7hKkb+vBkGufM4cQSzKzU38G16UO2xhSM=; b=oKTGbIWpii/02m3846QbdtGW3CtVzajlNTfbhkDWMlsaeqiogqE3hz2CJ2p8/uzuL8 FjFZ8MVl3noMdLJydMX/4wQk64vsKJEKc9NY2p0FaXCyM47bmR5FjydsMoC28COEHyHL COKXkAzJGTg09vsZJEib0Z6+9ltYTnUHyXNFOiphYAPxkV8G2BKGz4dmFUPpGvv5J4or yChfB59fu92EldgvqcPI0EK6TuhFQHv/vQ0ab3QG9/NoXI8jQr85IlAcXhnRacOi1eCt m0lyPcNesvGhmywyEV/KNgh4tucxqgpw4DygztrahPh7FyGnrxgwOIGJKzQzQDEo9WVu TCXA== X-Gm-Message-State: AOAM531d9iHxlKgtJMchDOUBSaJj7DfIeWGNyD+mxW+FQG2DaXkxSpGk R+Jq6eSzHwkmsv6XenR6a2M= X-Google-Smtp-Source: ABdhPJyxBf1T0SKtqw6BFlG+BT+UZXKVLEtyAshw6qptV6ujOfLJmmBb4FxK5J5YBtLNAf01yiAh/w== X-Received: by 2002:a17:90a:1189:: with SMTP id e9mr3196782pja.124.1601738494919; Sat, 03 Oct 2020 08:21:34 -0700 (PDT) Received: from localhost.localdomain ([2405:201:a404:280a:90bd:7a49:dcda:1fb1]) by smtp.gmail.com with ESMTPSA id n125sm6026241pfn.185.2020.10.03.08.21.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 03 Oct 2020 08:21:34 -0700 (PDT) From: Ujjwal Kumar Subject: [PATCH RFC 2/2] kbuild: use interpreters to invoke scripts To: Masahiro Yamada , Michal Marek Message-ID: <979bb7b0-2cae-3cd7-2fbd-7fcece9aafd1@gmail.com> Date: Sat, 3 Oct 2020 20:51:23 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201003_112139_562242_2A971C8D X-CRM114-Status: GOOD ( 16.97 ) 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: linux-ia64@vger.kernel.org, Kees Cook , linux-kbuild@vger.kernel.org, Nick Desaulniers , linux-kernel@vger.kernel.org, Ujjwal Kumar , clang-built-linux@googlegroups.com, Lukas Bulwahn , 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 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 f93dbae71248..5f1399a576d4 100644 --- a/Makefile +++ b/Makefile @@ -1258,7 +1258,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 @@ -1314,7 +1314,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 de981f7b4546..30fe93bb5488 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 572475b7b7ed..4f8fe34bc75a 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 2876a7df1b0a..5f6cc3c3da50 100644 --- a/arch/ia64/Makefile +++ b/arch/ia64/Makefile @@ -28,8 +28,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 = $($(CONFIG_SHELL) $(srctree)/arch/ia64/scripts/check-gas "$(CC)" "$(OBJDUMP)") +KBUILD_CPPFLAGS += $($(CONFIG_SHELL) $(srctree)/arch/ia64/scripts/toolchain-flags "$(CC)" "$(OBJDUMP)" "$(READELF)") ifeq ($(GAS_STATUS),buggy) $(error Sorry, you need a newer version of the assember, one that is built from \ diff --git a/arch/nds32/kernel/vdso/Makefile b/arch/nds32/kernel/vdso/Makefile index 55df25ef0057..e77d4bcfa7c1 100644 --- a/arch/nds32/kernel/vdso/Makefile +++ b/arch/nds32/kernel/vdso/Makefile @@ -39,7 +39,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/scripts/Makefile.build b/scripts/Makefile.build index a467b9323442..893217ee4a17 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -104,7 +104,7 @@ else ifeq ($(KBUILD_CHECKSRC),2) endif ifneq ($(KBUILD_EXTRA_WARN),) - cmd_checkdoc = $(srctree)/scripts/kernel-doc -none $< + cmd_checkdoc = $(PERL) $(srctree)/scripts/kernel-doc -none $< endif # Compile C sources (.c) diff --git a/scripts/Makefile.package b/scripts/Makefile.package index f952fb64789d..4fc16c4776cc 100644 --- a/scripts/Makefile.package +++ b/scripts/Makefile.package @@ -44,7 +44,7 @@ if test "$(objtree)" != "$(srctree)"; then \ echo >&2; \ false; \ fi ; \ -$(srctree)/scripts/setlocalversion --save-scmversion; \ +$(CONFIG_SHELL) $(srctree)/scripts/setlocalversion --save-scmversion; \ tar -I $(KGZIP) -c $(RCS_TAR_IGNORE) -f $(2).tar.gz \ --transform 's:^:$(2)/:S' $(TAR_CONTENT) $(3); \ rm -f $(objtree)/.scmversion @@ -123,7 +123,7 @@ git --git-dir=$(srctree)/.git archive --prefix=$(perf-tar)/ \ mkdir -p $(perf-tar); \ git --git-dir=$(srctree)/.git rev-parse HEAD > $(perf-tar)/HEAD; \ (cd $(srctree)/tools/perf; \ -util/PERF-VERSION-GEN $(CURDIR)/$(perf-tar)/); \ +$(CONFIG_SHELL) util/PERF-VERSION-GEN $(CURDIR)/$(perf-tar)/); \ tar rf $(perf-tar).tar $(perf-tar)/HEAD $(perf-tar)/PERF-VERSION-FILE; \ rm -r $(perf-tar); \ $(if $(findstring tar-src,$@),, \ -- 2.26.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel