Openembedded Core Discussions
 help / color / mirror / Atom feed
* About share eglibc work directories
@ 2011-06-11  7:55 Robert Yang
  2011-06-11  8:03 ` Phil Blundell
  0 siblings, 1 reply; 4+ messages in thread
From: Robert Yang @ 2011-06-11  7:55 UTC (permalink / raw)
  To: Purdie, Richard, Wold, Saul; +Cc: openembedded-core

Hi Richard and Saul,

The source code of eglibc and eglibc-nativesdk are not compatible because of
the patch ld-search-order.patch, this makes it a little complex to share their
source directories, what can I think is that always apply
ld-search-order.patch, then in do_configure_prepend:

if sdk && patch_applied:
	do nothing
elif not_sdk && patch_applied:
	un-apply the patch
elif sdk && patch_not_applied:
	apply the patch

I don't know whether there is a CONDITIONAL variable which can make it simple.

And the source of eglibc is 137M, not too large, maybe we would not share them?

-- 
Thanks

Robert



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

* Re: About share eglibc work directories
  2011-06-11  7:55 About share eglibc work directories Robert Yang
@ 2011-06-11  8:03 ` Phil Blundell
  2011-06-11  8:18   ` Robert Yang
  0 siblings, 1 reply; 4+ messages in thread
From: Phil Blundell @ 2011-06-11  8:03 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer
  Cc: Purdie, Richard, Wold, Saul

On Sat, 2011-06-11 at 15:55 +0800, Robert Yang wrote:
> The source code of eglibc and eglibc-nativesdk are not compatible because of
> the patch ld-search-order.patch, this makes it a little complex to share their
> source directories, what can I think is that always apply
> ld-search-order.patch, then in do_configure_prepend:

I must admit I never quite understood why ld-search-order.patch is
really required; it seems like rather a gruesome hack.  Why can't the
SDK paths just be put in RPATH records for the nativesdk binaries?

p.





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

* Re: About share eglibc work directories
  2011-06-11  8:03 ` Phil Blundell
@ 2011-06-11  8:18   ` Robert Yang
  2011-06-11  8:46     ` Phil Blundell
  0 siblings, 1 reply; 4+ messages in thread
From: Robert Yang @ 2011-06-11  8:18 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer
  Cc: Purdie, Richard, Wold, Saul


On 06/11/2011 04:03 PM, Phil Blundell wrote:
> On Sat, 2011-06-11 at 15:55 +0800, Robert Yang wrote:
>> The source code of eglibc and eglibc-nativesdk are not compatible because of
>> the patch ld-search-order.patch, this makes it a little complex to share their
>> source directories, what can I think is that always apply
>> ld-search-order.patch, then in do_configure_prepend:
>
> I must admit I never quite understood why ld-search-order.patch is
> really required; it seems like rather a gruesome hack.  Why can't the
> SDK paths just be put in RPATH records for the nativesdk binaries?
>

Here is the comment in ld-search-order.patch, hope this can answer you question:

Upstream-Status: Inappropriate [embedded specific]

The default lib search path order is:

   1) LD_LIBRARY_PATH
   2) RPATH from the binary
   3) ld.so.cache
   4) default search paths embedded in the linker

For nativesdk binaries which are being used alongside binaries on a host system, we
need the search paths to firstly search the shipped nativesdk libs but then also
cover the host system. For example we want the host system's libGL and this may be
in a non-standard location like /usr/lib/mesa. The only place the location is know
about is in the ld.so.cache of the host system.

Since nativesdk has a simple structure and doesn't need to use a cache itself, we
repurpose the cache for use as a last resort in finding host system binaries. This
means we need to switch the order of 3 and 4 above to make this work effectively.

RP 14/10/2010

// Robert


> p.
>
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>



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

* Re: About share eglibc work directories
  2011-06-11  8:18   ` Robert Yang
@ 2011-06-11  8:46     ` Phil Blundell
  0 siblings, 0 replies; 4+ messages in thread
From: Phil Blundell @ 2011-06-11  8:46 UTC (permalink / raw)
  To: Robert Yang
  Cc: Purdie, Richard, Wold, Saul,
	Patches and discussions about the oe-core layer

On Sat, 2011-06-11 at 16:18 +0800, Robert Yang wrote:
> On 06/11/2011 04:03 PM, Phil Blundell wrote:
> > On Sat, 2011-06-11 at 15:55 +0800, Robert Yang wrote:
> >> The source code of eglibc and eglibc-nativesdk are not compatible because of
> >> the patch ld-search-order.patch, this makes it a little complex to share their
> >> source directories, what can I think is that always apply
> >> ld-search-order.patch, then in do_configure_prepend:
> >
> > I must admit I never quite understood why ld-search-order.patch is
> > really required; it seems like rather a gruesome hack.  Why can't the
> > SDK paths just be put in RPATH records for the nativesdk binaries?
> >
> 
> Here is the comment in ld-search-order.patch, hope this can answer you question:

Thanks.  I did see that comment before but I don't think it really
answers the question.

If I'm understanding correctly, the issue is that you want nativesdk
binaries to search for libraries inside the SDK initially, and then to
fall back on the host's own search path (i.e. the same one that host
binaries would use) for libs that aren't shipped as part of the SDK.

Is the issue that the SYSTEM_DIRS end up pointing to somewhere inside
the sysroot?  If that's the case then it seems like a better fix would
be just to force it back to the genuine system dirs in the nativesdk
case.  (The default comes from Makeconfig so I think you should be able
to do this without source code patching.)  This would avoid the risk of
the sdk breaking on systems where ld.so.cache is missing for whatever
reason.

p.





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

end of thread, other threads:[~2011-06-11  8:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-11  7:55 About share eglibc work directories Robert Yang
2011-06-11  8:03 ` Phil Blundell
2011-06-11  8:18   ` Robert Yang
2011-06-11  8:46     ` Phil Blundell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox