From 486e12ad685be4c0dc5e3033bc1c69f0146b0a99 Mon Sep 17 00:00:00 2001 From: sternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org> Date: Thu, 15 Apr 2021 00:42:15 +0200 Subject: [PATCH] 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. --- .../compilers/llvm/7/libc++abi/default.nix | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pkgs/development/compilers/llvm/7/libc++abi/default.nix b/pkgs/development/compilers/llvm/7/libc++abi/default.nix index 84c47865141..9f9606f586c 100644 --- a/pkgs/development/compilers/llvm/7/libc++abi/default.nix +++ b/pkgs/development/compilers/llvm/7/libc++abi/default.nix @@ -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 ''