[OE-core] [PATCH] syslinux: always use the BFD linker

Allen Wild allenwild93 at gmail.com
Wed Dec 13 02:42:32 UTC 2017


Oops, forgot mail the list when sending my first reply.

I tried appending LDFLAGS, but it doesn't work for syslinux. It's
during do_install, not do_compile, that $(LD) is called directly to
link libutil.elf, libcom32.elf, libgpl.elf, and ldlinux.elf.

A python-free but more intrusive appropach to fix this could be to add
a new variable e.g. HOST_LDNAME in bitbake.conf and incorporate it
into the definition of LD. It would default to "ld" but could be
overridden by recipes like syslinux where appending LDFLAGS doesn't
work.

If we don't expect the bitbake.conf definition of LD to change,
syslinux could also just simply redefine LD =
"${HOST_PREFIX}ld.bfd${TOOLCHAIN_OPTIONS} ${HOST_LD_ARCH}"

Thoughts?
--Allen

On Tue, Dec 12, 2017 at 4:46 PM, Allen Wild <allenwild93 at gmail.com> wrote:
>> Hm, other recipes that have this need typically simply do:
>>
>> LDFLAGS_append = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', ' -fuse-ld=bfd ', '', d)}"
>>
>> Would a similar approach work here, too? Instead of this big change.
>
> I thought about that, but grepping the Makefiles appeared to show many
> usages of $(LD) directly rather than using gcc as the linker, so I
> assumed it wouldn't work.
>
> However, I just looked more closely at my log.do_compile and I don't
> see anything appear to call LD directly, everything is getting run
> through x86_64-oe-linux-gcc.
> Clearly the LD variable passed to make affects this consistently, but
> now I don't know why. I'll try appending LDFLAGS and see if that
> works.
>
> Regards,
> Allen
>
> On Tue, Dec 12, 2017 at 3:55 AM, André Draszik <git at andred.net> wrote:
>> On Mon, 2017-12-11 at 21:49 -0500, Allen Wild wrote:
>>> Syslinux compiles successfully with Gold, but at runtime Isolinux fails
>>> to boot, getting stuck at the version screen without loading the menu.
>>> Forcing the BFD linker fixes this.
>>>
>>> To future-proof, use an inline python replace rather than duplicating
>>> the definition of LD in bitbake.conf
>>
>> Hm, other recipes that have this need typically simply do:
>>
>> LDFLAGS_append = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', ' -fuse-ld=bfd ', '', d)}"
>>
>> Would a similar approach work here, too? Instead of this big change.
>>
>> Cheers,
>> Andre'
>>>
>> --
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core at lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/openembedded-core



More information about the Openembedded-core mailing list