Skip to content

Commit

Permalink
elbepack: relocate-toolchain: modify rpath before interpreter
Browse files Browse the repository at this point in the history
Some versions of patchelf have a bug[0] which corrupts binaries making
them unusable, work around it.

[0] NixOS/patchelf#524

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
  • Loading branch information
t-8ch committed Feb 27, 2024
1 parent 7d979fd commit 4756af4
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions elbepack/makofiles/toolchain-shar-extract.sh.mako
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 4756af4

Please sign in to comment.