Skip to content

Commit 7375cbc

Browse files
committed
kbuild: stop merging *.symversions
Now modpost reads symbol versions from .*.cmd files. The merged *.symversions are no longer needed. Signed-off-by: Masahiro Yamada <[email protected]> Reviewed-by: Nicolas Schier <[email protected]> Tested-by: Nathan Chancellor <[email protected]> Tested-by: Sedat Dilek <[email protected]> # LLVM-14 (x86-64)
1 parent 7b45371 commit 7375cbc

File tree

2 files changed

+2
-38
lines changed

2 files changed

+2
-38
lines changed

scripts/Makefile.build

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -390,29 +390,15 @@ $(obj)/%.asn1.c $(obj)/%.asn1.h: $(src)/%.asn1 $(objtree)/scripts/asn1_compiler
390390
$(subdir-builtin): $(obj)/%/built-in.a: $(obj)/% ;
391391
$(subdir-modorder): $(obj)/%/modules.order: $(obj)/% ;
392392

393-
# combine symversions for later processing
394-
ifeq ($(CONFIG_LTO_CLANG) $(CONFIG_MODVERSIONS),y y)
395-
cmd_update_lto_symversions = \
396-
397-
$(foreach n, $(filter-out FORCE,$^), \
398-
$(if $(shell test -s $(n).symversions && echo y), \
399-
; cat $(n).symversions >> [email protected]))
400-
else
401-
cmd_update_lto_symversions = echo >/dev/null
402-
endif
403-
404393
#
405394
# Rule to compile a set of .o files into one .a file (without symbol table)
406395
#
407396

408397
quiet_cmd_ar_builtin = AR $@
409398
cmd_ar_builtin = rm -f $@; $(AR) cDPrST $@ $(real-prereqs)
410399

411-
quiet_cmd_ar_and_symver = AR $@
412-
cmd_ar_and_symver = $(cmd_update_lto_symversions); $(cmd_ar_builtin)
413-
414400
$(obj)/built-in.a: $(real-obj-y) FORCE
415-
$(call if_changed,ar_and_symver)
401+
$(call if_changed,ar_builtin)
416402

417403
#
418404
# Rule to create modules.order file
@@ -432,16 +418,13 @@ $(obj)/modules.order: $(obj-m) FORCE
432418
#
433419
# Rule to compile a set of .o files into one .a file (with symbol table)
434420
#
435-
quiet_cmd_ar_lib = AR $@
436-
cmd_ar_lib = $(cmd_update_lto_symversions); $(cmd_ar)
437421

438422
$(obj)/lib.a: $(lib-y) FORCE
439-
$(call if_changed,ar_lib)
423+
$(call if_changed,ar)
440424

441425
ifneq ($(CONFIG_LTO_CLANG)$(CONFIG_X86_KERNEL_IBT),)
442426
quiet_cmd_link_multi-m = AR [M] $@
443427
cmd_link_multi-m = \
444-
$(cmd_update_lto_symversions); \
445428
rm -f $@; \
446429
$(AR) cDPrsT $@ @$(patsubst %.o,%.mod,$@)
447430
else

scripts/link-vmlinux.sh

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -56,20 +56,6 @@ gen_initcalls()
5656
> .tmp_initcalls.lds
5757
}
5858

59-
# If CONFIG_LTO_CLANG is selected, collect generated symbol versions into
60-
# .tmp_symversions.lds
61-
gen_symversions()
62-
{
63-
info GEN .tmp_symversions.lds
64-
rm -f .tmp_symversions.lds
65-
66-
for o in ${KBUILD_VMLINUX_OBJS} ${KBUILD_VMLINUX_LIBS}; do
67-
if [ -f ${o}.symversions ]; then
68-
cat ${o}.symversions >> .tmp_symversions.lds
69-
fi
70-
done
71-
}
72-
7359
# Link of vmlinux.o used for section mismatch analysis
7460
# ${1} output file
7561
modpost_link()
@@ -88,10 +74,6 @@ modpost_link()
8874
gen_initcalls
8975
lds="-T .tmp_initcalls.lds"
9076

91-
if is_enabled CONFIG_MODVERSIONS; then
92-
gen_symversions
93-
fi
94-
9577
# This might take a while, so indicate that we're doing
9678
# an LTO link
9779
info LTO ${1}
@@ -307,7 +289,6 @@ cleanup()
307289
rm -f .btf.*
308290
rm -f .tmp_System.map
309291
rm -f .tmp_initcalls.lds
310-
rm -f .tmp_symversions.lds
311292
rm -f .tmp_vmlinux*
312293
rm -f System.map
313294
rm -f vmlinux

0 commit comments

Comments
 (0)