From 71bffcc5ebd16b1a45d5873db225e005aaddebcc Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Thu, 22 Jan 2026 17:17:57 -0600 Subject: [PATCH] linuxkm/Kbuild: move FORCE_GLOBAL_OBJTOOL_OFF setup outside ENABLED_LINUXKM_PIE setup, i.e. always usable. --- linuxkm/Kbuild | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/linuxkm/Kbuild b/linuxkm/Kbuild index 6f1a2f320..1cafd1152 100644 --- a/linuxkm/Kbuild +++ b/linuxkm/Kbuild @@ -147,9 +147,15 @@ ifeq "$(ENABLED_LINUXKM_PIE)" "yes" $(WOLFCRYPT_PIE_FILES): ccflags-y += $(PIE_FLAGS) $(WOLFCRYPT_PIE_FILES): ccflags-remove-y += -pg \ $(call cc-option,-ftrivial-auto-var-init=zero) - ifdef FORCE_GLOBAL_OBJTOOL_OFF - undefine CONFIG_OBJTOOL - endif +endif + +# On some kernels/configs, objtool runs and warns on the linked libwolfssl.o, +# ignoring the below "OBJECT_FILES_NON_STANDARD := y" annotations. This +# mechanism, activated with "make KBUILD_EXTRA_FLAGS=FORCE_GLOBAL_OBJTOOL_OFF=1", +# inhibits objtool completely. This may be necessary on modules compiled with +# assembly accelerations and/or ENABLED_LINUXKM_PIE. +ifdef FORCE_GLOBAL_OBJTOOL_OFF + undefine CONFIG_OBJTOOL endif ifdef KERNEL_EXTRA_CFLAGS_REMOVE