Makefile 2.1 KB

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