On Fri, Jul 28, 2023 at 3:57 AM Alexander Kanavin
<alex.kana...@gmail.com> wrote:
>
> On Thu, 27 Jul 2023 at 18:09, Khem Raj <raj.k...@gmail.com> wrote:
> >
> > On 7/27/23 7:36 AM, Alexander Kanavin wrote:
> > > Unset LDFLAGS as the standard ones do not work when linking EFI binaries
> > > (the new version of gnu-efi adds various apps).
> > >
> >
> > curious about which ldflags are problematic from OE env.
>
> | x86_64-poky-linux-ld
> --sysroot=/srv/storage/alex/yocto/build-64-alt/tmp/work/core2-64-poky-linux/gnu-efi/3.0.17-r0/recipe-sysroot
>   -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fcanon-prefix-map
> -fmacro-prefix-map=/srv/storage/alex/yocto/build-64-alt/tmp/work/core2-64-poky-linux/gnu-efi/3.0.17-r0/gnu-efi-3.0.17=/usr/src/debug/gnu-efi/3.0.17-r0
>  
> -fdebug-prefix-map=/srv/storage/alex/yocto/build-64-alt/tmp/work/core2-64-poky-linux/gnu-efi/3.0.17-r0/gnu-efi-3.0.17=/usr/src/debug/gnu-efi/3.0.17-r0
>  
> -fmacro-prefix-map=/srv/storage/alex/yocto/build-64-alt/tmp/work/core2-64-poky-linux/gnu-efi/3.0.17-r0/gnu-efi-3.0.17=/usr/src/debug/gnu-efi/3.0.17-r0
>  
> -fdebug-prefix-map=/srv/storage/alex/yocto/build-64-alt/tmp/work/core2-64-poky-linux/gnu-efi/3.0.17-r0/gnu-efi-3.0.17=/usr/src/debug/gnu-efi/3.0.17-r0
>  
> -fdebug-prefix-map=/srv/storage/alex/yocto/build-64-alt/tmp/work/core2-64-poky-linux/gnu-efi/3.0.17-r0/recipe-sysroot=
>  
> -fmacro-prefix-map=/srv/storage/alex/yocto/build-64-alt/tmp/work/core2-64-poky-linux/gnu-efi/3.0.17-r0/recipe-sysroot=
>  
> -fdebug-prefix-map=/srv/storage/alex/yocto/build-64-alt/tmp/work/core2-64-poky-linux/gnu-efi/3.0.17-r0/recipe-sysroot-native=
>  -Wl,-z,relro,-z,now -nostdlib --warn-common --no-undefined
> --fatal-warnings --build-id=sha1 -nostdlib --warn-common
> --no-undefined --fatal-warnings --build-id=sha1 -shared -Bsymbolic
> -L../lib -L../gnuefi ../gnuefi/crt0-efi-x86_64.o ctors_test.o
> ctors_fns.o -o ctors_test.so -lefi -lgnuefi
> /srv/storage/alex/yocto/build-64-alt/tmp/work/core2-64-poky-linux/gnu-efi/3.0.17-r0/recipe-sysroot/usr/lib/../lib/x86_64-poky-linux/13.1.1/libgcc.a
> -T 
> /srv/storage/alex/yocto/build-64-alt/tmp/work/core2-64-poky-linux/gnu-efi/3.0.17-r0/gnu-efi-3.0.17//apps/../gnuefi/elf_x86_64_efi.lds
> | x86_64-poky-linux-ld: unrecognized option '-Wl,-O1'
> | x86_64-poky-linux-ld: use the --help option for usage information
>

I see, OE LDFLAGS assume compiler driver to call linker and thats why
bunch of -Wl, options are used but here, bare ld is called. Does it
make sense to use CCLD
as linker instead of bare LD in these makefiles. Some options like
prefix map etc might be useful for removing build time paths and
hash-style is also important one.

>
> > > -FILES:${PN} += "${libdir}/*.lds"
> > > +FILES:${PN} += "${libdir}/*.lds ${libdir}/gnuefi/apps"
> >
> > Do you think if there is any positives of these be packaged separately?
>
> Not really. gnu-efi is a static library that consumers (e.g.
> systemd-boot) link with at build time, so the main package has nothing
> other than these apps, and one small .lds file. If there's a better
> way, it should be done by someone who's an expert in it.
>
> Alex
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#185034): 
https://lists.openembedded.org/g/openembedded-core/message/185034
Mute This Topic: https://lists.openembedded.org/mt/100391609/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to