All of lore.kernel.org
 help / color / mirror / Atom feed
* Getting linker -l into a bbappend
@ 2017-06-07 16:37 colin.helliwell
  2017-06-07 17:12 ` Khem Raj
  0 siblings, 1 reply; 4+ messages in thread
From: colin.helliwell @ 2017-06-07 16:37 UTC (permalink / raw)
  To: yocto

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




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Getting linker -l into a bbappend
  2017-06-07 16:37 Getting linker -l into a bbappend colin.helliwell
@ 2017-06-07 17:12 ` Khem Raj
  2017-06-07 17:14   ` Colin Helliwell
  0 siblings, 1 reply; 4+ messages in thread
From: Khem Raj @ 2017-06-07 17:12 UTC (permalink / raw)
  To: colin.helliwell; +Cc: yocto

On Wed, Jun 7, 2017 at 9:37 AM,  <colin.helliwell@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@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Getting linker -l into a bbappend
  2017-06-07 17:12 ` Khem Raj
@ 2017-06-07 17:14   ` Colin Helliwell
  2017-06-07 17:16     ` Khem Raj
  0 siblings, 1 reply; 4+ messages in thread
From: Colin Helliwell @ 2017-06-07 17:14 UTC (permalink / raw)
  To: Khem Raj; +Cc: yocto


> On 07 June 2017 at 18:12 Khem Raj <raj.khem@gmail.com> wrote:
> 
> On Wed, Jun 7, 2017 at 9:37 AM, <colin.helliwell@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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Getting linker -l into a bbappend
  2017-06-07 17:14   ` Colin Helliwell
@ 2017-06-07 17:16     ` Khem Raj
  0 siblings, 0 replies; 4+ messages in thread
From: Khem Raj @ 2017-06-07 17:16 UTC (permalink / raw)
  To: Colin Helliwell; +Cc: yocto

On Wed, Jun 7, 2017 at 10:14 AM, Colin Helliwell
<colin.helliwell@ln-systems.com> wrote:
>
>> On 07 June 2017 at 18:12 Khem Raj <raj.khem@gmail.com> wrote:
>>
>> On Wed, Jun 7, 2017 at 9:37 AM, <colin.helliwell@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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-06-07 17:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-07 16:37 Getting linker -l into a bbappend colin.helliwell
2017-06-07 17:12 ` Khem Raj
2017-06-07 17:14   ` Colin Helliwell
2017-06-07 17:16     ` Khem Raj

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.