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 11obj-y += strict_rwx.o 12obj-y += kmod.o 13obj-$(CONFIG_MODULE_DEBUG_AUTOLOAD_DUPS) += dups.o 14obj-$(CONFIG_MODULE_DECOMPRESS) += decompress.o 15obj-$(CONFIG_MODULE_SIG) += signing.o 16obj-$(CONFIG_MODULE_SIG_PROTECT) += gki_module.o 17obj-$(CONFIG_LIVEPATCH) += livepatch.o 18obj-$(CONFIG_MODULES_TREE_LOOKUP) += tree_lookup.o 19obj-$(CONFIG_DEBUG_KMEMLEAK) += debug_kmemleak.o 20obj-$(CONFIG_KALLSYMS) += kallsyms.o 21obj-$(CONFIG_PROC_FS) += procfs.o 22obj-$(CONFIG_SYSFS) += sysfs.o 23obj-$(CONFIG_KGDB_KDB) += kdb.o 24obj-$(CONFIG_MODVERSIONS) += version.o 25obj-$(CONFIG_MODULE_UNLOAD_TAINT_TRACKING) += tracking.o 26obj-$(CONFIG_MODULE_STATS) += stats.o 27 28# 29# ANDROID: GKI: Generate headerfiles required for gki_module.o 30# 31# Dependencies on generated files need to be listed explicitly 32$(obj)/gki_module.o: include/generated/gki_module_protected_exports.h \ 33 include/generated/gki_module_unprotected.h 34 35ALL_KMI_SYMBOLS := include/config/abi_gki_kmi_symbols 36 37include/generated/gki_module_unprotected.h: $(ALL_KMI_SYMBOLS) \ 38 $(srctree)/scripts/gen_gki_modules_headers.sh 39 $(Q)$(CONFIG_SHELL) $(srctree)/scripts/gen_gki_modules_headers.sh $@ \ 40 "$(srctree)" \ 41 $(ALL_KMI_SYMBOLS) 42 43# Generate symbol list with union of all symbol list for arm64; empty for others 44$(ALL_KMI_SYMBOLS): $(if $(filter arm64,$(ARCH)),$(wildcard $(srctree)/android/abi_gki_aarch64_*),) 45 $(if $(strip $^),cat $^ > $(ALL_KMI_SYMBOLS), echo "" > $(ALL_KMI_SYMBOLS)) 46 47# ABI protected exports list file specific to ARCH if exists else empty 48ABI_PROTECTED_EXPORTS_FILE := 49ifeq ($(ARCH),arm64) 50 ABI_PROTECTED_EXPORTS_FILE := $(wildcard $(srctree)/android/abi_gki_protected_exports_aarch64) 51else 52 ABI_PROTECTED_EXPORTS_FILE := $(wildcard $(srctree)/android/abi_gki_protected_exports_$(ARCH)) 53endif 54 55include/generated/gki_module_protected_exports.h: $(ABI_PROTECTED_EXPORTS_FILE) \ 56 $(srctree)/scripts/gen_gki_modules_headers.sh 57 $(Q)$(CONFIG_SHELL) $(srctree)/scripts/gen_gki_modules_headers.sh $@ \ 58 "$(srctree)" \ 59 $(ABI_PROTECTED_EXPORTS_FILE) 60