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=-9.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 3584FC4363C for ; Sun, 4 Oct 2020 07:38:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E8E75206B5 for ; Sun, 4 Oct 2020 07:38:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KZ79Zwex" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725898AbgJDHiC (ORCPT ); Sun, 4 Oct 2020 03:38:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725820AbgJDHiB (ORCPT ); Sun, 4 Oct 2020 03:38:01 -0400 Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B20CC0613CE; Sun, 4 Oct 2020 00:38:01 -0700 (PDT) Received: by mail-pj1-x1044.google.com with SMTP id i3so3431346pjz.4; Sun, 04 Oct 2020 00:38:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=KeIBefhZsCRO4ge0tnlcVP1csYq2ZaieViEu5oQdjWM=; b=KZ79ZwexBZCSaikyMHyLbQYpztvjAwRxiBnOp6vvicTtkLRGK/2jNxyI0b8MwBllXc QpDxO5YsDeO0Lxyqpjl7O7aNTJARNrjf0XiPSq98tIZATqWFfvh9dkrcWD07DUpSKMff I2MDipSqOhK/rPJBLer6j7yo8gqiYUJ9zjzYtrG1J2JXgx9nLtUb8HNb6zZgySjz4l8F bQDV6bZBwiu8nXI3+oZcwqekNjtyB6XUEvHlYxwsJge2FYo2VDMqnkRP2G1hkkAbwLSa rAfoxQInZHmQaTawHfX1RfIE7zMOt8LBfPNDezijQPqyFBTSBnee+s5VlNAOB1CvKqZQ Lf5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=KeIBefhZsCRO4ge0tnlcVP1csYq2ZaieViEu5oQdjWM=; b=OBwqkUhRtBRMrQurnpURcfyK2leZOYDkw1jZd2+YJIPMAVXwn5kTnjFMKqGTmL6hOa wv82eE6I923go6Vkha57IeeQAFoMQTR0/8bHomN/h/6wQ8hpauMP7cXzHC5hDdAMGldX b5itJG+WJnvyeAtRQ456uKLloVDqNizD/UpGTxTGV2b8fxLBs2bxg6+god9P5vGZXNRp tt1Y25lUg838PJUTQRByoNjJ2aMyeEi6pNRpRA1cqwXllTpIRZHe9m1CJVfnIhk9lEQJ NoBoxDZcWggSkbxqokb0SpPWRltrPvHIaEL2KPXmUJEnMr91dgTTiHCVaVilYgjqQB0j 65HA== X-Gm-Message-State: AOAM532uNw4ynt7mrQJPc/89Y6xi19l3cFB0GcoFBhlgXy4wcx62iiAs +cMV53F9dTkghktoIcqekltVlWtbMYBZ4A== X-Google-Smtp-Source: ABdhPJycN20ekkZ0qL0lJ5NOXI4D3uXjx6yb5JQuIiSg9d/p7BJXIkbWyYH6lUGIr9BO4U7cLO8WmA== X-Received: by 2002:a17:90a:f187:: with SMTP id bv7mr9914620pjb.198.1601797081067; Sun, 04 Oct 2020 00:38:01 -0700 (PDT) Received: from Ryzen-9-3900X.localdomain (ip68-3-136-221.ph.ph.cox.net. [68.3.136.221]) by smtp.gmail.com with ESMTPSA id x17sm4774092pfj.1.2020.10.04.00.37.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Oct 2020 00:38:00 -0700 (PDT) Date: Sun, 4 Oct 2020 00:37:57 -0700 From: Nathan Chancellor To: Ujjwal Kumar Cc: Masahiro Yamada , Michal Marek , Andrew Morton , Kees Cook , Lukas Bulwahn , Nick Desaulniers , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, clang-built-linux@googlegroups.com, linux-kernel-mentees@lists.linuxfoundation.org Subject: Re: [PATCH RFC 2/2] kbuild: use interpreters to invoke scripts Message-ID: <20201004073757.GA31746@Ryzen-9-3900X.localdomain> References: <979bb7b0-2cae-3cd7-2fbd-7fcece9aafd1@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <979bb7b0-2cae-3cd7-2fbd-7fcece9aafd1@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Oct 03, 2020 at 08:51:23PM +0530, 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 Reviewed-by: Nathan Chancellor > --- > 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 > 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=-9.3 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 01BD3C47095 for ; Sun, 4 Oct 2020 07:38:05 +0000 (UTC) Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (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 8DDB7206B5 for ; Sun, 4 Oct 2020 07:38:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KZ79Zwex" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8DDB7206B5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-kernel-mentees-bounces@lists.linuxfoundation.org Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 2808D86FDF; Sun, 4 Oct 2020 07:38:04 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id E1NiJexxFqMf; Sun, 4 Oct 2020 07:38:03 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by hemlock.osuosl.org (Postfix) with ESMTP id 6254386FDB; Sun, 4 Oct 2020 07:38:03 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 50FCDC016F; Sun, 4 Oct 2020 07:38:03 +0000 (UTC) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 7D59CC0051 for ; Sun, 4 Oct 2020 07:38:02 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 776B98602E for ; Sun, 4 Oct 2020 07:38:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sqQy7UmXquh8 for ; Sun, 4 Oct 2020 07:38:01 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pj1-f68.google.com (mail-pj1-f68.google.com [209.85.216.68]) by whitealder.osuosl.org (Postfix) with ESMTPS id 9016986004 for ; Sun, 4 Oct 2020 07:38:01 +0000 (UTC) Received: by mail-pj1-f68.google.com with SMTP id j8so1749410pjy.5 for ; Sun, 04 Oct 2020 00:38:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=KeIBefhZsCRO4ge0tnlcVP1csYq2ZaieViEu5oQdjWM=; b=KZ79ZwexBZCSaikyMHyLbQYpztvjAwRxiBnOp6vvicTtkLRGK/2jNxyI0b8MwBllXc QpDxO5YsDeO0Lxyqpjl7O7aNTJARNrjf0XiPSq98tIZATqWFfvh9dkrcWD07DUpSKMff I2MDipSqOhK/rPJBLer6j7yo8gqiYUJ9zjzYtrG1J2JXgx9nLtUb8HNb6zZgySjz4l8F bQDV6bZBwiu8nXI3+oZcwqekNjtyB6XUEvHlYxwsJge2FYo2VDMqnkRP2G1hkkAbwLSa rAfoxQInZHmQaTawHfX1RfIE7zMOt8LBfPNDezijQPqyFBTSBnee+s5VlNAOB1CvKqZQ Lf5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=KeIBefhZsCRO4ge0tnlcVP1csYq2ZaieViEu5oQdjWM=; b=tVaLK7EamnVjIe09LWDldX3ht1QxhzD1iecWunLOAm4NvBVzPO22cw1fXzykCZ/vgF jJZE8dzYF2XKMT8CtFwrzyNhj3w1abCVln7Q8Ysy5bXkmeEg0yQCR36EE8HlW1yXCL0F DdrMIx8ZsPVJnU78YsmxqTtjxipVm8jmooubxw32ioSw0G8T2/K5vsUIYAnCjQrWMN7r wk+HKvx0sTW+SzTu8p0UZp2ZiFtA0LBISLg/uj6XBjxw/x3HFoG6Yvb2tAV48p8eUM4g 4zwBtw/8sGaA5b31Vi4BoUcYAkE0xPXoP8YAQtJ8p1tzvqfqRJVltzfnuRTMyOjw0x7D 5Faw== X-Gm-Message-State: AOAM530Z/UcUmiPp1agg3Pu4pN/i2pHWr1b7cVBN3JpdIxehBgd8YDr6 ROPJ4A8oTaZYq6YBbYlHVFw= X-Google-Smtp-Source: ABdhPJycN20ekkZ0qL0lJ5NOXI4D3uXjx6yb5JQuIiSg9d/p7BJXIkbWyYH6lUGIr9BO4U7cLO8WmA== X-Received: by 2002:a17:90a:f187:: with SMTP id bv7mr9914620pjb.198.1601797081067; Sun, 04 Oct 2020 00:38:01 -0700 (PDT) Received: from Ryzen-9-3900X.localdomain (ip68-3-136-221.ph.ph.cox.net. [68.3.136.221]) by smtp.gmail.com with ESMTPSA id x17sm4774092pfj.1.2020.10.04.00.37.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Oct 2020 00:38:00 -0700 (PDT) Date: Sun, 4 Oct 2020 00:37:57 -0700 From: Nathan Chancellor To: Ujjwal Kumar Message-ID: <20201004073757.GA31746@Ryzen-9-3900X.localdomain> References: <979bb7b0-2cae-3cd7-2fbd-7fcece9aafd1@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <979bb7b0-2cae-3cd7-2fbd-7fcece9aafd1@gmail.com> 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, Andrew Morton , linux-kernel-mentees@lists.linuxfoundation.org, linux-arm-kernel@lists.infradead.org Subject: Re: [Linux-kernel-mentees] [PATCH RFC 2/2] kbuild: use interpreters to invoke scripts X-BeenThere: linux-kernel-mentees@lists.linuxfoundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-kernel-mentees-bounces@lists.linuxfoundation.org Sender: "Linux-kernel-mentees" On Sat, Oct 03, 2020 at 08:51:23PM +0530, 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 Reviewed-by: Nathan Chancellor > --- > 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-kernel-mentees mailing list Linux-kernel-mentees@lists.linuxfoundation.org https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees 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=-9.5 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 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 5ADDAC4363C for ; Sun, 4 Oct 2020 07:39:46 +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 0EDD5206B5 for ; Sun, 4 Oct 2020 07:39:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="MZ+KYlF5"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KZ79Zwex" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0EDD5206B5 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:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=cwJ0mwCCH2eQNJC6hNa9sWmra1J8Ik/UVT4dm+s3aZ4=; b=MZ+KYlF524Z4uyE8zgoPXuDYD aeZuhL9RGJfnSPDvw2vdd1zkAYU6htwroTmH2slp9Q6KzBSXKSlV/1iW22FxhKfhYlqOzfpjr7vhI Pgq0y12KNZCswc8GI9ybXCh80ddH5CyqLie330muh0ihsFVFWhKWF+QhcapOmwAoBxcYP6IeAtpDE 4otyxJM/JDyovimNa9l0Gc3vOXN/2ySLTV/5sCbS2oshFeGzu601x+PqPNT6KS9CFW2lLy5fIWOHw aa5LFbQk8uPmW/pn7N3L6yDhrwayo87fU1eBPnvP3HHwxf9tETzcD8z8bBfZbGQYyPzdskbcjk9/I 8ng9L46kA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kOyat-0007dq-CC; Sun, 04 Oct 2020 07:38:08 +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 1kOyap-0007dN-V9 for linux-arm-kernel@lists.infradead.org; Sun, 04 Oct 2020 07:38:05 +0000 Received: by mail-pj1-x1042.google.com with SMTP id b17so3442996pji.1 for ; Sun, 04 Oct 2020 00:38:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=KeIBefhZsCRO4ge0tnlcVP1csYq2ZaieViEu5oQdjWM=; b=KZ79ZwexBZCSaikyMHyLbQYpztvjAwRxiBnOp6vvicTtkLRGK/2jNxyI0b8MwBllXc QpDxO5YsDeO0Lxyqpjl7O7aNTJARNrjf0XiPSq98tIZATqWFfvh9dkrcWD07DUpSKMff I2MDipSqOhK/rPJBLer6j7yo8gqiYUJ9zjzYtrG1J2JXgx9nLtUb8HNb6zZgySjz4l8F bQDV6bZBwiu8nXI3+oZcwqekNjtyB6XUEvHlYxwsJge2FYo2VDMqnkRP2G1hkkAbwLSa rAfoxQInZHmQaTawHfX1RfIE7zMOt8LBfPNDezijQPqyFBTSBnee+s5VlNAOB1CvKqZQ Lf5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=KeIBefhZsCRO4ge0tnlcVP1csYq2ZaieViEu5oQdjWM=; b=aBvN0+7hsDnFp9U84U6HMH+MXAPTyGH28A+LcdyjzgYTkpewDPnNmJNSxa0HPfeLRb qa0tNGsttA0Sp1nF0nxSOIVzxFRYsccGIvLTPzut7Y50VMdTIMdaOYNeckRyCygm7GhX W9NvPFxfb+1MUWpfioeA7LE0x8Gb5q3rdj9KK3ARV09pYuRE4HOu5dwg7RCv165lhTeV 8QVtjviYnwZTpdjtj6+wxzYKqfH9R1HqkNo3nFCyYIOKD48Y9QT9NcFglr8QSAhFKDxv sZhKYJrqXfYe+U1UAxwReyD440qchplJ4njicNInz2veACebsZyJ4WPu9TsvpEG5z9rt Z9KQ== X-Gm-Message-State: AOAM5313lr6OdesP+NVLUBh5vRBniDWHlNkh+vY3E4nCgvF7nn4cYwAh V+yhr0qSCp9AsgYG3xxQh6g= X-Google-Smtp-Source: ABdhPJycN20ekkZ0qL0lJ5NOXI4D3uXjx6yb5JQuIiSg9d/p7BJXIkbWyYH6lUGIr9BO4U7cLO8WmA== X-Received: by 2002:a17:90a:f187:: with SMTP id bv7mr9914620pjb.198.1601797081067; Sun, 04 Oct 2020 00:38:01 -0700 (PDT) Received: from Ryzen-9-3900X.localdomain (ip68-3-136-221.ph.ph.cox.net. [68.3.136.221]) by smtp.gmail.com with ESMTPSA id x17sm4774092pfj.1.2020.10.04.00.37.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Oct 2020 00:38:00 -0700 (PDT) Date: Sun, 4 Oct 2020 00:37:57 -0700 From: Nathan Chancellor To: Ujjwal Kumar Subject: Re: [PATCH RFC 2/2] kbuild: use interpreters to invoke scripts Message-ID: <20201004073757.GA31746@Ryzen-9-3900X.localdomain> References: <979bb7b0-2cae-3cd7-2fbd-7fcece9aafd1@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <979bb7b0-2cae-3cd7-2fbd-7fcece9aafd1@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201004_033804_027416_CB048994 X-CRM114-Status: GOOD ( 18.79 ) 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, Lukas Bulwahn , Andrew Morton , linux-kernel-mentees@lists.linuxfoundation.org, 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 Sat, Oct 03, 2020 at 08:51:23PM +0530, 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 Reviewed-by: Nathan Chancellor > --- > 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nathan Chancellor Date: Sun, 04 Oct 2020 07:37:57 +0000 Subject: Re: [PATCH RFC 2/2] kbuild: use interpreters to invoke scripts Message-Id: <20201004073757.GA31746@Ryzen-9-3900X.localdomain> List-Id: References: <979bb7b0-2cae-3cd7-2fbd-7fcece9aafd1@gmail.com> In-Reply-To: <979bb7b0-2cae-3cd7-2fbd-7fcece9aafd1@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: Ujjwal Kumar Cc: Masahiro Yamada , Michal Marek , Andrew Morton , Kees Cook , Lukas Bulwahn , Nick Desaulniers , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, clang-built-linux@googlegroups.com, linux-kernel-mentees@lists.linuxfoundation.org On Sat, Oct 03, 2020 at 08:51:23PM +0530, 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. >=20 > Link: https://lore.kernel.org/lkml/20200830174409.c24c3f67addcce0cea9a9d4= c@linux-foundation.org/ > Link: https://lore.kernel.org/lkml/202008271102.FEB906C88@keescook/ >=20 > Suggested-by: Andrew Morton > Suggested-by: Kees Cook > Suggested-by: Lukas Bulwahn > Signed-off-by: Ujjwal Kumar Reviewed-by: Nathan Chancellor > --- > 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(-) >=20 > diff --git a/Makefile b/Makefile > index f93dbae71248..5f1399a576d4 100644 > --- a/Makefile > +++ b/Makefile > @@ -1258,7 +1258,7 @@ include/generated/utsrelease.h: include/config/kern= el.release FORCE > PHONY +=3D 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 > =20 > # ----------------------------------------------------------------------= ----- > # Kernel headers > @@ -1314,7 +1314,7 @@ PHONY +=3D 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 > =20 > # ----------------------------------------------------------------------= ----- > diff --git a/arch/arm64/kernel/vdso/Makefile b/arch/arm64/kernel/vdso/Mak= efile > 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 :=3D $(srctree)/$(src)/gen_vdso_offsets.sh > quiet_cmd_vdsosym =3D VDSOSYM $@ > - cmd_vdsosym =3D $(NM) $< | $(gen-vdsosym) | LC_ALL=3DC sort > $@ > + cmd_vdsosym =3D $(NM) $< | $(CONFIG_SHELL) $(gen-vdsosym) | LC_ALL= =3DC sort > $@ > =20 > 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 =3D MUNGE $@ > gen-vdsosym :=3D $(srctree)/$(src)/../vdso/gen_vdso_offsets.sh > quiet_cmd_vdsosym =3D VDSOSYM $@ > # The AArch64 nm should be able to read an AArch32 binary > - cmd_vdsosym =3D $(NM) $< | $(gen-vdsosym) | LC_ALL=3DC sort > $@ > + cmd_vdsosym =3D $(NM) $< | $(CONFIG_SHELL) $(gen-vdsosym) | LC_ALL= =3DC sort > $@ > =20 > # Install commands for the unstripped file > quiet_cmd_vdso_install =3D 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 :=3D -pipe $(EXTRA) -ffixed-r13 -mfixed-range= =F12-f15,f32-f127 \ > -falign-functions2 -frename-registers -fno-optimize-sibling-calls > KBUILD_CFLAGS_KERNEL :=3D -mconstant-gp > =20 > -GAS_STATUS =3D $(shell $(srctree)/arch/ia64/scripts/check-gas "$(CC)" "$= (OBJDUMP)") > -KBUILD_CPPFLAGS +=3D $(shell $(srctree)/arch/ia64/scripts/toolchain-flag= s "$(CC)" "$(OBJDUMP)" "$(READELF)") > +GAS_STATUS =3D $($(CONFIG_SHELL) $(srctree)/arch/ia64/scripts/check-gas = "$(CC)" "$(OBJDUMP)") > +KBUILD_CPPFLAGS +=3D $($(CONFIG_SHELL) $(srctree)/arch/ia64/scripts/tool= chain-flags "$(CC)" "$(OBJDUMP)" "$(READELF)") > =20 > ifeq ($(GAS_STATUS),buggy) > $(error Sorry, you need a newer version of the assember, one that is bui= lt from \ > diff --git a/arch/nds32/kernel/vdso/Makefile b/arch/nds32/kernel/vdso/Mak= efile > 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 :=3D $(srctree)/$(src)/gen_vdso_offsets.sh > quiet_cmd_vdsosym =3D VDSOSYM $@ > - cmd_vdsosym =3D $(NM) $< | $(gen-vdsosym) | LC_ALL=3DC sort > $@ > + cmd_vdsosym =3D $(NM) $< | $(CONFIG_SHELL) $(gen-vdsosym) | LC_ALL= =3DC sort > $@ > =20 > 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 > =20 > ifneq ($(KBUILD_EXTRA_WARN),) > - cmd_checkdoc =3D $(srctree)/scripts/kernel-doc -none $< > + cmd_checkdoc =3D $(PERL) $(srctree)/scripts/kernel-doc -none $< > endif > =20 > # 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)" !=3D "$(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=3D$(srctree)/.git archive --prefix=3D$(= perf-tar)/ \ > mkdir -p $(perf-tar); \ > git --git-dir=3D$(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,$@),, \ > --=20 > 2.26.2 >=20