Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libcxxabi: remove link with build libcxxabi #185766

Merged
merged 1 commit into from
Oct 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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