Skip to content

Commit 91ca8be

Browse files
committed
kbuild: remove support for single %.symtypes build rule
This rule is unnecessary because you can generate foo/bar.symtypes as a side effect using: $ make KBUILD_SYMTYPES=1 foo/bar.o While compiling *.o is slower than preprocessing, the impact is negligible. I prioritize keeping the code simpler. Signed-off-by: Masahiro Yamada <[email protected]> Reviewed-by: Nicolas Schier <[email protected]>
1 parent c2386ab commit 91ca8be

File tree

2 files changed

+5
-19
lines changed

2 files changed

+5
-19
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ no-dot-config-targets := $(clean-targets) \
301301
outputmakefile rustavailable rustfmt rustfmtcheck
302302
no-sync-config-targets := $(no-dot-config-targets) %install modules_sign kernelrelease \
303303
image_name
304-
single-targets := %.a %.i %.ko %.lds %.ll %.lst %.mod %.o %.rsi %.s %.symtypes %/
304+
single-targets := %.a %.i %.ko %.lds %.ll %.lst %.mod %.o %.rsi %.s %/
305305

306306
config-build :=
307307
mixed-build :=

scripts/Makefile.build

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -108,19 +108,13 @@ $(obj)/%.i: $(obj)/%.c FORCE
108108
$(call if_changed_dep,cpp_i_c)
109109

110110
genksyms = $(objtree)/scripts/genksyms/genksyms \
111-
$(if $(1), -T $(2)) \
112-
$(if $(KBUILD_PRESERVE), -p) \
113-
$(addprefix -r , $(wildcard $(2:.symtypes=.symref)))
111+
$(if $(KBUILD_SYMTYPES), -T $(@:.o=.symtypes)) \
112+
$(if $(KBUILD_PRESERVE), -p) \
113+
$(addprefix -r , $(wildcard $(@:.o=.symref)))
114114

115115
# These mirror gensymtypes_S and co below, keep them in synch.
116116
cmd_gensymtypes_c = $(CPP) -D__GENKSYMS__ $(c_flags) $< | $(genksyms)
117117

118-
quiet_cmd_cc_symtypes_c = SYM $(quiet_modtag) $@
119-
cmd_cc_symtypes_c = $(call cmd_gensymtypes_c,true,$@) >/dev/null
120-
121-
$(obj)/%.symtypes : $(obj)/%.c FORCE
122-
$(call cmd,cc_symtypes_c)
123-
124118
# LLVM assembly
125119
# Generate .ll files from .c
126120
quiet_cmd_cc_ll_c = CC $(quiet_modtag) $@
@@ -158,8 +152,7 @@ ifdef CONFIG_MODVERSIONS
158152

159153
gen_symversions = \
160154
if $(NM) $@ 2>/dev/null | grep -q ' __export_symbol_'; then \
161-
$(call cmd_gensymtypes_$(1),$(KBUILD_SYMTYPES),$(@:.o=.symtypes)) \
162-
>> $(dot-target).cmd; \
155+
$(cmd_gensymtypes_$1) >> $(dot-target).cmd; \
163156
fi
164157

165158
cmd_gen_symversions_c = $(call gen_symversions,c)
@@ -323,13 +316,6 @@ cmd_gensymtypes_S = \
323316
$(NM) $@ | sed -n 's/.* __export_symbol_\(.*\)/EXPORT_SYMBOL(\1);/p' ; } | \
324317
$(CPP) -D__GENKSYMS__ $(c_flags) -xc - | $(genksyms)
325318

326-
quiet_cmd_cc_symtypes_S = SYM $(quiet_modtag) $@
327-
cmd_cc_symtypes_S = $(call cmd_gensymtypes_S,true,$@) >/dev/null
328-
329-
$(obj)/%.symtypes : $(obj)/%.S FORCE
330-
$(call cmd,cc_symtypes_S)
331-
332-
333319
quiet_cmd_cpp_s_S = CPP $(quiet_modtag) $@
334320
cmd_cpp_s_S = $(CPP) $(a_flags) -o $@ $<
335321

0 commit comments

Comments
 (0)