llvmPackages_12.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
d90fb1c0 d964f211

+5 -3
+5 -3
pkgs/development/compilers/llvm/12/libcxxabi/default.nix
··· 1 1 { lib, stdenv, llvm_meta, cmake, python3, fetch, libcxx, libunwind, llvm, version 2 2 , enableShared ? !stdenv.hostPlatform.isStatic 3 + , standalone ? stdenv.hostPlatform.useLLVM or false 4 + , withLibunwind ? !stdenv.isDarwin && !stdenv.isFreeBSD && !stdenv.hostPlatform.isWasm 3 5 }: 4 6 5 7 stdenv.mkDerivation { ··· 28 30 ]; 29 31 30 32 nativeBuildInputs = [ cmake python3 ]; 31 - buildInputs = lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD && !stdenv.hostPlatform.isWasm) libunwind; 33 + buildInputs = lib.optional withLibunwind libunwind; 32 34 33 - cmakeFlags = lib.optionals (stdenv.hostPlatform.useLLVM or false) [ 35 + cmakeFlags = lib.optionals standalone [ 34 36 "-DLLVM_ENABLE_LIBCXX=ON" 35 37 "-DLIBCXXABI_USE_LLVM_UNWINDER=ON" 36 38 ] ++ lib.optionals stdenv.hostPlatform.isWasm [ ··· 47 49 # the magic combination of necessary CMake variables 48 50 # if you fancy a try, take a look at 49 51 # https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/RPATH-handling 50 - install_name_tool -id $out/$file $file 52 + ${stdenv.cc.targetPrefix}install_name_tool -id $out/$file $file 51 53 done 52 54 make install 53 55 install -d 755 $out/include