llvmPackages_13.libcxxabi: Align with 11 libcxxabi

LLVM 11 libcxxabi has some flags to support usage in the Darwin stdenv,
in particular, `standalone` and `withLibunwind`.

Darwin stdenv needs the `standalone` flag because its `hostPlatform` set
doesn't have `useLLVM` set to true. And it needs `withLibunwind` to
explicitly disable including `libunwind` as a build input.

We also prefix `install_name_tool` in case we're cross-compiling.

authored by toonn and committed by Jonathan Ringer 21df776a d90fb1c0

+6 -4
+6 -4
pkgs/development/compilers/llvm/13/libcxxabi/default.nix
··· 1 - { lib, stdenv, llvm_meta, cmake, python3, src, libunwind, version 1 + { lib, stdenv, llvm_meta, cmake, python3, src, libunwind, libcxx, version 2 2 , enableShared ? !stdenv.hostPlatform.isStatic 3 - , libcxx 3 + , standalone ? stdenv.hostPlatform.useLLVM or false 4 + , withLibunwind ? !stdenv.isDarwin && !stdenv.isFreeBSD && !stdenv.hostPlatform.isWasm 4 5 }: 5 6 6 7 stdenv.mkDerivation rec { ··· 23 24 ]; 24 25 25 26 nativeBuildInputs = [ cmake python3 ]; 26 - buildInputs = lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD && !stdenv.hostPlatform.isWasm) libunwind; 27 + buildInputs = lib.optional withLibunwind libunwind; 27 28 28 29 cmakeFlags = [ 29 30 "-DLIBCXXABI_LIBCXX_INCLUDES=${libcxx.dev}/include/c++/v1" 30 - ] ++ lib.optionals (stdenv.hostPlatform.useLLVM or false) [ 31 + ] ++ lib.optionals standalone [ 31 32 "-DLLVM_ENABLE_LIBCXX=ON" 33 + ] ++ lib.optionals (standalone && withLibunwind) [ 32 34 "-DLIBCXXABI_USE_LLVM_UNWINDER=ON" 33 35 ] ++ lib.optionals stdenv.hostPlatform.isWasm [ 34 36 "-DLIBCXXABI_ENABLE_THREADS=OFF"