Skip to content

Commit

Permalink
llvmPackages_{12,13,14,15,16,17,18,git}.libcxx: merge static libc++ab…
Browse files Browse the repository at this point in the history
…i.a into libc++.a

merge libc++abi.a, if it exists, into libc++.a so static builds behave
similar to shared object builds and only require using -lc++

https://reviews.llvm.org/D96070#2552492
  • Loading branch information
annalee committed Apr 22, 2024
1 parent 697bba9 commit da6f11e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkgs/development/compilers/llvm/common/libcxx/default.nix
Expand Up @@ -126,6 +126,10 @@ stdenv.mkDerivation (rec {
postInstall = lib.optionalString (cxxabi != null) ''
lndir ${lib.getDev cxxabi}/include $dev/include/c++/v1
lndir ${lib.getLib cxxabi}/lib $out/lib
'' + ''
if [[ -f $out/lib/libc++.a && -f $out/lib/libc++abi.a ]]; then
$AR -qL $out/lib/libc++.a $out/lib/libc++abi.a
fi
'';

passthru = {
Expand Down

0 comments on commit da6f11e

Please sign in to comment.