[PATCH v9 6/6] riscv: export symbols needed for riscv32 EFI stub
Andy Shevchenko
andriy.shevchenko at intel.com
Thu Apr 9 01:51:25 PDT 2026
On Wed, Apr 08, 2026 at 10:00:18PM -0700, Charlie Jenkins wrote:
> On Fri, Apr 03, 2026 at 01:33:38PM +0300, Dmitry Antipov wrote:
> > Fix the following link error observed when building EFI-enabled
> > kernel with CONFIG_EFI_STUB=y and CONFIG_EFI_GENERIC_STUB=y:
> >
> > riscv32-linux-gnu-ld: ./drivers/firmware/efi/libstub/lib-cmdline.stub.o: in function `__efistub_.L49':
> > __efistub_cmdline.c:(.init.text+0x1f2): undefined reference to `__efistub___ashldi3'
> > riscv32-linux-gnu-ld: __efistub_cmdline.c:(.init.text+0x202): undefined reference to `__efistub___lshrdi3'
> >
> > Note: compile (gcc 15.2.1 and clang 21.1.8) tested only.
>
> I attempted to boot this on riscv32 in qemu with u-boot. I used
> CONFIG_EFI_ZBOOT to generate vmlinux.efi. With this option enabled,
> there is the same undefined reference errors with this patch applied.
> I have not found a good way to resolve this issue, so I resorted to
> copying the __lshrdi3() implementation over into
> drivers/firmware/efi/libstub/riscv.c and that successfully booted with
> EFI.
Thank you for trying and testing this.
Can you instead this patch take the mini-series from 20260409033824.465455-1-dmantipov at yandex.ru?
> > Closes: https://lore.kernel.org/oe-kbuild-all/202603041925.KLKqpK6N-lkp@intel.com
--
With Best Regards,
Andy Shevchenko
More information about the linux-riscv
mailing list