Skip to content

Commit

Permalink
Merge pull request #255488 from natto1784/libcxxabi
Browse files Browse the repository at this point in the history
  • Loading branch information
Artturin authored Sep 20, 2023
2 parents 6d2b362 + 42f3292 commit 6f27ba8
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
1 change: 1 addition & 0 deletions pkgs/build-support/cc-wrapper/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,7 @@ stdenv.mkDerivation {
''
+ optionalString (libcxx.isLLVM or false) ''
echo "-isystem ${lib.getDev libcxx}/include/c++/v1" >> $out/nix-support/libcxx-cxxflags
echo "-isystem ${lib.getDev libcxx.cxxabi}/include/c++/v1" >> $out/nix-support/libcxx-cxxflags
echo "-stdlib=libc++" >> $out/nix-support/libcxx-ldflags
echo "-l${libcxx.cxxabi.libName}" >> $out/nix-support/libcxx-ldflags
''
Expand Down
8 changes: 0 additions & 8 deletions pkgs/development/compilers/llvm/16/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -255,14 +255,6 @@ in let
[ "-rtlib=compiler-rt"
"-Wno-unused-command-line-argument"
"-B${targetLlvmLibraries.compiler-rt}/lib"

# Combat "__cxxabi_config.h not found". Maybe this could be fixed by
# copying these headers into libcxx? Note that building libcxx
# outside of monorepo isn't supported anymore, might be related to
# https://github.com/llvm/llvm-project/issues/55632
# ("16.0.3 libcxx, libcxxabi: circular build dependencies")
# Looks like the machinery changed in https://reviews.llvm.org/D120727.
"-I${lib.getDev targetLlvmLibraries.libcxx.cxxabi}/include/c++/v1"
]
++ lib.optional (!stdenv.targetPlatform.isWasm) "--unwindlib=libunwind"
++ lib.optional
Expand Down
7 changes: 7 additions & 0 deletions pkgs/test/cc-wrapper/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ in stdenv.mkDerivation {
$CXX -o cxx-check ${./cxx-main.cc}
${emulator} ./cxx-check
# test for https://github.com/NixOS/nixpkgs/issues/214524#issuecomment-1431745905
# .../include/cxxabi.h:20:10: fatal error: '__cxxabi_config.h' file not found
# in libcxxStdenv
echo "checking whether cxxabi.h can be included... " >&2
$CXX -o include-cxxabi ${./include-cxxabi.cc}
${emulator} ./include-cxxabi
${lib.optionalString (stdenv.isDarwin && stdenv.cc.isClang) ''
echo "checking whether compiler can build with CoreFoundation.framework... " >&2
mkdir -p foo/lib
Expand Down
8 changes: 8 additions & 0 deletions pkgs/test/cc-wrapper/include-cxxabi.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#include <cxxabi.h>
#include <iostream>

int main(int argc, char **argv)
{
std::cerr << "ok" << std::endl;
return 0;
}

0 comments on commit 6f27ba8

Please sign in to comment.