Files
ack-tegra/kernel/module/Makefile
T
HONG Yifan b100dc1133 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>
2025-04-02 11:38:45 -07:00

62 lines
2.1 KiB
Makefile

# SPDX-License-Identifier: GPL-2.0-only
#
# Makefile for linux kernel module support
#
# These are called from save_stack_trace() on slub debug path,
# and produce insane amounts of uninteresting coverage.
KCOV_INSTRUMENT_main.o := n
obj-y += main.o
obj-y += strict_rwx.o
obj-y += kmod.o
obj-$(CONFIG_MODULE_DEBUG_AUTOLOAD_DUPS) += dups.o
obj-$(CONFIG_MODULE_DECOMPRESS) += decompress.o
obj-$(CONFIG_MODULE_SIG) += signing.o
obj-$(CONFIG_MODULE_SIG_PROTECT) += gki_module.o
obj-$(CONFIG_LIVEPATCH) += livepatch.o
obj-$(CONFIG_MODULES_TREE_LOOKUP) += tree_lookup.o
obj-$(CONFIG_DEBUG_KMEMLEAK) += debug_kmemleak.o
obj-$(CONFIG_KALLSYMS) += kallsyms.o
obj-$(CONFIG_PROC_FS) += procfs.o
obj-$(CONFIG_SYSFS) += sysfs.o
obj-$(CONFIG_KGDB_KDB) += kdb.o
obj-$(CONFIG_MODVERSIONS) += version.o
obj-$(CONFIG_MODULE_UNLOAD_TAINT_TRACKING) += tracking.o
obj-$(CONFIG_MODULE_STATS) += stats.o
#
# ANDROID: GKI: Generate headerfiles required for gki_module.o
#
# Dependencies on generated files need to be listed explicitly
$(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
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/gen_gki_modules_headers.sh $@ \
"$(srctree)" \
$(ALL_KMI_SYMBOLS)
# ABI protected exports list file specific to ARCH if exists else empty
ABI_PROTECTED_EXPORTS_FILE :=
ifeq ($(ARCH),arm64)
ABI_PROTECTED_EXPORTS_FILE := $(wildcard $(srctree)/android/abi_gki_protected_exports_aarch64)
else
ABI_PROTECTED_EXPORTS_FILE := $(wildcard $(srctree)/android/abi_gki_protected_exports_$(ARCH))
endif
include/generated/gki_module_protected_exports.h: $(ABI_PROTECTED_EXPORTS_FILE) \
$(srctree)/scripts/gen_gki_modules_headers.sh
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/gen_gki_modules_headers.sh $@ \
"$(srctree)" \
$(ABI_PROTECTED_EXPORTS_FILE)