1# SPDX-License-Identifier: GPL-2.0-only 2# 3# Makefile for linux kernel module support 4# 5 6# These are called from save_stack_trace() on slub debug path, 7# and produce insane amounts of uninteresting coverage. 8KCOV_INSTRUMENT_module.o := n 9 10obj-y += main.o strict_rwx.o 11obj-$(CONFIG_MODULE_DECOMPRESS) += decompress.o 12obj-$(CONFIG_MODULE_SIG) += signing.o 13obj-$(CONFIG_MODULE_SIG_PROTECT) += gki_module.o 14obj-$(CONFIG_LIVEPATCH) += livepatch.o 15obj-$(CONFIG_MODULES_TREE_LOOKUP) += tree_lookup.o 16obj-$(CONFIG_DEBUG_KMEMLEAK) += debug_kmemleak.o 17obj-$(CONFIG_KALLSYMS) += kallsyms.o 18obj-$(CONFIG_PROC_FS) += procfs.o 19obj-$(CONFIG_SYSFS) += sysfs.o 20obj-$(CONFIG_KGDB_KDB) += kdb.o 21obj-$(CONFIG_MODVERSIONS) += version.o 22obj-$(CONFIG_MODULE_UNLOAD_TAINT_TRACKING) += tracking.o 23 24# 25# ANDROID: GKI: Generate headerfiles required for gki_module.o 26# 27# Dependencies on generated files need to be listed explicitly 28$(obj)/gki_module.o: include/generated/gki_module_protected_exports.h \ 29 include/generated/gki_module_unprotected.h 30 31ALL_KMI_SYMBOLS := include/config/abi_gki_kmi_symbols 32 33include/generated/gki_module_unprotected.h: $(ALL_KMI_SYMBOLS) \ 34 $(srctree)/scripts/gen_gki_modules_headers.sh 35 $(Q)$(CONFIG_SHELL) $(srctree)/scripts/gen_gki_modules_headers.sh $@ \ 36 "$(srctree)" \ 37 $(ALL_KMI_SYMBOLS) 38 39# Generate symbol list with union of all symbol list for arm64; empty for others 40$(ALL_KMI_SYMBOLS): $(if $(filter arm64,$(ARCH)),$(wildcard $(srctree)/android/abi_gki_aarch64_*),) 41 $(if $(strip $^),cat $^ > $(ALL_KMI_SYMBOLS), echo "" > $(ALL_KMI_SYMBOLS)) 42 43# ABI protected exports list file specific to ARCH if exists else empty 44ABI_PROTECTED_EXPORTS_FILE := 45ifeq ($(ARCH),arm64) 46 ABI_PROTECTED_EXPORTS_FILE := $(wildcard $(srctree)/android/abi_gki_protected_exports_aarch64) 47else 48 ABI_PROTECTED_EXPORTS_FILE := $(wildcard $(srctree)/android/abi_gki_protected_exports_$(ARCH)) 49endif 50 51include/generated/gki_module_protected_exports.h: $(ABI_PROTECTED_EXPORTS_FILE) \ 52 $(srctree)/scripts/gen_gki_modules_headers.sh 53 $(Q)$(CONFIG_SHELL) $(srctree)/scripts/gen_gki_modules_headers.sh $@ \ 54 "$(srctree)" \ 55 $(ABI_PROTECTED_EXPORTS_FILE) 56