From 454e4d97870711746b19c290c6fbcc79ee2e5b0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= Date: Mon, 19 Feb 2024 12:34:54 +0100 Subject: [PATCH] elbepack: relocate-toolchain: modify rpath before interpreter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some versions of patchelf have a bug[0] which corrupts binaries making them unusable, work around it. [0] https://github.com/NixOS/patchelf/issues/524 Signed-off-by: Thomas Weißschuh Reviewed-by: Benedikt Spranger --- .../makofiles/toolchain-shar-extract.sh.mako | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/elbepack/makofiles/toolchain-shar-extract.sh.mako b/elbepack/makofiles/toolchain-shar-extract.sh.mako index 6c4d54c04..f89c32783 100644 --- a/elbepack/makofiles/toolchain-shar-extract.sh.mako +++ b/elbepack/makofiles/toolchain-shar-extract.sh.mako @@ -354,14 +354,6 @@ for link in $abs_symbolic_links; do ln -s \$target \$link done -for exe in $native_executable_files; do - if [ \`readlink -f \$exe\` == \`readlink -f $dl_path\` ]; then - echo SKIP \$exe - else - \$PATCHELF --set-interpreter $dl_path \$exe - fi -done - for exe in $native_elf_files; do if [ \`readlink -f \$exe\` == \`readlink -f $dl_path\` ]; then echo SKIP \$exe @@ -387,6 +379,14 @@ for exe in $target_elf_files; do fi done +for exe in $native_executable_files; do + if [ \`readlink -f \$exe\` == \`readlink -f $dl_path\` ]; then + echo SKIP \$exe + else + \$PATCHELF --set-interpreter $dl_path \$exe + fi +done + for exe in $ascii_so_files; do sed -i -e "s%\([ (]\)/\(usr\|lib\|lib64\)/%\1$native_sysroot/\2/%g" \$exe done