Linux EFI development
 help / color / mirror / Atom feed
* [PATCH v2] efi/libstub: fix building loongarch32 without zboot enabled
@ 2026-11-26 12:41 Dmitry Antipov
  2026-11-26 12:53 ` Ard Biesheuvel
  2026-11-26 12:59 ` sashiko-bot
  0 siblings, 2 replies; 6+ messages in thread
From: Dmitry Antipov @ 2026-11-26 12:41 UTC (permalink / raw)
  To: Ard Biesheuvel
  Cc: Paul Walmsley, Palmer Dabbelt, Albert Ou, Huacai Chen,
	WANG Xuerui, linux-efi, linux-riscv, loongarch, Dmitry Antipov,
	kernel test robot

Kernel test robot has reported the following error observed on loongarch:

loongarch64-linux-ld: ./drivers/firmware/efi/libstub/lib-cmdline.stub.o: in function `__efistub_.L47':
__efistub_cmdline.c:(.init.text+0x258): undefined reference to `__efistub___ashldi3'
loongarch64-linux-ld: __efistub_cmdline.c:(.init.text+0x268): undefined reference to `__efistub___lshrdi3'

Following the approach introduced in commit a354b8de9ad6
("riscv: add platform-specific double word shifts for riscv32"),
define EFI stub aliases for __ashldi3() and __lshrdi3() for
loongarch32 as well, thus making the related EFI stub's Makefile
quirks redundant.

Suggested-by: Ard Biesheuvel <ardb@kernel.org>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/20261122125352.gAcg5yLx-lkp@intel.com/
Fixes: 442082297e3d ("riscv: fix building compressed EFI image")
Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
---
v2: define relevant EFI stubs in image-vars.h (Ard) 
---
 arch/loongarch/kernel/image-vars.h    | 2 ++
 drivers/firmware/efi/libstub/Makefile | 7 +------
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/arch/loongarch/kernel/image-vars.h b/arch/loongarch/kernel/image-vars.h
index e557ebd46c2b..19202f4f84c2 100644
--- a/arch/loongarch/kernel/image-vars.h
+++ b/arch/loongarch/kernel/image-vars.h
@@ -8,6 +8,8 @@
 #ifdef CONFIG_EFI_STUB
 
 __efistub_strcmp		= strcmp;
+__efistub___lshrdi3		= __lshrdi3;
+__efistub___ashldi3		= __ashldi3;
 __efistub_kernel_entry		= kernel_entry;
 __efistub_kernel_asize		= kernel_asize;
 __efistub_kernel_fsize		= kernel_fsize;
diff --git a/drivers/firmware/efi/libstub/Makefile b/drivers/firmware/efi/libstub/Makefile
index bbab12b8eb4b..bcf2a5981678 100644
--- a/drivers/firmware/efi/libstub/Makefile
+++ b/drivers/firmware/efi/libstub/Makefile
@@ -96,12 +96,7 @@ zboot-obj-y			:= zboot-decompress-gzip.o
 CFLAGS_zboot-decompress-gzip.o	+= -I$(srctree)/lib/zlib_inflate
 zboot-obj-$(CONFIG_KERNEL_ZSTD)	:= zboot-decompress-zstd.o lib-xxhash.o
 CFLAGS_zboot-decompress-zstd.o	+= -I$(srctree)/lib/zstd
-
-zboot-riscv-obj-$(CONFIG_32BIT)	:= lib-ashldi3.o lib-lshrdi3.o
-zboot-obj-$(CONFIG_RISCV)	+= lib-clz_ctz.o $(zboot-riscv-obj-y)
-zboot-loongarch-obj-$(CONFIG_32BIT) := lib-ashldi3.o lib-lshrdi3.o
-zboot-obj-$(CONFIG_LOONGARCH)	+= lib-clz_ctz.o $(zboot-loongarch-obj-y)
-lib-$(CONFIG_EFI_ZBOOT)		+= zboot.o $(zboot-obj-y)
+lib-$(CONFIG_EFI_ZBOOT)		+= zboot.o
 
 lib-$(CONFIG_UNACCEPTED_MEMORY) += unaccepted_memory.o bitmap.o find.o
 
-- 
2.56.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-11-26 14:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-26 12:41 [PATCH v2] efi/libstub: fix building loongarch32 without zboot enabled Dmitry Antipov
2026-11-26 12:53 ` Ard Biesheuvel
2026-11-26 13:11   ` Ard Biesheuvel
2026-11-26 13:16   ` Dmitry Antipov
2026-11-26 14:44     ` Ard Biesheuvel
2026-11-26 12:59 ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox