[yocto] Getting linker -l into a bbappend

Khem Raj raj.khem at gmail.com
Wed Jun 7 10:16:55 PDT 2017


On Wed, Jun 7, 2017 at 10:14 AM, Colin Helliwell
<colin.helliwell at ln-systems.com> wrote:
>
>> On 07 June 2017 at 18:12 Khem Raj <raj.khem at gmail.com> wrote:
>>
>> On Wed, Jun 7, 2017 at 9:37 AM, <colin.helliwell at ln-systems.com> wrote:
>>
>> > I have an autotools (C++) app which builds fine with my default recipe. But
>> > for a particular platform an additional (C) library is needed, so I have a
>> > bbappend.
>> > I can add in the additional compiler flag here, but I'm struggling to
>> > specify the additional library linkage - I think it's because the ordering
>> > on the linker command line is wrong.
>> >
>> > If I add '-lfoo' to the base Makefile.am then it builds fine (though
>> > strangely, "-lfoo" isn't anywhere in the linker command line?).
>> > But I'm trying to put this into just the 'append' rather than altering the
>> > base [non-platform-specific] Makefile.
>> >
>> > I've tried
>> >  EXTRA_OEMAKE += " LDFLAGS+="-lfoo" "
>> > and
>> >  LDFLAGS+="-lrfctrl"
>> > but these don't seem to construct the correct linkage order (functions from
>> > the library are undefined references)
>> >
>> > Is there a way to append this in the right way?
>>
>> it depends on components build systems some are more accommodating of
>> the env passed to them some are not. So in many
>> cases you have to patch the make system of the component to
>> allow it to accept changes to variables passed from bitbake env
>> from what you explain it seems you might have to look into
>> component's build system to accommodate it.
>>
>
> Thanks Khem. I *could* patch the Makefile.am, if there's no other way

the components makefiles have to accept it, bitbake can only delegate



More information about the yocto mailing list