Skip to content

Commit dff0474

Browse files
committed
Update a post: portable-gcc-toolchain.md
1 parent 0a6fc8c commit dff0474

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

content/post/portable-gcc-toolchain.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -531,9 +531,9 @@ function relocate() {
531531
while read -r file; do
532532
if old_rpath="$(patchelf --print-rpath "${file}" 2>/dev/null)"; then
533533
if ${overwrite}; then
534-
old_rpath="\$ORIGIN:\$ORIGIN/lib:\$ORIGIN/lib64:\$ORIGIN/../lib:\$ORIGIN/../lib64"
534+
old_rpath="\$ORIGIN:\$ORIGIN/lib64:\$ORIGIN/lib:\$ORIGIN/../lib64:\$ORIGIN/../lib"
535535
fi
536-
new_rpath="${old_rpath:+${old_rpath}:}${library_path}"
536+
new_rpath="${library_path}${old_rpath:+:${old_rpath}}"
537537
patchelf --set-rpath "${new_rpath}" "${file}"
538538
if readelf -S "${file}" | grep '.interp' >/dev/null; then
539539
patchelf --set-interpreter "${interpreter}" "${file}"
@@ -625,13 +625,13 @@ function configure_toolchain() {
625625
popd >/dev/null || exit
626626
627627
local rpaths=(
628+
"$(pwd)/$(uname -m)-linux-gnu/lib"
629+
"$(dirname "${libc_so}")"
628630
"\$ORIGIN"
629-
"\$ORIGIN/lib"
630631
"\$ORIGIN/lib64"
631-
"\$ORIGIN/../lib"
632+
"\$ORIGIN/lib"
632633
"\$ORIGIN/../lib64"
633-
"$(pwd)/$(uname -m)-linux-gnu/lib"
634-
"$(dirname "${libc_so}")"
634+
"\$ORIGIN/../lib"
635635
)
636636
local rpaths_in_line
637637
rpaths_in_line="$(

0 commit comments

Comments
 (0)