Getting linker -l into a bbappend
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?
Thanks
Quoted 12 lines · On Wed, Jun 7, 2017 at 9:37 AM, <[email protected]> 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.
Quoted 8 lines
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.
Quoted 8 lines
Thanks
--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto
Quoted 24 lines · On 07 June 2017 at 18:12 Khem Raj <[email protected]> wrote:
Quoted 19 lines · On Wed, Jun 7, 2017 at 9:37 AM, <[email protected]> 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)
Quoted 9 lines
Quoted 1 line
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
Quoted 34 lines · Colin Helliwell
Quoted 24 lines · On 07 June 2017 at 18:12 Khem Raj <[email protected]> wrote:
Quoted 19 lines · On Wed, Jun 7, 2017 at 9:37 AM, <[email protected]> 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)Quoted 9 lines
Quoted 1 line
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.
Quoted 1 line
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