File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change 6161 arch='' ${util##*.}
6262 mkdir -p $out/dylibs/$arch
6363 old_interp=$(patchelf $util --print-interpreter)
64+ new_interp=/igloo/dylibs/$(basename $old_interp)
65+
66+ # Pad string so new interpreter path is the same length as the old one
67+ new_interp_padded=$new_interp
68+ while [ '' ${#new_interp_padded} -lt '' ${#old_interp} ]; do
69+ new_interp_padded="/$new_interp_padded"
70+ done
6471
6572 echo "Collecting interpreter from $util"
6673 ln -sf $old_interp $out/dylibs/$arch/$(basename $old_interp)
6976 copyDylibs $arch $util
7077
7178 echo "Switching $util to IGLOO paths"
72- mkdir -p $out/utils
73- mkdir -p $out/utils/$arch
79+ util_out_path= $out/utils/$arch/$(basename -s ".$arch" $util)
80+ mkdir -p $(dirname $util_out_path)
7481 patchelf $util \
7582 --set-rpath /igloo/dylibs \
76- --set-interpreter /igloo/dylibs/$(basename $old_interp) \
77- --output $out/utils/$arch/$(basename -s ".$arch" $util)
83+ --output $util_out_path
84+ # Hack to avoid unaligned pointer bug with patchelf and MIPS
85+ sed -i "s,$old_interp,$new_interp_padded,g" $util_out_path
7886
7987 done
8088
You can’t perform that action at this time.
0 commit comments