[PATCH v4 3/3] riscv: fix building compressed EFI image

Ard Biesheuvel ardb at kernel.org
Wed Apr 15 02:56:59 PDT 2026


On Wed, 15 Apr 2026, at 11:52, Andy Shevchenko wrote:
> On Tue, Apr 14, 2026 at 01:26:08PM +0300, Dmitry Antipov wrote:
>> When building vmlinuz.efi with CONFIG_EFI_ZBOOT enabled,
>> '__lshrdi3()' is also needed to fix yet another link error:
>> 
>> riscv32-linux-gnu-ld: drivers/firmware/efi/libstub/lib-cmdline.stub.o: in function `__efistub_.L49':
>> __efistub_cmdline.c:(.init.text+0x202): undefined reference to `__efistub___lshrdi3'
>> 
>> And since riscv64 can have CONFIG_EFI_ZBOOT but doesn't need these
>> library routines, introduce CONFIG_EFI_ZBOOT_USE_LIBGCC to manage
>> linking of lib-ashldi3.o and lib-lshrdi3.o on riscv32 only.
>
> Acked-by: Andy Shevchenko <andriy.shevchenko at intel.com>
>
> I think you need a tag from Ard on this.
>

I don't think we need a new Kconfig symbol for this.

Better do something like

zboot-riscv-obj-$(CONFIG_32BIT) += lib-ashldi3.o lib-lshrdi3.o
zboot-obj-$(CONFIG_RISCV)	+= lib-clz_ctz.o $(zboot-riscv-obj-y)





More information about the linux-riscv mailing list