llvm: Find otool bin from targetPrefix

This is to fix the stdenvBootstrapTools issue where otool & others are
not available in PATH, but only under the targetPrefix.
This commit is contained in:
Josh Channings 2022-11-22 21:37:47 +00:00
parent 252ea6511d
commit 2252245f92
22 changed files with 44 additions and 44 deletions

View file

@ -55,11 +55,11 @@ stdenv.mkDerivation {
for file in lib/*.dylib; do
if [ -L "$file" ]; then continue; fi
baseName=$(basename $(otool -D $file | tail -n 1))
baseName=$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1))
installName="$out/lib/$baseName"
abiName=$(echo "$baseName" | sed -e 's/libc++/libc++abi/')
for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
${stdenv.cc.targetPrefix}install_name_tool -change $other ${libcxxabi}/lib/$abiName $file
done
done

View file

@ -45,7 +45,7 @@ stdenv.mkDerivation {
if [ -L "$file" ]; then continue; fi
# Fix up the install name. Preserve the basename, just replace the path.
installName="$out/lib/$(basename $(otool -D $file | tail -n 1))"
installName="$out/lib/$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1))"
# this should be done in CMake, but having trouble figuring out
# the magic combination of necessary CMake variables
@ -56,7 +56,7 @@ stdenv.mkDerivation {
# cc-wrapper passes '-lc++abi' to all c++ link steps, but that causes
# libcxxabi to sometimes link against a different version of itself.
# Here we simply make that second reference point to ourselves.
for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
${stdenv.cc.targetPrefix}install_name_tool -change $other $installName $file
done
done

View file

@ -71,11 +71,11 @@ stdenv.mkDerivation {
for file in lib/*.dylib; do
if [ -L "$file" ]; then continue; fi
baseName=$(basename $(otool -D $file | tail -n 1))
baseName=$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1))
installName="$out/lib/$baseName"
abiName=$(echo "$baseName" | sed -e 's/libc++/libc++abi/')
for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
${stdenv.cc.targetPrefix}install_name_tool -change $other ${libcxxabi}/lib/$abiName $file
done
done

View file

@ -49,7 +49,7 @@ stdenv.mkDerivation {
if [ -L "$file" ]; then continue; fi
# Fix up the install name. Preserve the basename, just replace the path.
installName="$out/lib/$(basename $(otool -D $file | tail -n 1))"
installName="$out/lib/$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1))"
# this should be done in CMake, but having trouble figuring out
# the magic combination of necessary CMake variables
@ -60,7 +60,7 @@ stdenv.mkDerivation {
# cc-wrapper passes '-lc++abi' to all c++ link steps, but that causes
# libcxxabi to sometimes link against a different version of itself.
# Here we simply make that second reference point to ourselves.
for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
${stdenv.cc.targetPrefix}install_name_tool -change $other $installName $file
done
done

View file

@ -46,11 +46,11 @@ stdenv.mkDerivation {
for file in lib/*.dylib; do
if [ -L "$file" ]; then continue; fi
baseName=$(basename $(otool -D $file | tail -n 1))
baseName=$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1))
installName="$out/lib/$baseName"
abiName=$(echo "$baseName" | sed -e 's/libc++/libc++abi/')
for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
${stdenv.cc.targetPrefix}install_name_tool -change $other ${libcxxabi}/lib/$abiName $file
done
done

View file

@ -47,7 +47,7 @@ stdenv.mkDerivation {
if [ -L "$file" ]; then continue; fi
# Fix up the install name. Preserve the basename, just replace the path.
installName="$out/lib/$(basename $(otool -D $file | tail -n 1))"
installName="$out/lib/$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1))"
# this should be done in CMake, but having trouble figuring out
# the magic combination of necessary CMake variables
@ -58,7 +58,7 @@ stdenv.mkDerivation {
# cc-wrapper passes '-lc++abi' to all c++ link steps, but that causes
# libcxxabi to sometimes link against a different version of itself.
# Here we simply make that second reference point to ourselves.
for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
${stdenv.cc.targetPrefix}install_name_tool -change $other $installName $file
done
done

View file

@ -50,11 +50,11 @@ stdenv.mkDerivation rec {
for file in lib/*.dylib; do
if [ -L "$file" ]; then continue; fi
baseName=$(basename $(otool -D $file | tail -n 1))
baseName=$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1))
installName="$out/lib/$baseName"
abiName=$(echo "$baseName" | sed -e 's/libc++/libc++abi/')
for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
${stdenv.cc.targetPrefix}install_name_tool -change $other ${libcxxabi}/lib/$abiName $file
done
done

View file

@ -44,7 +44,7 @@ stdenv.mkDerivation rec {
if [ -L "$file" ]; then continue; fi
# Fix up the install name. Preserve the basename, just replace the path.
installName="$out/lib/$(basename $(otool -D $file | tail -n 1))"
installName="$out/lib/$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1))"
# this should be done in CMake, but having trouble figuring out
# the magic combination of necessary CMake variables
@ -55,7 +55,7 @@ stdenv.mkDerivation rec {
# cc-wrapper passes '-lc++abi' to all c++ link steps, but that causes
# libcxxabi to sometimes link against a different version of itself.
# Here we simply make that second reference point to ourselves.
for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
${stdenv.cc.targetPrefix}install_name_tool -change $other $installName $file
done
done

View file

@ -66,11 +66,11 @@ stdenv.mkDerivation rec {
for file in lib/*.dylib; do
if [ -L "$file" ]; then continue; fi
baseName=$(basename $(otool -D $file | tail -n 1))
baseName=$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1))
installName="$out/lib/$baseName"
abiName=$(echo "$baseName" | sed -e 's/libc++/libc++abi/')
for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
${stdenv.cc.targetPrefix}install_name_tool -change $other ${libcxxabi}/lib/$abiName $file
done
done

View file

@ -55,7 +55,7 @@ stdenv.mkDerivation rec {
if [ -L "$file" ]; then continue; fi
# Fix up the install name. Preserve the basename, just replace the path.
installName="$out/lib/$(basename $(otool -D $file | tail -n 1))"
installName="$out/lib/$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1))"
# this should be done in CMake, but having trouble figuring out
# the magic combination of necessary CMake variables
@ -66,7 +66,7 @@ stdenv.mkDerivation rec {
# cc-wrapper passes '-lc++abi' to all c++ link steps, but that causes
# libcxxabi to sometimes link against a different version of itself.
# Here we simply make that second reference point to ourselves.
for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
${stdenv.cc.targetPrefix}install_name_tool -change $other $installName $file
done
done

View file

@ -45,11 +45,11 @@ stdenv.mkDerivation {
for file in lib/*.dylib; do
if [ -L "$file" ]; then continue; fi
baseName=$(basename $(otool -D $file | tail -n 1))
baseName=$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1))
installName="$out/lib/$baseName"
abiName=$(echo "$baseName" | sed -e 's/libc++/libc++abi/')
for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
${stdenv.cc.targetPrefix}install_name_tool -change $other ${libcxxabi}/lib/$abiName $file
done
done

View file

@ -30,7 +30,7 @@ stdenv.mkDerivation {
if [ -L "$file" ]; then continue; fi
# Fix up the install name. Preserve the basename, just replace the path.
installName="$out/lib/$(basename $(otool -D $file | tail -n 1))"
installName="$out/lib/$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1))"
# this should be done in CMake, but having trouble figuring out
# the magic combination of necessary CMake variables
@ -41,7 +41,7 @@ stdenv.mkDerivation {
# cc-wrapper passes '-lc++abi' to all c++ link steps, but that causes
# libcxxabi to sometimes link against a different version of itself.
# Here we simply make that second reference point to ourselves.
for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
${stdenv.cc.targetPrefix}install_name_tool -change $other $installName $file
done
done

View file

@ -51,11 +51,11 @@ stdenv.mkDerivation {
for file in lib/*.dylib; do
if [ -L "$file" ]; then continue; fi
baseName=$(basename $(otool -D $file | tail -n 1))
baseName=$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1))
installName="$out/lib/$baseName"
abiName=$(echo "$baseName" | sed -e 's/libc++/libc++abi/')
for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
${stdenv.cc.targetPrefix}install_name_tool -change $other ${libcxxabi}/lib/$abiName $file
done
done

View file

@ -30,7 +30,7 @@ stdenv.mkDerivation {
if [ -L "$file" ]; then continue; fi
# Fix up the install name. Preserve the basename, just replace the path.
installName="$out/lib/$(basename $(otool -D $file | tail -n 1))"
installName="$out/lib/$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1))"
# this should be done in CMake, but having trouble figuring out
# the magic combination of necessary CMake variables
@ -41,7 +41,7 @@ stdenv.mkDerivation {
# cc-wrapper passes '-lc++abi' to all c++ link steps, but that causes
# libcxxabi to sometimes link against a different version of itself.
# Here we simply make that second reference point to ourselves.
for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
${stdenv.cc.targetPrefix}install_name_tool -change $other $installName $file
done
done

View file

@ -56,11 +56,11 @@ stdenv.mkDerivation {
for file in lib/*.dylib; do
if [ -L "$file" ]; then continue; fi
baseName=$(basename $(otool -D $file | tail -n 1))
baseName=$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1))
installName="$out/lib/$baseName"
abiName=$(echo "$baseName" | sed -e 's/libc++/libc++abi/')
for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
${stdenv.cc.targetPrefix}install_name_tool -change $other ${libcxxabi}/lib/$abiName $file
done
done

View file

@ -49,7 +49,7 @@ stdenv.mkDerivation {
if [ -L "$file" ]; then continue; fi
# Fix up the install name. Preserve the basename, just replace the path.
installName="$out/lib/$(basename $(otool -D $file | tail -n 1))"
installName="$out/lib/$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1))"
# this should be done in CMake, but having trouble figuring out
# the magic combination of necessary CMake variables
@ -60,7 +60,7 @@ stdenv.mkDerivation {
# cc-wrapper passes '-lc++abi' to all c++ link steps, but that causes
# libcxxabi to sometimes link against a different version of itself.
# Here we simply make that second reference point to ourselves.
for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
${stdenv.cc.targetPrefix}install_name_tool -change $other $installName $file
done
done

View file

@ -59,11 +59,11 @@ stdenv.mkDerivation {
for file in lib/*.dylib; do
if [ -L "$file" ]; then continue; fi
baseName=$(basename $(otool -D $file | tail -n 1))
baseName=$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1))
installName="$out/lib/$baseName"
abiName=$(echo "$baseName" | sed -e 's/libc++/libc++abi/')
for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
${stdenv.cc.targetPrefix}install_name_tool -change $other ${libcxxabi}/lib/$abiName $file
done
done

View file

@ -45,7 +45,7 @@ stdenv.mkDerivation {
if [ -L "$file" ]; then continue; fi
# Fix up the install name. Preserve the basename, just replace the path.
installName="$out/lib/$(basename $(otool -D $file | tail -n 1))"
installName="$out/lib/$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1))"
# this should be done in CMake, but having trouble figuring out
# the magic combination of necessary CMake variables
@ -56,7 +56,7 @@ stdenv.mkDerivation {
# cc-wrapper passes '-lc++abi' to all c++ link steps, but that causes
# libcxxabi to sometimes link against a different version of itself.
# Here we simply make that second reference point to ourselves.
for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
${stdenv.cc.targetPrefix}install_name_tool -change $other $installName $file
done
done

View file

@ -55,11 +55,11 @@ stdenv.mkDerivation {
for file in lib/*.dylib; do
if [ -L "$file" ]; then continue; fi
baseName=$(basename $(otool -D $file | tail -n 1))
baseName=$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1))
installName="$out/lib/$baseName"
abiName=$(echo "$baseName" | sed -e 's/libc++/libc++abi/')
for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
${stdenv.cc.targetPrefix}install_name_tool -change $other ${libcxxabi}/lib/$abiName $file
done
done

View file

@ -45,7 +45,7 @@ stdenv.mkDerivation {
if [ -L "$file" ]; then continue; fi
# Fix up the install name. Preserve the basename, just replace the path.
installName="$out/lib/$(basename $(otool -D $file | tail -n 1))"
installName="$out/lib/$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1))"
# this should be done in CMake, but having trouble figuring out
# the magic combination of necessary CMake variables
@ -56,7 +56,7 @@ stdenv.mkDerivation {
# cc-wrapper passes '-lc++abi' to all c++ link steps, but that causes
# libcxxabi to sometimes link against a different version of itself.
# Here we simply make that second reference point to ourselves.
for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
${stdenv.cc.targetPrefix}install_name_tool -change $other $installName $file
done
done

View file

@ -80,11 +80,11 @@ stdenv.mkDerivation rec {
for file in lib/*.dylib; do
if [ -L "$file" ]; then continue; fi
baseName=$(basename $(otool -D $file | tail -n 1))
baseName=$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1))
installName="$out/lib/$baseName"
abiName=$(echo "$baseName" | sed -e 's/libc++/libc++abi/')
for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
${stdenv.cc.targetPrefix}install_name_tool -change $other ${libcxxabi}/lib/$abiName $file
done
done

View file

@ -73,7 +73,7 @@ stdenv.mkDerivation rec {
if [ -L "$file" ]; then continue; fi
# Fix up the install name. Preserve the basename, just replace the path.
installName="$out/lib/$(basename $(otool -D $file | tail -n 1))"
installName="$out/lib/$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1))"
# this should be done in CMake, but having trouble figuring out
# the magic combination of necessary CMake variables
@ -84,7 +84,7 @@ stdenv.mkDerivation rec {
# cc-wrapper passes '-lc++abi' to all c++ link steps, but that causes
# libcxxabi to sometimes link against a different version of itself.
# Here we simply make that second reference point to ourselves.
for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do
${stdenv.cc.targetPrefix}install_name_tool -change $other $installName $file
done
done