ANDROID: Set ALL_KMI_SYMBOLS to CONFIG_UNUSED_KSYMS_WHITELIST.

Kleaf already generates CONFIG_UNUSED_KSYMS_WHITELIST according to
the list of provided KMI symbol lists (kernel_build.kmi_symbol_list
plus kernel_build.additional_kmi_symbol_lists).
CONFIG_UNUSED_KSYMS_WHITELIST is the source of truth, not the wildcard
here, especially if --user_kmi_symbol_list is set, or
kernel_build.kmi_symbol_list or additional_kmi_symbol_lists contains
files in different directories. Use CONFIG_UNUSED_KSYMS_WHITELIST
directly.

For mainline, CONFIG_UNUSED_KSYMS_WHITELIST is not set, so use
an empty file as a placeholder.

Bug: 406094444
Change-Id: Ia62c7a2e40ca607ac6f0d7e91c732044ec559282
Signed-off-by: HONG Yifan <elsk@google.com>
(cherry picked from commit b100dc1133ad4fbb9fd14c1dd91c00363cab44ec)
This commit is contained in:
HONG Yifan
2025-04-01 12:02:16 -07:00
committed by Treehugger Robot
parent ede56033b2
commit ddb277b9c7
+6 -7
View File
@@ -32,7 +32,13 @@ obj-$(CONFIG_MODULE_STATS) += stats.o
$(obj)/gki_module.o: include/generated/gki_module_protected_exports.h \
include/generated/gki_module_unprotected.h
ifneq ($(CONFIG_UNUSED_KSYMS_WHITELIST),)
ALL_KMI_SYMBOLS := $(CONFIG_UNUSED_KSYMS_WHITELIST)
else
ALL_KMI_SYMBOLS := include/config/abi_gki_kmi_symbols
$(ALL_KMI_SYMBOLS):
: > $@
endif
include/generated/gki_module_unprotected.h: $(ALL_KMI_SYMBOLS) \
$(srctree)/scripts/gen_gki_modules_headers.sh
@@ -40,13 +46,6 @@ include/generated/gki_module_unprotected.h: $(ALL_KMI_SYMBOLS) \
"$(srctree)" \
$(ALL_KMI_SYMBOLS)
# AARCH is the same as ARCH, except that arm64 becomes aarch64
AARCH := $(if $(filter arm64,$(ARCH)),aarch64,$(ARCH))
# Generate symbol list with union of all symbol list for ARCH
$(ALL_KMI_SYMBOLS): $(wildcard $(srctree)/gki/$(AARCH)/symbols/*)
$(if $(strip $^),cat $^ > $(ALL_KMI_SYMBOLS), echo "" > $(ALL_KMI_SYMBOLS))
# ABI protected exports list file specific to ARCH if exists else empty
ABI_PROTECTED_EXPORTS_FILE := $(wildcard $(srctree)/gki/$(AARCH)/protected_exports)