diff --git a/pkgs/development/compilers/llvm/7/libc++abi/default.nix b/pkgs/development/compilers/llvm/7/libc++abi/default.nix index 9f9606f586c..4f29ca0d6e2 100644 --- a/pkgs/development/compilers/llvm/7/libc++abi/default.nix +++ b/pkgs/development/compilers/llvm/7/libc++abi/default.nix @@ -1,5 +1,6 @@ { lib, stdenv, cmake, fetch, libcxx, libunwind, llvm, version , standalone ? stdenv.hostPlatform.useLLVM or false +, withLibunwind ? !stdenv.isDarwin && !stdenv.isFreeBSD && !stdenv.hostPlatform.isWasm # on musl the shared objects don't build , enableShared ? !stdenv.hostPlatform.isStatic }: @@ -11,7 +12,13 @@ stdenv.mkDerivation { src = fetch "libcxxabi" "1zcqxsdjhawgz1cvpk07y3jl6fg9p3ay4nl69zsirqb2ghgyhhb2"; nativeBuildInputs = [ cmake ]; - buildInputs = lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD && !stdenv.hostPlatform.isWasm) libunwind; + buildInputs = lib.optional withLibunwind libunwind; + + cmakeFlags = lib.optionals standalone [ + "-DLLVM_ENABLE_LIBCXX=ON" + ] ++ lib.optionals (standalone && withLibunwind) [ + "-DLIBCXXABI_USE_LLVM_UNWINDER=ON" + ] ++ lib.optional (!enableShared) "-DLIBCXXABI_ENABLE_SHARED=OFF"; postUnpack = '' unpackFile ${libcxx.src} @@ -23,11 +30,6 @@ stdenv.mkDerivation { patch -p1 -d $(ls -d libcxx-*) -i ${../../libcxx-0001-musl-hacks.patch} ''; - cmakeFlags = lib.optionals standalone [ - "-DLLVM_ENABLE_LIBCXX=ON" - "-DLIBCXXABI_USE_LLVM_UNWINDER=ON" - ] ++ lib.optional (!enableShared) "-DLIBCXXABI_ENABLE_SHARED=OFF"; - installPhase = if stdenv.isDarwin then '' for file in lib/*.dylib; do