From 890413e80faa2d4a87bf7eed0b68db93ecec8a91 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Fri, 22 Nov 2024 21:48:07 +0000 Subject: [PATCH] ANDROID: Makefile.modfinal: restore postlink support for fips140.ko Support for postlink commands was removed from scripts/Makefile.modfinal in v6.7 due to it being unused upstream. It is needed for fips140.ko, so bring it back in the case where fips140.ko is enabled. Bug: 188620248 Change-Id: Ia45d2a2e4f7bbcbdb4ddf834e41ed4bbaddde60c Signed-off-by: Eric Biggers --- scripts/Makefile.modfinal | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/Makefile.modfinal b/scripts/Makefile.modfinal index 8a1570be781f..147c4fecb02c 100644 --- a/scripts/Makefile.modfinal +++ b/scripts/Makefile.modfinal @@ -35,11 +35,16 @@ quiet_cmd_cc_o_c = CC [M] $@ $(extmod_prefix).module-common.o: $(srctree)/scripts/module-common.c FORCE $(call if_changed_dep,cc_o_c) +ifdef CONFIG_CRYPTO_FIPS140_MOD +ARCH_POSTLINK := $(srctree)/arch/$(SRCARCH)/Makefile.postlink +endif + quiet_cmd_ld_ko_o = LD [M] $@ cmd_ld_ko_o = \ $(LD) -r $(KBUILD_LDFLAGS) \ $(KBUILD_LDFLAGS_MODULE) $(LDFLAGS_MODULE) \ - -T scripts/module.lds -o $@ $(filter %.o, $^) + -T scripts/module.lds -o $@ $(filter %.o, $^); \ + $(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) $@, true) quiet_cmd_btf_ko = BTF [M] $@ cmd_btf_ko = \