ANDROID: kbuild: partially clean up symvers generation for mixed build.
This deletes the vmlinux.symvers generation for GKI, and Module.symvers generation for mixed build. These two are now generated in Kleaf's kernel_build() implementation instead. Bug: 402231876 Change-Id: Icad2c9cab630dd37bd0597b416c28109c090fd0f Signed-off-by: HONG Yifan <elsk@google.com>
This commit is contained in:
1 parent
18f07e20b9
commit
5d68de72ab
2 files changed
+13
-38
No files matched your search
@@ -1988,7 +1988,7 @@ KBUILD_MODULES :=
|
||||
endif # CONFIG_MODULES
|
||||
|
||||
PHONY += modpost
|
||||
modpost: $(if $(single-build),, $(if $(KBUILD_MIXED_TREE),,$(if $(KBUILD_BUILTIN), vmlinux.o))) \
|
||||
modpost: $(if $(single-build),, $(if $(KBUILD_MIXED_TREE), vmlinux.symvers, $(if $(KBUILD_BUILTIN), vmlinux.o))) \
|
||||
$(if $(KBUILD_MODULES), modules_check)
|
||||
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
|
||||
|
||||
|
||||
+12
-37
@@ -101,10 +101,8 @@ ifeq ($(KBUILD_EXTMOD),)
|
||||
|
||||
# This is used to retrieve symbol versions generated by genksyms.
|
||||
ifdef CONFIG_MODVERSIONS
|
||||
ifndef KBUILD_MIXED_TREE
|
||||
vmlinux.symvers Module.symvers: .vmlinux.objs
|
||||
endif
|
||||
endif
|
||||
|
||||
# Ignore libgcc.a
|
||||
# Some architectures do '$(CC) --print-libgcc-file-name' to borrow libgcc.a
|
||||
@@ -119,17 +117,9 @@ quiet_cmd_vmlinux_objs = GEN $@
|
||||
esac \
|
||||
done > $@
|
||||
|
||||
quiet_cmd_vmlinux_symvers = GEN $@
|
||||
cmd_vmlinux_symvers = grep "\<vmlinux\s\+EXPORT" $< > $@
|
||||
|
||||
quiet_cmd_cat_symvers = GEN $@
|
||||
cmd_cat_symvers = cat $(real-prereqs) > $@
|
||||
|
||||
ifndef KBUILD_MIXED_TREE
|
||||
targets += .vmlinux.objs
|
||||
.vmlinux.objs: vmlinux.a $(KBUILD_VMLINUX_LIBS) FORCE
|
||||
$(call if_changed,vmlinux_objs)
|
||||
endif
|
||||
|
||||
ifdef CONFIG_TRIM_UNUSED_KSYMS
|
||||
ksym-wl := $(CONFIG_UNUSED_KSYMS_WHITELIST)
|
||||
@@ -139,41 +129,26 @@ modpost-deps += $(ksym-wl)
|
||||
endif
|
||||
|
||||
ifeq ($(wildcard vmlinux.o),)
|
||||
|
||||
# ANDROID: Use vmlinux.symvers from base build when doing mixed build
|
||||
ifneq ($(wildcard vmlinux.symvers),)
|
||||
modpost-args += -i vmlinux.symvers
|
||||
# Not adding vmlinux.symvers to modpost-deps to avoid dependency on
|
||||
# .vmlinux.objs. Just use the one from base build.
|
||||
# Note: we don't want to include the vmlinux symbols here because we want to be
|
||||
# sure we only use the vmlinux symbols from the GKI kernel.
|
||||
output-symdump := modules-only.symvers
|
||||
else # vmlinux.symvers does not exist
|
||||
missing-input := vmlinux.o
|
||||
output-symdump := modules-only.symvers
|
||||
endif # whether vmlinux.symvers exists
|
||||
|
||||
else
|
||||
modpost-args += vmlinux.o
|
||||
modpost-deps += vmlinux.o
|
||||
output-symdump := $(if $(KBUILD_MODULES), Module.symvers, vmlinux.symvers)
|
||||
endif
|
||||
|
||||
ifdef KBUILD_MODULES
|
||||
targets += vmlinux.symvers
|
||||
vmlinux.symvers: Module.symvers FORCE
|
||||
$(call if_changed,vmlinux_symvers)
|
||||
|
||||
__modpost: $(if $(wildcard vmlinux.o),vmlinux.symvers,)
|
||||
endif
|
||||
|
||||
# Overwrite values for mixed building (overwritting makes merges easier)
|
||||
ifdef KBUILD_MIXED_TREE
|
||||
targets += Module.symvers
|
||||
Module.symvers: $(mixed-build-prefix)vmlinux.symvers modules-only.symvers FORCE
|
||||
$(call if_changed,cat_symvers)
|
||||
|
||||
__modpost: Module.symvers
|
||||
|
||||
ifeq ($(wildcard $(mixed-build-prefix)vmlinux.symvers),)
|
||||
missing-input := $(mixed-build-prefix)vmlinux.symvers
|
||||
else
|
||||
missing-input :=
|
||||
modpost-args += $(addprefix -i ,$(wildcard $(mixed-build-prefix)vmlinux.symvers))
|
||||
endif
|
||||
# Note: we don't want to include the vmlinux symbols here because we want to be
|
||||
# sure we only use the vmlinux symbols from the GKI kernel.
|
||||
output-symdump := modules-only.symvers
|
||||
endif
|
||||
|
||||
else
|
||||
|
||||
# set src + obj - they may be used in the modules's Makefile
|
||||
|
||||
Reference in new issue
Block a user