All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mikko Rapeli <mikko.rapeli@linaro.org>
To: u-boot@lists.denx.de, Tom Rini <trini@konsulko.com>
Cc: Adriano Cordova <adrianox@gmail.com>,
	Fabio Estevam <festevam@gmail.com>,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>
Subject: Re: [PATCH] scripts/Makefile.lib: fix *_efi.so dependency to PLATFORM_LIBGCC
Date: Thu, 10 Jul 2025 18:08:14 +0300	[thread overview]
Message-ID: <aG_XXm3Cvm6DJPQy@nuoska> (raw)
In-Reply-To: <20250710145903.GB6424@bill-the-cat> <20250710144445.335480-1-mikko.rapeli@linaro.org>

Hi, moving patch review from oe-core list to u-boot:

On Thu, Jul 10, 2025 at 08:59:03AM -0600, Tom Rini wrote:
<snip>
> I cleared you patch (and moderation flag) but I don't think the above
> works in all cases since PLATFORM_LIBGCC can have a number of values
> only one of which is that file.

Right. Should I make the dependency conditional to
CONFIG_USE_PRIVATE_LIBGCC like it's set in Makefile?

I don't see another variable for lib.a to use in
scripts/Makefile.lib

Cheers,

-Mikko

On Thu, Jul 10, 2025 at 05:44:45PM +0300, Mikko Rapeli wrote:
> When PLATFORM_LIBGCC was added to linker command it was not
> added to the dependency of the .so rule. Thus a build can try
> to link *_efi.so files before PLATFORM_LIBGCC lib.a is available.
> This was seen in yocto autobuilder builds with u-boot 2025.07
> update, see https://lists.openembedded.org/g/openembedded-core/message/220004
> 
> https://autobuilder.yoctoproject.org/valkyrie/api/v2/logs/2914600/raw_inline
> 
> |    rm -f lib/efi_loader/built-in.o; arm-poky-linux-gnueabi-ar cDPrsT lib/efi_loader/built-in.o lib/efi_loader/efi_bootmgr.o lib/efi_loader/efi_bootbin.o lib/efi_loader/efi_boottime.o lib/efi_loader/efi_helper.o lib/efi_loader/efi_console.o lib/efi_loader/efi_device_path.o lib/efi_loader/efi_device_path_to_text.o lib/efi_loader/efi_device_path_utilities.o lib/efi_loader/efi_dt_fixup.o lib/efi_loader/efi_fdt.o lib/efi_loader/efi_file.o lib/efi_loader/efi_hii.o lib/efi_loader/efi_hii_config.o lib/efi_loader/efi_image_loader.o lib/efi_loader/efi_load_options.o lib/efi_loader/efi_memory.o lib/efi_loader/efi_root_node.o lib/efi_loader/efi_runtime.o lib/efi_loader/efi_setup.o lib/efi_loader/efi_string.o lib/efi_loader/efi_unicode_collation.o lib/efi_loader/efi_var_common.o lib/efi_loader/efi_var_mem.o lib/efi_loader/efi_variable.o lib/efi_loader/efi_var_file.o lib/efi_loader/efi_watchdog.o lib/efi_loader/efi_disk.o lib/efi_loader/efi_net.o lib/efi_loader/efi_smbios.o lib/efi_loader/efi_load_initrd.o lib/efi_loader/efi_conformance.o
> |   arm-poky-linux-gnueabi-ld.bfd -nostdlib -zexecstack -znocombreloc -znorelro --no-warn-rwx-segments -L /srv/pokybuild/yocto-worker/oe-selftest-armhost/build/build-st-3119200/tmp/work/beaglebone_yocto-poky-linux-gnueabi/u-boot/2025.07/sources/u-boot-2025.07 -T arch/arm/lib/elf_arm_efi.lds -shared -Bsymbolic -s lib/efi_loader/helloworld.o lib/efi_loader/efi_crt0.o lib/efi_loader/efi_reloc.o lib/efi_loader/efi_freestanding.o arch/arm/lib/lib.a -o lib/efi_loader/helloworld_efi.so
> | arm-poky-linux-gnueabi-ld.bfd: cannot find arch/arm/lib/lib.a: No such file or directory
> | make[3]: *** [scripts/Makefile.lib:512: lib/efi_loader/helloworld_efi.so] Error 1
> 
> The issue is hard to reproduce but this change can artificially trigger it:
> 
>   --- a/scripts/Makefile.build
>   +++ b/scripts/Makefile.build
> @@ -353,7 +353,7 @@ $(modorder-target): $(subdir-ym) FORCE
>  #
>  ifdef lib-target
>  quiet_cmd_link_l_target = AR      $@
> -cmd_link_l_target = rm -f $@; $(AR) cDPrsT$(KBUILD_ARFLAGS) $@ $(lib-y)
> +cmd_link_l_target = rm -f $@ && echo "HACK, delaying build!" && sleep 60 && $(AR) cDPrsT$(KBUILD_ARFLAGS) $@ $(lib-y)
> 
>  $(lib-target): $(lib-y) FORCE
>         $(call if_changed,link_l_target)
> 
> Then run a rebuild with:
> 
> $  rm -f $( find build/ -name lib.a -or -name helloworld_efi.so ) && \
>    make
> ...
>   arm-poky-linux-gnueabi-ld.bfd -nostdlib -zexecstack -znocombreloc -znorelro --no-warn-rwx-segments -L /home/mcfrisk/src/base/repo/poky/build_bea
> glebone/tmp/work/beaglebone_yocto-poky-linux-gnueabi/u-boot/2025.07/sources/u-boot-2025.07 -T arch/arm/lib/elf_arm_efi.lds -shared -Bsymbolic -s lib/efi_loader/helloworld.o lib/efi_loader/efi_crt0.o lib/efi_loader/efi_reloc.o lib/efi_loader/efi_freestanding.o arch/arm/lib/lib.a -o lib/efi_loader/helloworld_efi.so
> arm-poky-linux-gnueabi-ld.bfd: cannot find arch/arm/lib/lib.a: No such file or directory
> make[3]: *** [scripts/Makefile.lib:512: lib/efi_loader/helloworld_efi.so] Error 1
> 
> Fixes: 43d43241d1c9 ("scripts/Makefile.lib: add PLATFORM_LIBGCC to efi linking")
> 
> Cc: Adriano Cordova <adrianox@gmail.com>
> Cc: Fabio Estevam <festevam@gmail.com>
> Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
> ---
>  scripts/Makefile.lib | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
> index e89a4a51b74d..54e17b2f8089 100644
> --- a/scripts/Makefile.lib
> +++ b/scripts/Makefile.lib
> @@ -508,7 +508,7 @@ $(obj)/efi_reloc.o: $(srctree)/arch/$(ARCH)/lib/$(EFI_RELOC:.o=.c) $(recordmcoun
>  	$(call cmd,force_checksrc)
>  	$(call if_changed_rule,cc_o_c)
>  
> -$(obj)/%_efi.so: $(obj)/%.o $(obj)/efi_crt0.o $(obj)/efi_reloc.o $(obj)/efi_freestanding.o
> +$(obj)/%_efi.so: $(PLATFORM_LIBGCC) $(obj)/%.o $(obj)/efi_crt0.o $(obj)/efi_reloc.o $(obj)/efi_freestanding.o
>  	$(call cmd,efi_ld)
>  
>  targets += $(obj)/efi_crt0.o $(obj)/efi_reloc.o $(obj)/efi_freestanding.o
> -- 
> 2.43.0
> 


  reply	other threads:[~2025-07-10 15:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-08  1:29 [PATCH] u-boot: upgrade 2025.04 -> 2025.07 Fabio Estevam
2025-07-08 12:37 ` [OE-core] " Mathieu Dubois-Briand
2025-07-08 17:04   ` Fabio Estevam
2025-07-08 17:57     ` Tom Rini
2025-07-09  8:21       ` Mathieu Dubois-Briand
2025-07-09 14:29         ` Tom Rini
2025-07-10 13:02           ` Mikko Rapeli
     [not found]           ` <1850E573A97965CE.21176@lists.openembedded.org>
2025-07-10 14:50             ` Mikko Rapeli
2025-07-10 14:59               ` Tom Rini
2025-07-10 14:44                 ` [PATCH] scripts/Makefile.lib: fix *_efi.so dependency to PLATFORM_LIBGCC Mikko Rapeli
2025-07-10 15:08                   ` Mikko Rapeli [this message]
2025-07-10 22:25                     ` Tom Rini
2025-07-09  9:35       ` [OE-core] [PATCH] u-boot: upgrade 2025.04 -> 2025.07 Freihofer, Adrian

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=aG_XXm3Cvm6DJPQy@nuoska \
    --to=mikko.rapeli@linaro.org \
    --cc=adrianox@gmail.com \
    --cc=festevam@gmail.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.