History

kbuild: refactor cmd_modversions_S

Split the code into two macros, cmd_gen_symversions_S for running genksyms, and cmd_modversions for running $(LD) to update the object with CRCs.

Masahiro Yamada committed 4 years ago

Commit 7cfa2fc1 parent 8017ce51 file · +4 −11Browse files

Unified · Split

scripts/Makefile.build+4−11
@@ -276,7 +276,8 @@ define rule_as_o_S · 275 unmodified lines
276276 $(call cmd_and_fixdep,as_o_S)
277277 $(call cmd,gen_ksymdeps)
278278 $(call cmd,gen_objtooldep)
279− $(call cmd,modversions_S)
279+ $(call cmd,gen_symversions_S)
280+ $(call cmd,modversions)
280281 endef
281282
282283 # Built-in and composite module parts
@@ -363,16 +364,8 @@ ifdef CONFIG_ASM_MODVERSIONS · 80 unmodified lines
363364 # versioning matches the C process described above, with difference that
364365 # we parse asm-prototypes.h C header to get function definitions.
365366
366−cmd_modversions_S = \
367− if $(OBJDUMP) -h $@ | grep -q __ksymtab; then \
368− $(call cmd_gensymtypes_S,$(KBUILD_SYMTYPES),$(@:.o=.symtypes)) \
369− > $(@D)/.tmp_$(@F:.o=.ver); \
370− \
371− $(LD) $(KBUILD_LDFLAGS) -r -o $(@D)/.tmp_$(@F) $@ \
372− -T $(@D)/.tmp_$(@F:.o=.ver); \
373− mv -f $(@D)/.tmp_$(@F) $@; \
374− rm -f $(@D)/.tmp_$(@F:.o=.ver); \
375− fi
367+cmd_gen_symversions_S = $(call gen_symversions,S)
368+
376369 endif
377370
378371 $(obj)/%.o: $(src)/%.S FORCE