Skip to content

Commit e22bbb8

Browse files
ardbiesheuvelmasahir0y
authored andcommitted
kbuild: link-vmlinux.sh: Make output file name configurable
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 <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
1 parent ba4d705 commit e22bbb8

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

scripts/Makefile.vmlinux

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ ARCH_POSTLINK := $(wildcard $(srctree)/arch/$(SRCARCH)/Makefile.postlink)
6969

7070
# Final link of vmlinux with optional arch pass after final link
7171
cmd_link_vmlinux = \
72-
$< "$(LD)" "$(KBUILD_LDFLAGS)" "$(LDFLAGS_vmlinux)"; \
72+
$< "$(LD)" "$(KBUILD_LDFLAGS)" "$(LDFLAGS_vmlinux)" "$@"; \
7373
$(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) $@, true)
7474

7575
targets += vmlinux

scripts/link-vmlinux.sh

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ set -e
3131
LD="$1"
3232
KBUILD_LDFLAGS="$2"
3333
LDFLAGS_vmlinux="$3"
34+
VMLINUX="$4"
3435

3536
is_enabled() {
3637
grep -q "^$1=y" include/config/auto.conf
@@ -283,23 +284,23 @@ if is_enabled CONFIG_VMLINUX_MAP; then
283284
generate_map=1
284285
fi
285286

286-
vmlinux_link vmlinux
287+
vmlinux_link "${VMLINUX}"
287288

288289
# fill in BTF IDs
289290
if is_enabled CONFIG_DEBUG_INFO_BTF; then
290-
info BTFIDS vmlinux
291+
info BTFIDS "${VMLINUX}"
291292
RESOLVE_BTFIDS_ARGS=""
292293
if is_enabled CONFIG_WERROR; then
293294
RESOLVE_BTFIDS_ARGS=" --fatal_warnings "
294295
fi
295-
${RESOLVE_BTFIDS} ${RESOLVE_BTFIDS_ARGS} vmlinux
296+
${RESOLVE_BTFIDS} ${RESOLVE_BTFIDS_ARGS} "${VMLINUX}"
296297
fi
297298

298-
mksysmap vmlinux System.map
299+
mksysmap "${VMLINUX}" System.map
299300

300301
if is_enabled CONFIG_BUILDTIME_TABLE_SORT; then
301-
info SORTTAB vmlinux
302-
if ! sorttable vmlinux; then
302+
info SORTTAB "${VMLINUX}"
303+
if ! sorttable "${VMLINUX}"; then
303304
echo >&2 Failed to sort kernel tables
304305
exit 1
305306
fi
@@ -315,4 +316,4 @@ if is_enabled CONFIG_KALLSYMS; then
315316
fi
316317

317318
# For fixdep
318-
echo "vmlinux: $0" > .vmlinux.d
319+
echo "${VMLINUX}: $0" > ".${VMLINUX}.d"

0 commit comments

Comments
 (0)