About share eglibc work directories
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?
Signature · 3 lines
Thanks Robert
Quoted 4 lines · Robert Yang
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.
Quoted 10 lines · Phil Blundell
Quoted 4 lines · Robert Yang
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
Quoted 9 lines
p.
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
Quoted 7 lines · Robert Yang
Quoted 6 lines · Phil Blundell
Quoted 4 lines · Robert Yang
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:
Quoted 6 lines
Quoted 4 lines
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.