All of lore.kernel.org
 help / color / mirror / Atom feed
* Boost + Yocto
@ 2017-10-06 12:05 Patrick Vacek
  2017-10-06 13:36 ` Khem Raj
  0 siblings, 1 reply; 4+ messages in thread
From: Patrick Vacek @ 2017-10-06 12:05 UTC (permalink / raw)
  To: yocto

Hello,

I'm trying to understand how Yocto figures out which Boost libraries to
install in an image. I've been studying the Boost recipes and it looks
like RRECOMMENDS is used to specify all of the libraries, but yet my
image only gets a subset of them. It's the subset that I typically need,
so it's fine, but I want to understand how the process works.

There's an additional tricky detail that got me looking into this. When
I bitbake a recipe I've written which just lists "boost" in DEPENDS,
running ldd the compiled executable does not appear to depend on a
couple of the boost libraries that I'd specified in CMake (although it
does depend on several others). Only the libraries that are specifically
mentioned with ldd are installed in the image. However, if I manually
cross-compile the same code via the native-sdk, ldd indicates that all
the expected libraries are dependencies. As such, that executable will
not be able to run on my device until I install the missing libraries.
Oddly, those libraries are built with bitbake, but not installed! How
does bitbake manage to remove some of these dependencies?

Thanks.

-- 
Patrick Vacek
ATS Advanced Telematic Systems GmbH
Kantstraße 162, 10623 Berlin
HRB 151501 B, Amtsgericht Charlottenburg
Vertreten durch die Geschäftsführer
Dirk Pöschl, Armin G. Schmidt




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

* Re: Boost + Yocto
  2017-10-06 12:05 Boost + Yocto Patrick Vacek
@ 2017-10-06 13:36 ` Khem Raj
  2017-10-06 14:56   ` Patrick Vacek
  0 siblings, 1 reply; 4+ messages in thread
From: Khem Raj @ 2017-10-06 13:36 UTC (permalink / raw)
  To: Patrick Vacek; +Cc: yocto

On Fri, Oct 6, 2017 at 5:05 AM, Patrick Vacek
<patrick@advancedtelematic.com> wrote:
> Hello,
>
> I'm trying to understand how Yocto figures out which Boost libraries to
> install in an image. I've been studying the Boost recipes and it looks
> like RRECOMMENDS is used to specify all of the libraries, but yet my
> image only gets a subset of them. It's the subset that I typically need,
> so it's fine, but I want to understand how the process works.
>
> There's an additional tricky detail that got me looking into this. When
> I bitbake a recipe I've written which just lists "boost" in DEPENDS,
> running ldd the compiled executable does not appear to depend on a
> couple of the boost libraries that I'd specified in CMake (although it
> does depend on several others). Only the libraries that are specifically
> mentioned with ldd are installed in the image. However, if I manually
> cross-compile the same code via the native-sdk, ldd indicates that all
> the expected libraries are dependencies. As such, that executable will
> not be able to run on my device until I install the missing libraries.
> Oddly, those libraries are built with bitbake, but not installed! How
> does bitbake manage to remove some of these dependencies?

it could be thst applications dependency detection mechanism is behaving
differently and presenting different set to linker.

Secondly its possible that linker options in play are different e.g.
--as-needed and --copy-dt-needed-entries might be in play


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

* Re: Boost + Yocto
  2017-10-06 13:36 ` Khem Raj
@ 2017-10-06 14:56   ` Patrick Vacek
  2017-10-06 21:46     ` Khem Raj
  0 siblings, 1 reply; 4+ messages in thread
From: Patrick Vacek @ 2017-10-06 14:56 UTC (permalink / raw)
  To: Khem Raj; +Cc: yocto

On 06.10.2017 15:36, Khem Raj wrote:
> On Fri, Oct 6, 2017 at 5:05 AM, Patrick Vacek
> <patrick@advancedtelematic.com> wrote:
>> Hello,
>>
>> I'm trying to understand how Yocto figures out which Boost libraries to
>> install in an image. I've been studying the Boost recipes and it looks
>> like RRECOMMENDS is used to specify all of the libraries, but yet my
>> image only gets a subset of them. It's the subset that I typically need,
>> so it's fine, but I want to understand how the process works.
>>
>> There's an additional tricky detail that got me looking into this. When
>> I bitbake a recipe I've written which just lists "boost" in DEPENDS,
>> running ldd the compiled executable does not appear to depend on a
>> couple of the boost libraries that I'd specified in CMake (although it
>> does depend on several others). Only the libraries that are specifically
>> mentioned with ldd are installed in the image. However, if I manually
>> cross-compile the same code via the native-sdk, ldd indicates that all
>> the expected libraries are dependencies. As such, that executable will
>> not be able to run on my device until I install the missing libraries.
>> Oddly, those libraries are built with bitbake, but not installed! How
>> does bitbake manage to remove some of these dependencies?
> 
> it could be thst applications dependency detection mechanism is behaving
> differently and presenting different set to linker.
> 
> Secondly its possible that linker options in play are different e.g.
> --as-needed and --copy-dt-needed-entries might be in play
> 

It turns out that the troublesome boost libraries are not actually used
after all! I haven't yet deduced if the sort of linker flags you
mentioned are being used, but that may be at the root of the issue.

What's now confusing me is why, after removing all references to the
extraneous libraries, CMake still finds them and the cross-compiled
binary still links against them. The only thought I've had so far is
that they are a transitive dependency, although that seems unlikely.
However, that's probably a matter to look into with CMake, not Yocto...

Thanks!

-- 
Patrick Vacek
ATS Advanced Telematic Systems GmbH
Kantstraße 162, 10623 Berlin
HRB 151501 B, Amtsgericht Charlottenburg
Vertreten durch die Geschäftsführer
Dirk Pöschl, Armin G. Schmidt



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

* Re: Boost + Yocto
  2017-10-06 14:56   ` Patrick Vacek
@ 2017-10-06 21:46     ` Khem Raj
  0 siblings, 0 replies; 4+ messages in thread
From: Khem Raj @ 2017-10-06 21:46 UTC (permalink / raw)
  To: Patrick Vacek; +Cc: yocto

On Fri, Oct 6, 2017 at 7:56 AM, Patrick Vacek
<patrick@advancedtelematic.com> wrote:
> On 06.10.2017 15:36, Khem Raj wrote:
>> On Fri, Oct 6, 2017 at 5:05 AM, Patrick Vacek
>> <patrick@advancedtelematic.com> wrote:
>>> Hello,
>>>
>>> I'm trying to understand how Yocto figures out which Boost libraries to
>>> install in an image. I've been studying the Boost recipes and it looks
>>> like RRECOMMENDS is used to specify all of the libraries, but yet my
>>> image only gets a subset of them. It's the subset that I typically need,
>>> so it's fine, but I want to understand how the process works.
>>>
>>> There's an additional tricky detail that got me looking into this. When
>>> I bitbake a recipe I've written which just lists "boost" in DEPENDS,
>>> running ldd the compiled executable does not appear to depend on a
>>> couple of the boost libraries that I'd specified in CMake (although it
>>> does depend on several others). Only the libraries that are specifically
>>> mentioned with ldd are installed in the image. However, if I manually
>>> cross-compile the same code via the native-sdk, ldd indicates that all
>>> the expected libraries are dependencies. As such, that executable will
>>> not be able to run on my device until I install the missing libraries.
>>> Oddly, those libraries are built with bitbake, but not installed! How
>>> does bitbake manage to remove some of these dependencies?
>>
>> it could be thst applications dependency detection mechanism is behaving
>> differently and presenting different set to linker.
>>
>> Secondly its possible that linker options in play are different e.g.
>> --as-needed and --copy-dt-needed-entries might be in play
>>
>
> It turns out that the troublesome boost libraries are not actually used
> after all! I haven't yet deduced if the sort of linker flags you
> mentioned are being used, but that may be at the root of the issue.
>
> What's now confusing me is why, after removing all references to the
> extraneous libraries, CMake still finds them and the cross-compiled
> binary still links against them. The only thought I've had so far is
> that they are a transitive dependency, although that seems unlikely.
> However, that's probably a matter to look into with CMake, not Yocto...

its possible that the faulty build is using a linker which defaults to
pulling libraries from DT_NEEDED segments


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

end of thread, other threads:[~2017-10-06 21:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-06 12:05 Boost + Yocto Patrick Vacek
2017-10-06 13:36 ` Khem Raj
2017-10-06 14:56   ` Patrick Vacek
2017-10-06 21:46     ` 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.