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=-10.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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 5E11BC43467 for ; Mon, 12 Oct 2020 15:33:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 16EC420878 for ; Mon, 12 Oct 2020 15:33:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602516816; bh=iBxbnuj7o+zJYOKO4LCS7mJDPbA3GirOHGN+bblRIT8=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=L/AHTK+4wSrHnGYEUjq6NcxBkPpQk/ZXZubrwG5tY/G9eA6l2Nwu8Y/G7XFUQHtHm L3kHF4SR6wMVp5fZlsB63HxZzn5qQauRxRyvps/KPWrPTxcgT6LkoP7ZKzL1+j2Jnn +iYseHGkFee1CC2v6SO6pTaBWNhLslXWju1XLowE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390028AbgJLPdf (ORCPT ); Mon, 12 Oct 2020 11:33:35 -0400 Received: from conssluserg-06.nifty.com ([210.131.2.91]:36641 "EHLO conssluserg-06.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389797AbgJLPde (ORCPT ); Mon, 12 Oct 2020 11:33:34 -0400 Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) (authenticated) by conssluserg-06.nifty.com with ESMTP id 09CFXJSO020029; Tue, 13 Oct 2020 00:33:19 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-06.nifty.com 09CFXJSO020029 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1602516799; bh=4xfUkRM4tDIXFk/3vrkgZkiCeT2rEb0t423IsRd/G98=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=S4Z7K/Q4dgPotevhgimcaWst96OFcDNem9aT2gZGQEVZQSpbcec2wkRhGrkoR8FRF AKgJxRu6983EDPetJ+7/ldK7/GQ6DHGagMcCSpoAnvP0mZScXkUy8GQ0uxogCcx7wo J/1ArJR51t87dXtsHaB3AdBoLIWnnPLANOeu3Jd4U5YFTdGfrpGRK34mH69oJbOWUP QdwwQfLta5BZuONKcZYFeNiKXhXtdCKK0NpJoYinAO4ijbMtRMgy0yxXO9JClwcW/Q KbEcv24TxFdwp9KxczT23+k5GCB7H5SH5oaS586NRYertNgtLeJ1K1X9zdDZ/3wSMN hdx7ij93ZDG1A== X-Nifty-SrcIP: [209.85.210.170] Received: by mail-pf1-f170.google.com with SMTP id a200so13796763pfa.10; Mon, 12 Oct 2020 08:33:19 -0700 (PDT) X-Gm-Message-State: AOAM533QSGcJCcUv0/aO17dSXOlxL9zwQdyiS17MuMwlrWUenByp42YF qCJvMiyUpZa/ngjUe2XRv9App2268mDc/3m2Xvk= X-Google-Smtp-Source: ABdhPJzY2prhw5FRGtjof81jBwHsEX04/rS7YVZYomzkxPVRVeT+isQ1/XL54G7/ldeuyrFICLsLjjjsTEcVQcpRjHk= X-Received: by 2002:a17:90a:c285:: with SMTP id f5mr21414855pjt.87.1602516798361; Mon, 12 Oct 2020 08:33:18 -0700 (PDT) MIME-Version: 1.0 References: <979bb7b0-2cae-3cd7-2fbd-7fcece9aafd1@gmail.com> In-Reply-To: <979bb7b0-2cae-3cd7-2fbd-7fcece9aafd1@gmail.com> From: Masahiro Yamada Date: Tue, 13 Oct 2020 00:32:41 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH RFC 2/2] kbuild: use interpreters to invoke scripts To: Ujjwal Kumar Cc: Michal Marek , Andrew Morton , Kees Cook , Lukas Bulwahn , Nathan Chancellor , Nick Desaulniers , Linux Kbuild mailing list , Linux Kernel Mailing List , linux-arm-kernel , linux-ia64@vger.kernel.org, clang-built-linux , linux-kernel-mentees@lists.linuxfoundation.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Oct 4, 2020 at 12:21 AM 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 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)") These changes look wrong to me. $($(CONFIG_SHELL) -> $(shell $(CONFIG_SHELL) > 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 > > -- > You received this message because you are subscribed to the Google Groups "Clang Built Linux" group. > To unsubscribe from this group and stop receiving emails from it, send an email to clang-built-linux+unsubscribe@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/979bb7b0-2cae-3cd7-2fbd-7fcece9aafd1%40gmail.com. -- Best Regards Masahiro Yamada 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.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 E5011C433E7 for ; Mon, 12 Oct 2020 15:35:53 +0000 (UTC) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (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 7A3D720878 for ; Mon, 12 Oct 2020 15:35:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=nifty.com header.i=@nifty.com header.b="S4Z7K/Q4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7A3D720878 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org 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 whitealder.osuosl.org (Postfix) with ESMTP id 5671986E0A; Mon, 12 Oct 2020 15:35:53 +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 S+xlBPmZfFUE; Mon, 12 Oct 2020 15:35:52 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by whitealder.osuosl.org (Postfix) with ESMTP id 5934986E08; Mon, 12 Oct 2020 15:35:52 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 3D88AC0893; Mon, 12 Oct 2020 15:35:52 +0000 (UTC) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 5E242C0052 for ; Mon, 12 Oct 2020 15:35:51 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 52E9186E17 for ; Mon, 12 Oct 2020 15:35:51 +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 MpeVXcpXCzkw for ; Mon, 12 Oct 2020 15:35:49 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from condef-08.nifty.com (condef-08.nifty.com [202.248.20.73]) by whitealder.osuosl.org (Postfix) with ESMTPS id 1D8E686E0A for ; Mon, 12 Oct 2020 15:35:48 +0000 (UTC) Received: from conssluserg-04.nifty.com ([10.126.8.83])by condef-08.nifty.com with ESMTP id 09CFXUOY014847 for ; Tue, 13 Oct 2020 00:33:30 +0900 Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) (authenticated) by conssluserg-04.nifty.com with ESMTP id 09CFXJad031848 for ; Tue, 13 Oct 2020 00:33:19 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-04.nifty.com 09CFXJad031848 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1602516799; bh=4xfUkRM4tDIXFk/3vrkgZkiCeT2rEb0t423IsRd/G98=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=S4Z7K/Q4dgPotevhgimcaWst96OFcDNem9aT2gZGQEVZQSpbcec2wkRhGrkoR8FRF AKgJxRu6983EDPetJ+7/ldK7/GQ6DHGagMcCSpoAnvP0mZScXkUy8GQ0uxogCcx7wo J/1ArJR51t87dXtsHaB3AdBoLIWnnPLANOeu3Jd4U5YFTdGfrpGRK34mH69oJbOWUP QdwwQfLta5BZuONKcZYFeNiKXhXtdCKK0NpJoYinAO4ijbMtRMgy0yxXO9JClwcW/Q KbEcv24TxFdwp9KxczT23+k5GCB7H5SH5oaS586NRYertNgtLeJ1K1X9zdDZ/3wSMN hdx7ij93ZDG1A== X-Nifty-SrcIP: [209.85.210.175] Received: by mail-pf1-f175.google.com with SMTP id c20so3206592pfr.8 for ; Mon, 12 Oct 2020 08:33:19 -0700 (PDT) X-Gm-Message-State: AOAM532UKhUzntXdWUvVZMP3/+8iapJd7ZK05IpGRRPhqpBRjpE/PNGQ fw91V4dAE2CPamBrzUTgsnL+6fWEnzxhZ8h6D0U= X-Google-Smtp-Source: ABdhPJzY2prhw5FRGtjof81jBwHsEX04/rS7YVZYomzkxPVRVeT+isQ1/XL54G7/ldeuyrFICLsLjjjsTEcVQcpRjHk= X-Received: by 2002:a17:90a:c285:: with SMTP id f5mr21414855pjt.87.1602516798361; Mon, 12 Oct 2020 08:33:18 -0700 (PDT) MIME-Version: 1.0 References: <979bb7b0-2cae-3cd7-2fbd-7fcece9aafd1@gmail.com> In-Reply-To: <979bb7b0-2cae-3cd7-2fbd-7fcece9aafd1@gmail.com> From: Masahiro Yamada Date: Tue, 13 Oct 2020 00:32:41 +0900 X-Gmail-Original-Message-ID: Message-ID: To: Ujjwal Kumar Cc: Michal Marek , linux-ia64@vger.kernel.org, Kees Cook , Linux Kbuild mailing list , Nick Desaulniers , Linux Kernel Mailing List , clang-built-linux , Nathan Chancellor , linux-kernel-mentees@lists.linuxfoundation.org, Andrew Morton , linux-arm-kernel 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 Sun, Oct 4, 2020 at 12:21 AM 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 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)") These changes look wrong to me. $($(CONFIG_SHELL) -> $(shell $(CONFIG_SHELL) > 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 > > -- > You received this message because you are subscribed to the Google Groups "Clang Built Linux" group. > To unsubscribe from this group and stop receiving emails from it, send an email to clang-built-linux+unsubscribe@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/979bb7b0-2cae-3cd7-2fbd-7fcece9aafd1%40gmail.com. -- Best Regards Masahiro Yamada _______________________________________________ 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=-10.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,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 2D3FBC433E7 for ; Mon, 12 Oct 2020 15:35:07 +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 C565520878 for ; Mon, 12 Oct 2020 15:35:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ck+W8gdE"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=nifty.com header.i=@nifty.com header.b="S4Z7K/Q4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C565520878 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org 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:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=p43u5jS7sA2F7hdBHRWOJoIUy0IohC8OP8IUjORDinA=; b=ck+W8gdEtVCBC213WrbDLwUHa O7SXOEX/s6be2RZtqCmywsN/siVRojXAvW80Q1ICN7GsLl1NSUhOiLUMJyic45qmtKxV6Ht9t6p13 grOjowj44739XtlC6Mar9GauEeEx1pBTyy89Q5GSA7ERJ69rI3XM8VZ2ajrpyqBiFM6amST1qLTdt gBUaHZAK7byOcIFUwRg75tO5Ho6rDh3qtuCIgfaYZTrSQlxD3yBdIDUQrM5mD4mSP7VdNDCkac+1k 70zE4bzK8ti7tia8hdKkYcSc6IHiq2MgnM+6G/UNOhO18+xCzbsZ0i4GlvNnWw16kezjgf59p59jC x1WX+ZvOw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kRzpV-0000Pa-9n; Mon, 12 Oct 2020 15:33:41 +0000 Received: from conssluserg-06.nifty.com ([210.131.2.91]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kRzpR-0000OG-Qz for linux-arm-kernel@lists.infradead.org; Mon, 12 Oct 2020 15:33:39 +0000 Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) (authenticated) by conssluserg-06.nifty.com with ESMTP id 09CFXJS5020028 for ; Tue, 13 Oct 2020 00:33:19 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-06.nifty.com 09CFXJS5020028 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1602516799; bh=4xfUkRM4tDIXFk/3vrkgZkiCeT2rEb0t423IsRd/G98=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=S4Z7K/Q4dgPotevhgimcaWst96OFcDNem9aT2gZGQEVZQSpbcec2wkRhGrkoR8FRF AKgJxRu6983EDPetJ+7/ldK7/GQ6DHGagMcCSpoAnvP0mZScXkUy8GQ0uxogCcx7wo J/1ArJR51t87dXtsHaB3AdBoLIWnnPLANOeu3Jd4U5YFTdGfrpGRK34mH69oJbOWUP QdwwQfLta5BZuONKcZYFeNiKXhXtdCKK0NpJoYinAO4ijbMtRMgy0yxXO9JClwcW/Q KbEcv24TxFdwp9KxczT23+k5GCB7H5SH5oaS586NRYertNgtLeJ1K1X9zdDZ/3wSMN hdx7ij93ZDG1A== X-Nifty-SrcIP: [209.85.210.172] Received: by mail-pf1-f172.google.com with SMTP id e10so13824562pfj.1 for ; Mon, 12 Oct 2020 08:33:19 -0700 (PDT) X-Gm-Message-State: AOAM5327GYbtchLx8KXgSVNAcgSZcraQm6SC3yNp6/1UWjQDiYCtnLNz tKfJ6y+F+Z9FTz9USsoLsgzixUXDMg0fTDoodMk= X-Google-Smtp-Source: ABdhPJzY2prhw5FRGtjof81jBwHsEX04/rS7YVZYomzkxPVRVeT+isQ1/XL54G7/ldeuyrFICLsLjjjsTEcVQcpRjHk= X-Received: by 2002:a17:90a:c285:: with SMTP id f5mr21414855pjt.87.1602516798361; Mon, 12 Oct 2020 08:33:18 -0700 (PDT) MIME-Version: 1.0 References: <979bb7b0-2cae-3cd7-2fbd-7fcece9aafd1@gmail.com> In-Reply-To: <979bb7b0-2cae-3cd7-2fbd-7fcece9aafd1@gmail.com> From: Masahiro Yamada Date: Tue, 13 Oct 2020 00:32:41 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH RFC 2/2] kbuild: use interpreters to invoke scripts To: Ujjwal Kumar X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201012_113338_196581_DA8D5368 X-CRM114-Status: GOOD ( 24.03 ) 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 mailing list , Nick Desaulniers , Linux Kernel Mailing List , clang-built-linux , Lukas Bulwahn , Nathan Chancellor , linux-kernel-mentees@lists.linuxfoundation.org, Andrew Morton , linux-arm-kernel 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 Sun, Oct 4, 2020 at 12:21 AM 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 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)") These changes look wrong to me. $($(CONFIG_SHELL) -> $(shell $(CONFIG_SHELL) > 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 > > -- > You received this message because you are subscribed to the Google Groups "Clang Built Linux" group. > To unsubscribe from this group and stop receiving emails from it, send an email to clang-built-linux+unsubscribe@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/979bb7b0-2cae-3cd7-2fbd-7fcece9aafd1%40gmail.com. -- Best Regards Masahiro Yamada _______________________________________________ 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: Masahiro Yamada Date: Mon, 12 Oct 2020 15:32:41 +0000 Subject: Re: [PATCH RFC 2/2] kbuild: use interpreters to invoke scripts Message-Id: 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: Michal Marek , Andrew Morton , Kees Cook , Lukas Bulwahn , Nathan Chancellor , Nick Desaulniers , Linux Kbuild mailing list , Linux Kernel Mailing List , linux-arm-kernel , linux-ia64@vger.kernel.org, clang-built-linux , linux-kernel-mentees@lists.linuxfoundation.org On Sun, Oct 4, 2020 at 12:21 AM Ujjwal Kumar wr= ote: > > 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.c24c3f67addcce0cea9a9d4= c@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/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 > > # ----------------------------------------------------------------------= ----- > # 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 $(obj= tree)/.config > + xargs $(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_co= nfig.sh -m $(objtree)/.config > $(Q)$(MAKE) -f $(srctree)/Makefile olddefconfig > > # ----------------------------------------------------------------------= ----- > 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 > $@ > > 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 > $@ > > # 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-r= ange=F12-f15,f32-f127 \ > -falign-functions2 -frename-registers -fno-optimize-si= bling-calls > KBUILD_CFLAGS_KERNEL :=3D -mconstant-gp > > -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)") These changes look wrong to me. $($(CONFIG_SHELL) -> $(shell $(CONFIG_SHELL) > 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 > $@ > > 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 =3D $(srctree)/scripts/kernel-doc -none $< > + cmd_checkdoc =3D $(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)" !=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,$@),, \ > -- > 2.26.2 > > -- > You received this message because you are subscribed to the Google Groups= "Clang Built Linux" group. > To unsubscribe from this group and stop receiving emails from it, send an= email to clang-built-linux+unsubscribe@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgi= d/clang-built-linux/979bb7b0-2cae-3cd7-2fbd-7fcece9aafd1%40gmail.com. --=20 Best Regards Masahiro Yamada