[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250919093615.30235-4-yangtiezhu@loongson.cn>
Date: Fri, 19 Sep 2025 17:36:15 +0800
From: Tiezhu Yang <yangtiezhu@...ngson.cn>
To: Josh Poimboeuf <jpoimboe@...nel.org>,
Huacai Chen <chenhuacai@...nel.org>
Cc: loongarch@...ts.linux.dev,
linux-arm-kernel@...ts.infradead.org,
linux-riscv@...ts.infradead.org,
linux-efi@...r.kernel.org,
linux-kbuild@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH v1 3/3] riscv: Only link libstub to final vmlinux
Since the efistub functions are useless for stack unwinder, they can be
ignored by objtool. No need to link libstub to the vmlinux.o, only link
libstub to the final vmlinux. Otherwise, there may be objtool warnings
when riscv supports objtool, this is to make consistent with the other
archs that use libstub.
Link: https://lore.kernel.org/lkml/pq4h7jgndnt6p45lj4kgubxjd5gidfetugcuf5rcxzxxanzetd@6rrlpjnjsmuy/
Suggested-by: Josh Poimboeuf <jpoimboe@...nel.org>
Signed-off-by: Tiezhu Yang <yangtiezhu@...ngson.cn>
---
arch/riscv/Makefile | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile
index df57654a615e..cfd82b2c1bbf 100644
--- a/arch/riscv/Makefile
+++ b/arch/riscv/Makefile
@@ -173,7 +173,10 @@ boot-image-$(CONFIG_XIP_KERNEL) := xipImage
KBUILD_IMAGE := $(boot)/$(boot-image-y)
libs-y += arch/riscv/lib/
-libs-$(CONFIG_EFI_STUB) += $(objtree)/drivers/firmware/efi/libstub/lib.a
+
+ifdef CONFIG_EFI_STUB
+KBUILD_VMLINUX_LIBS_PRELINK += $(objtree)/drivers/firmware/efi/libstub/lib.a
+endif
ifeq ($(KBUILD_EXTMOD),)
ifeq ($(CONFIG_MMU),y)
--
2.42.0
Powered by blists - more mailing lists