From: Ard Biesheuvel <ardb+git@google.com>
To: linux-kernel@vger.kernel.org
Cc: linux-kbuild@vger.kernel.org, x86@kernel.org,
Ard Biesheuvel <ardb@kernel.org>,
Masahiro Yamada <masahiroy@kernel.org>,
Ingo Molnar <mingo@kernel.org>
Subject: [PATCH v2 1/4] Kbuild/link-vmlinux.sh: Make output file name configurable
Date: Tue, 11 Mar 2025 12:06:18 +0100 [thread overview]
Message-ID: <20250311110616.148682-7-ardb+git@google.com> (raw)
In-Reply-To: <20250311110616.148682-6-ardb+git@google.com>
From: Ard Biesheuvel <ardb@kernel.org>
In order to introduce an intermediate, non-stripped vmlinux build that
can be used by other build steps as an input, pass the output file name
to link-vmlinux.sh via its command line.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
scripts/Makefile.vmlinux | 2 +-
scripts/link-vmlinux.sh | 11 ++++++-----
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/scripts/Makefile.vmlinux b/scripts/Makefile.vmlinux
index 873caaa55313..3523ce3ce3dc 100644
--- a/scripts/Makefile.vmlinux
+++ b/scripts/Makefile.vmlinux
@@ -69,7 +69,7 @@ ARCH_POSTLINK := $(wildcard $(srctree)/arch/$(SRCARCH)/Makefile.postlink)
# Final link of vmlinux with optional arch pass after final link
cmd_link_vmlinux = \
- $< "$(LD)" "$(KBUILD_LDFLAGS)" "$(LDFLAGS_vmlinux)"; \
+ $< "$(LD)" "$(KBUILD_LDFLAGS)" "$(LDFLAGS_vmlinux)" "$@"; \
$(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) $@, true)
targets += vmlinux
diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh
index 56a077d204cf..e55026128e05 100755
--- a/scripts/link-vmlinux.sh
+++ b/scripts/link-vmlinux.sh
@@ -31,6 +31,7 @@ set -e
LD="$1"
KBUILD_LDFLAGS="$2"
LDFLAGS_vmlinux="$3"
+VMLINUX="$4"
is_enabled() {
grep -q "^$1=y" include/config/auto.conf
@@ -278,7 +279,7 @@ fi
strip_debug=
-vmlinux_link vmlinux
+vmlinux_link "${VMLINUX}"
# fill in BTF IDs
if is_enabled CONFIG_DEBUG_INFO_BTF; then
@@ -290,11 +291,11 @@ if is_enabled CONFIG_DEBUG_INFO_BTF; then
${RESOLVE_BTFIDS} ${RESOLVE_BTFIDS_ARGS} vmlinux
fi
-mksysmap vmlinux System.map
+mksysmap "${VMLINUX}" System.map
if is_enabled CONFIG_BUILDTIME_TABLE_SORT; then
- info SORTTAB vmlinux
- if ! sorttable vmlinux; then
+ info SORTTAB "${VMLINUX}"
+ if ! sorttable "${VMLINUX}"; then
echo >&2 Failed to sort kernel tables
exit 1
fi
@@ -310,4 +311,4 @@ if is_enabled CONFIG_KALLSYMS; then
fi
# For fixdep
-echo "vmlinux: $0" > .vmlinux.d
+echo "${VMLINUX}: $0" > ".${VMLINUX}.d"
--
2.49.0.rc0.332.g42c0ae87b1-goog
next prev parent reply other threads:[~2025-03-11 11:06 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-11 11:06 [PATCH v2 0/4] x86/build: Get rid of vmlinux postlink step Ard Biesheuvel
2025-03-11 11:06 ` Ard Biesheuvel [this message]
2025-03-11 11:06 ` [PATCH v2 2/4] Kbuild: Introduce Kconfig symbol for linking vmlinux with relocations Ard Biesheuvel
2025-03-11 11:06 ` [PATCH v2 3/4] Kbuild: Create intermediate vmlinux build with relocations preserved Ard Biesheuvel
2025-03-13 9:21 ` kernel test robot
2025-03-13 9:34 ` Ard Biesheuvel
2025-03-13 10:18 ` Ard Biesheuvel
2025-03-13 10:29 ` Masahiro Yamada
2025-03-18 8:17 ` Heiko Carstens
2025-03-18 8:27 ` Ard Biesheuvel
2025-03-18 16:26 ` Masahiro Yamada
2025-04-30 16:03 ` Conor Dooley
2025-04-30 16:29 ` Palmer Dabbelt
2025-03-11 11:06 ` [PATCH v2 4/4] x86: Get rid of Makefile.postlink Ard Biesheuvel
2025-03-11 11:17 ` Borislav Petkov
2025-03-12 12:35 ` Petr Pavlu
2025-03-13 2:08 ` Masahiro Yamada
2025-03-13 7:47 ` Ard Biesheuvel
2025-03-15 7:09 ` [PATCH v2 0/4] x86/build: Get rid of vmlinux postlink step 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=20250311110616.148682-7-ardb+git@google.com \
--to=ardb+git@google.com \
--cc=ardb@kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=masahiroy@kernel.org \
--cc=mingo@kernel.org \
--cc=x86@kernel.org \
/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