]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
toolchain-shar-relocate.sh: support multiple dynamic loaders for multilib
authorHongxu Jia <hongxu.jia@windriver.com>
Fri, 7 Feb 2025 05:27:46 +0000 (13:27 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 11 Feb 2025 11:42:23 +0000 (11:42 +0000)
While nativesdk support multilib, there are two dynamic loaders,

    $OECORE_NATIVE_SYSROOT/lib64/ld-linux-x86-64.so.2
    $OECORE_NATIVE_SYSROOT/lib/ld-linux.so.2

Search them with wildcard and call relocate_sdk.py separately

[ YOCTO #15722 ]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/files/toolchain-shar-relocate.sh

index 69ea063c8ce0a87931fc43e7d004cd21bda9b4c0..c7170349dbc9d5fddaf895d40cb4561aa8a1b6e1 100644 (file)
@@ -8,8 +8,8 @@ done
 # fix dynamic loader paths in all ELF SDK binaries
 # allow symlinks to be accessed via the find command too
 native_sysroot=$($SUDO_EXEC cat $env_setup_script |grep 'OECORE_NATIVE_SYSROOT='|cut -d'=' -f2|tr -d '"')
-dl_path=$($SUDO_EXEC find $native_sysroot/lib/ -maxdepth 1 -name "ld-linux*")
-if [ "$dl_path" = "" ] ; then
+dl_paths=$($SUDO_EXEC find $native_sysroot/lib*/ -maxdepth 1 -name "ld-linux*")
+if [ "$dl_paths" = "" ] ; then
        echo "SDK could not be set up. Relocate script unable to find ld-linux.so. Abort!"
        exit 1
 fi
@@ -39,7 +39,9 @@ if [ x\${PYTHON} = "x"  ]; then
        echo "SDK could not be relocated.  No python found."
        exit 1
 fi
-\${PYTHON} ${env_setup_script%/*}/relocate_sdk.py $target_sdk_dir $dl_path $executable_files
+for dl_path in \$(echo "$dl_paths"); do
+    \${PYTHON} ${env_setup_script%/*}/relocate_sdk.py $target_sdk_dir \$dl_path $executable_files
+done
 EOF
 
 $SUDO_EXEC mv $tdir/relocate_sdk.sh ${env_setup_script%/*}/relocate_sdk.sh