ANDROID: compile / link / clean permitted-imports.o

This commit adds the generation of permitted imports to Kbuild.

Bug: 393366754
Change-Id: I522ec4a92c5c791fb1c2931a1e05251c3f7d530c
Signed-off-by: Sid Nayyar <sidnayyar@google.com>
This commit is contained in:
Sid Nayyar
2025-04-30 13:06:56 +00:00
parent 19ee9bccea
commit 9593e47f47
3 changed files with 9 additions and 1 deletions

View File

@@ -1549,7 +1549,7 @@ CLEAN_FILES += vmlinux.symvers modules-only.symvers \
modules.builtin.ranges vmlinux.o.map \
compile_commands.json rust/test \
rust-project.json .vmlinux.objs .vmlinux.export.c \
.vmlinux.protected-exports.c
.vmlinux.protected-exports.c .vmlinux.permitted-imports.c
# Directories & files removed with 'make mrproper'
MRPROPER_FILES += include/config include/generated \

View File

@@ -26,6 +26,11 @@ targets += .vmlinux.protected-exports.o
vmlinux: .vmlinux.protected-exports.o
endif
ifdef CONFIG_TRIM_UNUSED_KSYMS
targets += .vmlinux.permitted-imports.o
vmlinux: .vmlinux.permitted-imports.o
endif
endif
ARCH_POSTLINK := $(wildcard $(srctree)/arch/$(SRCARCH)/Makefile.postlink)

View File

@@ -73,6 +73,9 @@ vmlinux_link()
if is_enabled CONFIG_MODULE_SIG_PROTECT; then
objs="${objs} .vmlinux.protected-exports.o"
fi
if is_enabled CONFIG_TRIM_UNUSED_KSYMS; then
objs="${objs} .vmlinux.permitted-imports.o"
fi
fi
objs="${objs} init/version-timestamp.o"