Skip to content

Commit

Permalink
libcxxabi: remove link with build libcxxabi
Browse files Browse the repository at this point in the history
  • Loading branch information
stephank committed Aug 26, 2022
1 parent 8827324 commit 96e4a0f
Show file tree
Hide file tree
Showing 11 changed files with 122 additions and 11 deletions.
12 changes: 11 additions & 1 deletion pkgs/development/compilers/llvm/10/libcxxabi/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,21 @@ stdenv.mkDerivation {

preInstall = lib.optionalString stdenv.isDarwin ''
for file in lib/*.dylib; do
# Fix up the install name. Preserve the basename, just replace the path.
installName="$out/lib/$(basename $(otool -D $file | tail -n 1))"
# this should be done in CMake, but having trouble figuring out
# the magic combination of necessary CMake variables
# if you fancy a try, take a look at
# https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/RPATH-handling
install_name_tool -id $out/$file $file
${stdenv.cc.targetPrefix}install_name_tool -id $installName $file
# 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
${stdenv.cc.targetPrefix}install_name_tool -change $other $installName $file
done
done
'';

Expand Down
12 changes: 11 additions & 1 deletion pkgs/development/compilers/llvm/11/libcxxabi/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,21 @@ stdenv.mkDerivation {

preInstall = lib.optionalString stdenv.isDarwin ''
for file in lib/*.dylib; do
# Fix up the install name. Preserve the basename, just replace the path.
installName="$out/lib/$(basename $(otool -D $file | tail -n 1))"
# this should be done in CMake, but having trouble figuring out
# the magic combination of necessary CMake variables
# if you fancy a try, take a look at
# https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/RPATH-handling
install_name_tool -id $out/$file $file
${stdenv.cc.targetPrefix}install_name_tool -id $installName $file
# 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
${stdenv.cc.targetPrefix}install_name_tool -change $other $installName $file
done
done
'';

Expand Down
12 changes: 11 additions & 1 deletion pkgs/development/compilers/llvm/12/libcxxabi/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,21 @@ stdenv.mkDerivation {

preInstall = lib.optionalString stdenv.isDarwin ''
for file in lib/*.dylib; do
# Fix up the install name. Preserve the basename, just replace the path.
installName="$out/lib/$(basename $(otool -D $file | tail -n 1))"
# this should be done in CMake, but having trouble figuring out
# the magic combination of necessary CMake variables
# if you fancy a try, take a look at
# https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/RPATH-handling
install_name_tool -id $out/$file $file
${stdenv.cc.targetPrefix}install_name_tool -id $installName $file
# 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
${stdenv.cc.targetPrefix}install_name_tool -change $other $installName $file
done
done
'';

Expand Down
12 changes: 11 additions & 1 deletion pkgs/development/compilers/llvm/13/libcxxabi/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,21 @@ stdenv.mkDerivation rec {

preInstall = lib.optionalString stdenv.isDarwin ''
for file in lib/*.dylib; do
# Fix up the install name. Preserve the basename, just replace the path.
installName="$out/lib/$(basename $(otool -D $file | tail -n 1))"
# this should be done in CMake, but having trouble figuring out
# the magic combination of necessary CMake variables
# if you fancy a try, take a look at
# https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/RPATH-handling
install_name_tool -id $out/$file $file
${stdenv.cc.targetPrefix}install_name_tool -id $installName $file
# 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
${stdenv.cc.targetPrefix}install_name_tool -change $other $installName $file
done
done
'';

Expand Down
13 changes: 12 additions & 1 deletion pkgs/development/compilers/llvm/14/libcxxabi/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,23 @@ stdenv.mkDerivation rec {
installPhase = if stdenv.isDarwin
then ''
for file in lib/*.dylib; do
# Fix up the install name. Preserve the basename, just replace the path.
installName="$out/lib/$(basename $(otool -D $file | tail -n 1))"
# this should be done in CMake, but having trouble figuring out
# the magic combination of necessary CMake variables
# if you fancy a try, take a look at
# https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/RPATH-handling
install_name_tool -id $out/$file $file
${stdenv.cc.targetPrefix}install_name_tool -id $installName $file
# 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
${stdenv.cc.targetPrefix}install_name_tool -change $other $installName $file
done
done
make install
install -d 755 $out/include
install -m 644 ../include/*.h $out/include
Expand Down
12 changes: 11 additions & 1 deletion pkgs/development/compilers/llvm/5/libcxxabi/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,21 @@ stdenv.mkDerivation {

preInstall = lib.optionalString stdenv.isDarwin ''
for file in lib/*.dylib; do
# Fix up the install name. Preserve the basename, just replace the path.
installName="$out/lib/$(basename $(otool -D $file | tail -n 1))"
# this should be done in CMake, but having trouble figuring out
# the magic combination of necessary CMake variables
# if you fancy a try, take a look at
# https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/RPATH-handling
install_name_tool -id $out/$file $file
${stdenv.cc.targetPrefix}install_name_tool -id $installName $file
# 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
${stdenv.cc.targetPrefix}install_name_tool -change $other $installName $file
done
done
'';

Expand Down
12 changes: 11 additions & 1 deletion pkgs/development/compilers/llvm/6/libcxxabi/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,21 @@ stdenv.mkDerivation {

preInstall = lib.optionalString stdenv.isDarwin ''
for file in lib/*.dylib; do
# Fix up the install name. Preserve the basename, just replace the path.
installName="$out/lib/$(basename $(otool -D $file | tail -n 1))"
# this should be done in CMake, but having trouble figuring out
# the magic combination of necessary CMake variables
# if you fancy a try, take a look at
# https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/RPATH-handling
install_name_tool -id $out/$file $file
${stdenv.cc.targetPrefix}install_name_tool -id $installName $file
# 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
${stdenv.cc.targetPrefix}install_name_tool -change $other $installName $file
done
done
'';

Expand Down
12 changes: 11 additions & 1 deletion pkgs/development/compilers/llvm/7/libcxxabi/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,21 @@ stdenv.mkDerivation {

preInstall = lib.optionalString stdenv.isDarwin ''
for file in lib/*.dylib; do
# Fix up the install name. Preserve the basename, just replace the path.
installName="$out/lib/$(basename $(otool -D $file | tail -n 1))"
# this should be done in CMake, but having trouble figuring out
# the magic combination of necessary CMake variables
# if you fancy a try, take a look at
# https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/RPATH-handling
install_name_tool -id $out/$file $file
${stdenv.cc.targetPrefix}install_name_tool -id $installName $file
# 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
${stdenv.cc.targetPrefix}install_name_tool -change $other $installName $file
done
done
'';

Expand Down
12 changes: 11 additions & 1 deletion pkgs/development/compilers/llvm/8/libcxxabi/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,21 @@ stdenv.mkDerivation {

preInstall = lib.optionalString stdenv.isDarwin ''
for file in lib/*.dylib; do
# Fix up the install name. Preserve the basename, just replace the path.
installName="$out/lib/$(basename $(otool -D $file | tail -n 1))"
# this should be done in CMake, but having trouble figuring out
# the magic combination of necessary CMake variables
# if you fancy a try, take a look at
# https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/RPATH-handling
install_name_tool -id $out/$file $file
${stdenv.cc.targetPrefix}install_name_tool -id $installName $file
# 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
${stdenv.cc.targetPrefix}install_name_tool -change $other $installName $file
done
done
'';

Expand Down
12 changes: 11 additions & 1 deletion pkgs/development/compilers/llvm/9/libcxxabi/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,21 @@ stdenv.mkDerivation {

preInstall = lib.optionalString stdenv.isDarwin ''
for file in lib/*.dylib; do
# Fix up the install name. Preserve the basename, just replace the path.
installName="$out/lib/$(basename $(otool -D $file | tail -n 1))"
# this should be done in CMake, but having trouble figuring out
# the magic combination of necessary CMake variables
# if you fancy a try, take a look at
# https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/RPATH-handling
install_name_tool -id $out/$file $file
${stdenv.cc.targetPrefix}install_name_tool -id $installName $file
# 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
${stdenv.cc.targetPrefix}install_name_tool -change $other $installName $file
done
done
'';

Expand Down
12 changes: 11 additions & 1 deletion pkgs/development/compilers/llvm/git/libcxxabi/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,21 @@ stdenv.mkDerivation rec {

preInstall = lib.optionalString stdenv.isDarwin ''
for file in lib/*.dylib; do
# Fix up the install name. Preserve the basename, just replace the path.
installName="$out/lib/$(basename $(otool -D $file | tail -n 1))"
# this should be done in CMake, but having trouble figuring out
# the magic combination of necessary CMake variables
# if you fancy a try, take a look at
# https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/RPATH-handling
install_name_tool -id $out/$file $file
${stdenv.cc.targetPrefix}install_name_tool -id $installName $file
# 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
${stdenv.cc.targetPrefix}install_name_tool -change $other $installName $file
done
done
'';

Expand Down

0 comments on commit 96e4a0f

Please sign in to comment.