llvmPackages_7.libcxxabi: take libunwind as an optional dependency again

This reverts commit 76b54c75b3bc7a17ffaa20a862246f1d7fe89b58 and brings
llvmPackages_7.libcxxabi in line with what the other llvmPackages
sets are doing again (with llvmPackages_7 being the sole outlier).

This also fixes an evaluation error of llvmPackages_7.libcxxabi if
stdenv.hostPlatform.useLLVM is true as the nonexistant libunwind
argument would be overridden.
This commit is contained in:
sternenseemann 2021-04-15 00:42:15 +02:00
parent be4eb91b3c
commit 486e12ad68

View File

@ -1,5 +1,5 @@
{ lib, stdenv, cmake, fetch, libcxx, llvm, version
, standalone ? false
{ lib, stdenv, cmake, fetch, libcxx, libunwind, llvm, version
, standalone ? stdenv.hostPlatform.useLLVM or false
# on musl the shared objects don't build
, enableShared ? !stdenv.hostPlatform.isStatic
}:
@ -11,6 +11,7 @@ stdenv.mkDerivation {
src = fetch "libcxxabi" "1zcqxsdjhawgz1cvpk07y3jl6fg9p3ay4nl69zsirqb2ghgyhhb2";
nativeBuildInputs = [ cmake ];
buildInputs = lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD && !stdenv.hostPlatform.isWasm) libunwind;
postUnpack = ''
unpackFile ${libcxx.src}
@ -22,9 +23,10 @@ stdenv.mkDerivation {
patch -p1 -d $(ls -d libcxx-*) -i ${../../libcxx-0001-musl-hacks.patch}
'';
cmakeFlags =
lib.optional standalone "-DLLVM_ENABLE_LIBCXX=ON" ++
lib.optional (!enableShared) "-DLIBCXXABI_ENABLE_SHARED=OFF";
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 ''