From dff04746b67a4abee6d1e7b60cfccd08ba19e15e Mon Sep 17 00:00:00 2001 From: Adonis Ling Date: Wed, 30 Oct 2024 16:22:20 +0800 Subject: [PATCH] Update a post: portable-gcc-toolchain.md --- content/post/portable-gcc-toolchain.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/content/post/portable-gcc-toolchain.md b/content/post/portable-gcc-toolchain.md index 3c5c44c..bdd164d 100644 --- a/content/post/portable-gcc-toolchain.md +++ b/content/post/portable-gcc-toolchain.md @@ -531,9 +531,9 @@ function relocate() { while read -r file; do if old_rpath="$(patchelf --print-rpath "${file}" 2>/dev/null)"; then if ${overwrite}; then - old_rpath="\$ORIGIN:\$ORIGIN/lib:\$ORIGIN/lib64:\$ORIGIN/../lib:\$ORIGIN/../lib64" + old_rpath="\$ORIGIN:\$ORIGIN/lib64:\$ORIGIN/lib:\$ORIGIN/../lib64:\$ORIGIN/../lib" fi - new_rpath="${old_rpath:+${old_rpath}:}${library_path}" + new_rpath="${library_path}${old_rpath:+:${old_rpath}}" patchelf --set-rpath "${new_rpath}" "${file}" if readelf -S "${file}" | grep '.interp' >/dev/null; then patchelf --set-interpreter "${interpreter}" "${file}" @@ -625,13 +625,13 @@ function configure_toolchain() { popd >/dev/null || exit local rpaths=( + "$(pwd)/$(uname -m)-linux-gnu/lib" + "$(dirname "${libc_so}")" "\$ORIGIN" - "\$ORIGIN/lib" "\$ORIGIN/lib64" - "\$ORIGIN/../lib" + "\$ORIGIN/lib" "\$ORIGIN/../lib64" - "$(pwd)/$(uname -m)-linux-gnu/lib" - "$(dirname "${libc_so}")" + "\$ORIGIN/../lib" ) local rpaths_in_line rpaths_in_line="$(