Hey folks,
Continuing on from the discussions at LC last week, here are my two patches. They work OK for me in testing on armhf and armel builds here, so I hope they are helpful for other people.
Background: in bi-arch and multi-arch configuration, soft-float and hard-float libraries do not play well together at all:
* ldconfig (currently) does not distinguish between the two ABIs when scanning libraries and putting their details in ld.so.cache, so if you have libs of both ABIs installed on your system then there is no guarantee that the right one will be used when needed.
* ld.so (currently) cannot verify at run-time whether a given lib uses the hard-float or soft-float ABI, which can lead to similar problems.
I previously had just a patch against ld.so for this, causing it to fail to load a library when the wrong ABI was detected. However, more testing has shown that this is not a sufficient solution. ld.so trusts the contents of the cache, so I've had to add logic into ldconfig itself and add extra information in the cache to describe the ABI of a library. There's already similar code in there to recognise 32-bit libs on a 64-bit system, so I've extended things in what I hope is a clean way. Unfortunately, there are also paths through ld.so that *don't* use the cache anyway so we still need the checks in there as well. If the wrong lib is loaded by mistake, return ENOENT so that a fallback is attempted.
For now, there's a fair amount of duplication in the code in each patch. I'd be happier to see it cleaned up and shared better, but my initial efforts in that direction have been thwarted by the internals of eglibc - the (very minimal) infrastructure available in ld.so is very different to that in ldconfig (an entirely normal and boring C application). If anybody fancies trying that cleanup, please feel free... :-)
As the list drops attachments, here are links to the two patches:
http://people.linaro.org/~stevemcintyre/armhf/unsubmitted-ldconfig-cache-abi... http://people.linaro.org/~stevemcintyre/armhf/unsubmitted-ldso-abi-check.dif...
Cheers,