From: Masahiro Yamada <masahiroy@kernel.org>
To: linux-kbuild@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org,
Masahiro Yamada <masahiroy@kernel.org>,
Michal Marek <michal.lkml@markovi.net>,
Nick Desaulniers <ndesaulniers@google.com>
Subject: [PATCH] kbuild: suppress warnings for single builds of vmlinux.lds, *.a, etc.
Date: Mon, 26 Sep 2022 10:26:09 +0900 [thread overview]
Message-ID: <20220926012609.3976305-1-masahiroy@kernel.org> (raw)
vmlinux-deps is unneeded because the dependency can directly list
$(KBUILD_LDS) $(KBUILD_VMLINUX_OBJS) $(KBUILD_VMLINUX_LIBS)
Do not cancel the rule; building an individual vmlinux.lds, built-in.a,
or lib.a is working now, but the warning "overriding recipe for target"
is shown.
Without this patch:
$ make arch/x86/kernel/vmlinux.lds
Makefile:1798: warning: overriding recipe for target 'arch/x86/kernel/vmlinux.lds'
Makefile:1162: warning: ignoring old recipe for target 'arch/x86/kernel/vmlinux.lds'
[ snip ]
LDS arch/x86/kernel/vmlinux.lds
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
Makefile | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/Makefile b/Makefile
index 244c07f1cc70..3e6974b4ebf2 100644
--- a/Makefile
+++ b/Makefile
@@ -1118,7 +1118,8 @@ endif
export KBUILD_VMLINUX_OBJS KBUILD_VMLINUX_LIBS
export KBUILD_LDS := arch/$(SRCARCH)/kernel/vmlinux.lds
-vmlinux-deps := $(KBUILD_LDS) $(KBUILD_VMLINUX_OBJS) $(KBUILD_VMLINUX_LIBS)
+# The actual objects are generated when descending.
+$(sort $(KBUILD_LDS) $(KBUILD_VMLINUX_OBJS) $(KBUILD_VMLINUX_LIBS)): .
# Recurse until adjust_autoksyms.sh is satisfied
PHONY += autoksyms_recursive
@@ -1157,10 +1158,6 @@ vmlinux: scripts/link-vmlinux.sh vmlinux.o $(KBUILD_LDS) FORCE
targets := vmlinux
-# The actual objects are generated when descending,
-# make sure no implicit rule kicks in
-$(sort $(vmlinux-deps)): . ;
-
filechk_kernel.release = \
echo "$(KERNELVERSION)$$($(CONFIG_SHELL) $(srctree)/scripts/setlocalversion $(srctree))"
--
2.34.1
next reply other threads:[~2022-09-26 1:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-26 1:26 Masahiro Yamada [this message]
2022-09-26 6:34 ` [PATCH] kbuild: suppress warnings for single builds of vmlinux.lds, *.a, etc Masahiro Yamada
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220926012609.3976305-1-masahiroy@kernel.org \
--to=masahiroy@kernel.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.lkml@markovi.net \
--cc=ndesaulniers@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox