[yocto] Getting linker -l into a bbappend

Khem Raj raj.khem at gmail.com
Wed Jun 7 10:12:14 PDT 2017


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
>
>
> --
> _______________________________________________
> yocto mailing list
> yocto at yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto



More information about the yocto mailing list