]> code.ossystems Code Review - openembedded-core.git/commitdiff
meta-toolchain: Update the way ld.so.cache is handled
authorRichard Purdie <rpurdie@linux.intel.com>
Wed, 13 Oct 2010 16:41:29 +0000 (17:41 +0100)
committerRichard Purdie <rpurdie@linux.intel.com>
Wed, 13 Oct 2010 16:41:29 +0000 (17:41 +0100)
Fix the library search path so that libs in the toolchain in /opt/
have priority over those in base system but ones from the base system
can still be found.

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
meta/classes/toolchain-scripts.bbclass
meta/recipes-tbd/meta/meta-toolchain.bb

index c393d996442299a0456e5eb89687c20a08043a09..9c6fe67d49c4296de39e0a2cadc3be8494a8ac9e 100644 (file)
@@ -6,6 +6,10 @@ toolchain_create_sdk_env_script () {
        script=${SDK_OUTPUT}/${SDKPATH}/environment-setup-${MULTIMACH_TARGET_SYS}
        rm -f $script
        touch $script
+       echo 'if [ ! -e ${SDKPATHNATIVE}/etc/ld.so.cache ]; then' >> $script
+       echo '    echo "Please run ${SDKPATH}/postinstall as root before using the toolchain"'  >> $script
+       echo '    exit 1' >> $script
+       echo 'fi' >> $script
        echo 'export PATH=${SDKPATHNATIVE}${bindir_nativesdk}:${SDKPATHNATIVE}${bindir_nativesdk}/${MULTIMACH_TARGET_SYS}:$PATH' >> $script
        echo 'export PKG_CONFIG_SYSROOT_DIR=${SDKTARGETSYSROOT}' >> $script
        echo 'export PKG_CONFIG_PATH=${SDKTARGETSYSROOT}${libdir}/pkgconfig' >> $script
index 2fab8f94b28268408a293fd0d55ba2d8a36c7045..633f5f19903b73fbfe471bbe6f9e871fe663c60c 100644 (file)
@@ -72,8 +72,15 @@ do_populate_sdk() {
        #rm -f ${SDK_OUTPUT}/${SDKPATHNATIVE}/lib/*.la
        rm -f ${SDK_OUTPUT}/${SDKPATHNATIVE}${libdir_nativesdk}/*.la
 
-       # Link the ld.so.cache file into the hosts filesystem
-       ln -s /etc/ld.so.cache ${SDK_OUTPUT}/${SDKPATHNATIVE}/etc/ld.so.cache
+       # Create an appropriate setup so the dynamic loader can find libs in 
+       # both the host system and the toolchain directories
+       echo ${SDKPATHNATIVE}${libdir} > ${SDK_OUTPUT}/${SDKPATHNATIVE}/etc/ld.so.conf
+       echo ${SDKPATHNATIVE}${base_libdir} >> ${SDK_OUTPUT}/${SDKPATHNATIVE}/etc/ld.so.conf
+       echo "include /etc/ld.so.conf" >> ${SDK_OUTPUT}/${SDKPATHNATIVE}/etc/ld.so.conf
+       echo "#!/bin/sh" > ${SDK_OUTPUT}/${SDKPATH}/postinstall
+       echo "ldconfig -f ${SDKPATHNATIVE}/etc/ld.so.conf -C /${SDKPATHNATIVE}/etc/ld.so.cache" >> ${SDK_OUTPUT}/${SDKPATH}/postinstall
+       chmod a+x ${SDK_OUTPUT}/${SDKPATH}/postinstall
+
 
        # Setup site file for external use
        siteconfig=${SDK_OUTPUT}/${SDKPATH}/site-config-${MULTIMACH_TARGET_SYS}