public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Laight <david.laight.linux@gmail.com>
To: Dmitry Antipov <dmantipov@yandex.ru>
Cc: Paul Walmsley <pjw@kernel.org>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	Andrew Morton <akpm@linux-foundation.org>,
	Andy Shevchenko <andriy.shevchenko@intel.com>,
	Charlie Jenkins <thecharlesjenkins@gmail.com>,
	Alexandre Ghiti <alex@ghiti.fr>, Ard Biesheuvel <ardb@kernel.org>,
	linux-riscv@lists.infradead.org, linux-efi@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v6 3/3] riscv: fix building compressed EFI image
Date: Mon, 27 Apr 2026 10:29:22 +0100	[thread overview]
Message-ID: <20260427102922.08d0bcda@pumpkin> (raw)
In-Reply-To: <20260425185151.477442-4-dmantipov@yandex.ru>

On Sat, 25 Apr 2026 21:51:50 +0300
Dmitry Antipov <dmantipov@yandex.ru> 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, rely on CONFIG_32BIT to manage linking
> of lib-ashldi3.o and lib-lshrdi3.o on riscv32 only.
> 
> Reported-by: Charlie Jenkins <thecharlesjenkins@gmail.com>
> Closes: https://lore.kernel.org/linux-riscv/20260409050018.GA371560@inky.localdomain
> Tested-by: Charlie Jenkins <thecharlesjenkins@gmail.com>
> Suggested-by: Ard Biesheuvel <ardb@kernel.org>
> Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
> ---
> v6: adjust to match recent upstream changes
> v5: rely on CONFIG_32BIT rather than dedicated Kconfig symbol (Ard)
> v4: use more meaningful CONFIG_EFI_ZBOOT_USE_LIBGCC and adjust tags (Andy)
> v3: initial version to join the series
> ---
>  drivers/firmware/efi/libstub/Makefile | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/firmware/efi/libstub/Makefile b/drivers/firmware/efi/libstub/Makefile
> index 983a438e35f3..e1c11d02a5cb 100644
> --- a/drivers/firmware/efi/libstub/Makefile
> +++ b/drivers/firmware/efi/libstub/Makefile
> @@ -95,7 +95,9 @@ 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-obj-$(CONFIG_RISCV)	+= lib-clz_ctz.o lib-ashldi3.o
> +zboot-obj-$(CONFIG_RISCV)	+= lib-clz_ctz.o
> +zboot-riscv-obj-$(CONFIG_32BIT)	+= lib-ashldi3.o lib-lshrdi3.o
> +zboot-obj-$(CONFIG_RISCV)	+= lib-clz_ctz.o $(zboot-riscv-obj-y)

Doesn't that specify lib-clz_ctz.o twice ?
I think you could also use:
zboot-obj-$(CONFIG_RISCV)	+= lib-clz_ctz.o $(if $(CONFIG_32BIT),lib-ashldi3.o lib-lshrdi3.o)

	David

>  zboot-obj-$(CONFIG_LOONGARCH)	+= lib-clz_ctz.o lib-ashldi3.o
>  lib-$(CONFIG_EFI_ZBOOT)		+= zboot.o $(zboot-obj-y)
>  


  reply	other threads:[~2026-04-27  9:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-25 18:51 [PATCH v6 0/3] riscv32 library enhancements and build fixes Dmitry Antipov
2026-04-25 18:51 ` [PATCH v6 1/3] riscv: add platform-specific double word shifts for riscv32 Dmitry Antipov
2026-04-25 18:51 ` [PATCH v6 2/3] lib: kunit: add tests for __ashldi3(), __ashrdi3(), and __lshrdi3() Dmitry Antipov
2026-04-25 18:51 ` [PATCH v6 3/3] riscv: fix building compressed EFI image Dmitry Antipov
2026-04-27  9:29   ` David Laight [this message]
2026-04-25 21:36 ` [PATCH v6 0/3] riscv32 library enhancements and build fixes Andrew Morton
2026-04-27  8:13   ` Dmitry Antipov
2026-04-27  8:23     ` Andy Shevchenko
2026-04-27  8:25       ` Andy Shevchenko
2026-04-27 10:30       ` Andrew Morton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260427102922.08d0bcda@pumpkin \
    --to=david.laight.linux@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=alex@ghiti.fr \
    --cc=andriy.shevchenko@intel.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=ardb@kernel.org \
    --cc=dmantipov@yandex.ru \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.com \
    --cc=pjw@kernel.org \
    --cc=thecharlesjenkins@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox