Merge pull request #246577 from pwaller/pkgsLLVM-16

authored by Ryan Lahfa and committed by GitHub 30ebda75 fa798818

+119 -17
+16 -4
pkgs/development/compilers/llvm/15/libcxx/default.nix
··· 2 , monorepoSrc, runCommand 3 , cmake, ninja, python3, fixDarwinDylibNames, version 4 , cxxabi ? if stdenv.hostPlatform.isFreeBSD then libcxxrt else libcxxabi 5 - , libcxxabi, libcxxrt 6 , enableShared ? !stdenv.hostPlatform.isStatic 7 8 # If headersOnly is true, the resulting package would only include the headers. ··· 62 nativeBuildInputs = [ cmake ninja python3 ] 63 ++ lib.optional stdenv.isDarwin fixDarwinDylibNames; 64 65 - buildInputs = lib.optionals (!headersOnly) [ cxxabi ]; 66 67 cmakeFlags = let 68 # See: https://libcxx.llvm.org/BuildingLibcxx.html#cmdoption-arg-libcxx-cxx-abi-string ··· 75 "-DLIBCXX_CXX_ABI=${if headersOnly then "none" else libcxx_cxx_abi_opt}" 76 ] ++ lib.optional (!headersOnly && cxxabi.libName == "c++abi") "-DLIBCXX_CXX_ABI_INCLUDE_PATHS=${cxxabi.dev}/include/c++/v1" 77 ++ lib.optional (stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isWasi) "-DLIBCXX_HAS_MUSL_LIBC=1" 78 - ++ lib.optional (stdenv.hostPlatform.useLLVM or false) "-DLIBCXX_USE_COMPILER_RT=ON" 79 - ++ lib.optionals stdenv.hostPlatform.isWasm [ 80 "-DLIBCXX_ENABLE_THREADS=OFF" 81 "-DLIBCXX_ENABLE_FILESYSTEM=OFF" 82 "-DLIBCXX_ENABLE_EXCEPTIONS=OFF"
··· 2 , monorepoSrc, runCommand 3 , cmake, ninja, python3, fixDarwinDylibNames, version 4 , cxxabi ? if stdenv.hostPlatform.isFreeBSD then libcxxrt else libcxxabi 5 + , libcxxabi, libcxxrt, libunwind 6 , enableShared ? !stdenv.hostPlatform.isStatic 7 8 # If headersOnly is true, the resulting package would only include the headers. ··· 62 nativeBuildInputs = [ cmake ninja python3 ] 63 ++ lib.optional stdenv.isDarwin fixDarwinDylibNames; 64 65 + buildInputs = 66 + lib.optionals (!headersOnly) [ cxxabi ] 67 + ++ lib.optionals (stdenv.hostPlatform.useLLVM or false) [ libunwind ]; 68 69 cmakeFlags = let 70 # See: https://libcxx.llvm.org/BuildingLibcxx.html#cmdoption-arg-libcxx-cxx-abi-string ··· 77 "-DLIBCXX_CXX_ABI=${if headersOnly then "none" else libcxx_cxx_abi_opt}" 78 ] ++ lib.optional (!headersOnly && cxxabi.libName == "c++abi") "-DLIBCXX_CXX_ABI_INCLUDE_PATHS=${cxxabi.dev}/include/c++/v1" 79 ++ lib.optional (stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isWasi) "-DLIBCXX_HAS_MUSL_LIBC=1" 80 + ++ lib.optionals (stdenv.hostPlatform.useLLVM or false) [ 81 + "-DLIBCXX_USE_COMPILER_RT=ON" 82 + # (Backport fix from 16, which has LIBCXX_ADDITIONAL_LIBRARIES, but 15 83 + # does not appear to) 84 + # There's precedent for this in llvm-project/libcxx/cmake/caches. 85 + # In a monorepo build you might do the following in the libcxxabi build: 86 + # -DLLVM_ENABLE_PROJECTS=libcxxabi;libunwind 87 + # -DLIBCXXABI_STATICALLY_LINK_UNWINDER_IN_STATIC_LIBRARY=On 88 + # libcxx appears to require unwind and doesn't pull it in via other means. 89 + # "-DLIBCXX_ADDITIONAL_LIBRARIES=unwind" 90 + "-DCMAKE_SHARED_LINKER_FLAGS=-lunwind" 91 + ] ++ lib.optionals stdenv.hostPlatform.isWasm [ 92 "-DLIBCXX_ENABLE_THREADS=OFF" 93 "-DLIBCXX_ENABLE_FILESYSTEM=OFF" 94 "-DLIBCXX_ENABLE_EXCEPTIONS=OFF"
+7
pkgs/development/compilers/llvm/15/libcxxabi/default.nix
··· 68 ] ++ lib.optionals (stdenv.hostPlatform.useLLVM or false) [ 69 "-DLLVM_ENABLE_LIBCXX=ON" 70 "-DLIBCXXABI_USE_LLVM_UNWINDER=ON" 71 ] ++ lib.optionals stdenv.hostPlatform.isWasm [ 72 "-DLIBCXXABI_ENABLE_THREADS=OFF" 73 "-DLIBCXXABI_ENABLE_EXCEPTIONS=OFF"
··· 68 ] ++ lib.optionals (stdenv.hostPlatform.useLLVM or false) [ 69 "-DLLVM_ENABLE_LIBCXX=ON" 70 "-DLIBCXXABI_USE_LLVM_UNWINDER=ON" 71 + ] ++ lib.optionals ((stdenv.hostPlatform.useLLVM or false) || 72 + (stdenv.hostPlatform.isDarwin && enableShared)) [ 73 + # libcxxabi's CMake looks as though it treats -nostdlib++ as implying -nostdlib, 74 + # but that does not appear to be the case for example when building 75 + # pkgsLLVM.libcxxabi (which uses clangNoCompilerRtWithLibc). 76 + "-DCMAKE_EXE_LINKER_FLAGS=-nostdlib" 77 + "-DCMAKE_SHARED_LINKER_FLAGS=-nostdlib" 78 ] ++ lib.optionals stdenv.hostPlatform.isWasm [ 79 "-DLIBCXXABI_ENABLE_THREADS=OFF" 80 "-DLIBCXXABI_ENABLE_EXCEPTIONS=OFF"
+5
pkgs/development/compilers/llvm/15/libunwind/default.nix
··· 40 cd ../runtimes 41 ''; 42 43 outputs = [ "out" "dev" ]; 44 45 nativeBuildInputs = [ cmake ninja python3 ];
··· 40 cd ../runtimes 41 ''; 42 43 + postInstall = lib.optionalString (enableShared && !stdenv.hostPlatform.isDarwin) '' 44 + # libcxxabi wants to link to libunwind_shared.so (?). 45 + ln -s $out/lib/libunwind.so $out/lib/libunwind_shared.so 46 + ''; 47 + 48 outputs = [ "out" "dev" ]; 49 50 nativeBuildInputs = [ cmake ninja python3 ];
+16 -3
pkgs/development/compilers/llvm/16/compiler-rt/default.nix
··· 32 ++ lib.optional stdenv.isDarwin xcbuild.xcrun; 33 buildInputs = lib.optional stdenv.hostPlatform.isDarwin libcxxabi; 34 35 - env.NIX_CFLAGS_COMPILE = toString [ 36 "-DSCUDO_DEFAULT_OPTIONS=DeleteSizeMismatch=0:DeallocationTypeMismatch=0" 37 - ]; 38 39 cmakeFlags = [ 40 "-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON" ··· 102 '' + lib.optionalString stdenv.isDarwin '' 103 substituteInPlace cmake/config-ix.cmake \ 104 --replace 'set(COMPILER_RT_HAS_TSAN TRUE)' 'set(COMPILER_RT_HAS_TSAN FALSE)' 105 - '' + lib.optionalString (useLLVM) '' 106 substituteInPlace lib/builtins/int_util.c \ 107 --replace "#include <stdlib.h>" "" 108 substituteInPlace lib/builtins/clear_cache.c \ ··· 117 '' + lib.optionalString (useLLVM) '' 118 ln -s $out/lib/*/clang_rt.crtbegin-*.o $out/lib/crtbegin.o 119 ln -s $out/lib/*/clang_rt.crtend-*.o $out/lib/crtend.o 120 ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/crtbeginS.o 121 ln -s $out/lib/*/clang_rt.crtend_shared-*.o $out/lib/crtendS.o 122 '' + lib.optionalString doFakeLibgcc ''
··· 32 ++ lib.optional stdenv.isDarwin xcbuild.xcrun; 33 buildInputs = lib.optional stdenv.hostPlatform.isDarwin libcxxabi; 34 35 + env.NIX_CFLAGS_COMPILE = toString ([ 36 "-DSCUDO_DEFAULT_OPTIONS=DeleteSizeMismatch=0:DeallocationTypeMismatch=0" 37 + ] ++ lib.optionals (!haveLibc) [ 38 + # The compiler got stricter about this, and there is a usellvm patch below 39 + # which patches out the assert include causing an implicit definition of 40 + # assert. It would be nicer to understand why compiler-rt thinks it should 41 + # be able to #include <assert.h> in the first place; perhaps it's in the 42 + # wrong, or perhaps there is a way to provide an assert.h. 43 + "-Wno-error=implicit-function-declaration" 44 + ]); 45 46 cmakeFlags = [ 47 "-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON" ··· 109 '' + lib.optionalString stdenv.isDarwin '' 110 substituteInPlace cmake/config-ix.cmake \ 111 --replace 'set(COMPILER_RT_HAS_TSAN TRUE)' 'set(COMPILER_RT_HAS_TSAN FALSE)' 112 + '' + lib.optionalString (useLLVM && !haveLibc) '' 113 substituteInPlace lib/builtins/int_util.c \ 114 --replace "#include <stdlib.h>" "" 115 substituteInPlace lib/builtins/clear_cache.c \ ··· 124 '' + lib.optionalString (useLLVM) '' 125 ln -s $out/lib/*/clang_rt.crtbegin-*.o $out/lib/crtbegin.o 126 ln -s $out/lib/*/clang_rt.crtend-*.o $out/lib/crtend.o 127 + # Note the history of crt{begin,end}S in previous versions of llvm in nixpkg: 128 + # The presence of crtbegin_shared has been added and removed; it's possible 129 + # people have added/removed it to get it working on their platforms. 130 + # Try each in turn for now. 131 + ln -s $out/lib/*/clang_rt.crtbegin-*.o $out/lib/crtbeginS.o 132 + ln -s $out/lib/*/clang_rt.crtend-*.o $out/lib/crtendS.o 133 ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/crtbeginS.o 134 ln -s $out/lib/*/clang_rt.crtend_shared-*.o $out/lib/crtendS.o 135 '' + lib.optionalString doFakeLibgcc ''
+8
pkgs/development/compilers/llvm/16/default.nix
··· 254 [ "-rtlib=compiler-rt" 255 "-Wno-unused-command-line-argument" 256 "-B${targetLlvmLibraries.compiler-rt}/lib" 257 ] 258 ++ lib.optional (!stdenv.targetPlatform.isWasm) "--unwindlib=libunwind" 259 ++ lib.optional
··· 254 [ "-rtlib=compiler-rt" 255 "-Wno-unused-command-line-argument" 256 "-B${targetLlvmLibraries.compiler-rt}/lib" 257 + 258 + # Combat "__cxxabi_config.h not found". Maybe this could be fixed by 259 + # copying these headers into libcxx? Note that building libcxx 260 + # outside of monorepo isn't supported anymore, might be related to 261 + # https://github.com/llvm/llvm-project/issues/55632 262 + # ("16.0.3 libcxx, libcxxabi: circular build dependencies") 263 + # Looks like the machinery changed in https://reviews.llvm.org/D120727. 264 + "-I${lib.getDev targetLlvmLibraries.libcxx.cxxabi}/include/c++/v1" 265 ] 266 ++ lib.optional (!stdenv.targetPlatform.isWasm) "--unwindlib=libunwind" 267 ++ lib.optional
+13 -6
pkgs/development/compilers/llvm/16/libcxx/default.nix
··· 2 , monorepoSrc, runCommand 3 , cmake, ninja, python3, fixDarwinDylibNames, version 4 , cxxabi ? if stdenv.hostPlatform.isFreeBSD then libcxxrt else libcxxabi 5 - , libcxxabi, libcxxrt 6 , enableShared ? !stdenv.hostPlatform.isStatic 7 8 # If headersOnly is true, the resulting package would only include the headers. ··· 47 48 patches = [ 49 ./gnu-install-dirs.patch 50 - ] ++ lib.optionals stdenv.hostPlatform.isMusl [ 51 - ../../libcxx-0001-musl-hacks.patch 52 ]; 53 54 postPatch = '' ··· 62 nativeBuildInputs = [ cmake ninja python3 ] 63 ++ lib.optional stdenv.isDarwin fixDarwinDylibNames; 64 65 - buildInputs = lib.optionals (!headersOnly) [ cxxabi ]; 66 67 cmakeFlags = let 68 # See: https://libcxx.llvm.org/BuildingLibcxx.html#cmdoption-arg-libcxx-cxx-abi-string ··· 75 "-DLIBCXX_CXX_ABI=${if headersOnly then "none" else libcxx_cxx_abi_opt}" 76 ] ++ lib.optional (!headersOnly && cxxabi.libName == "c++abi") "-DLIBCXX_CXX_ABI_INCLUDE_PATHS=${cxxabi.dev}/include/c++/v1" 77 ++ lib.optional (stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isWasi) "-DLIBCXX_HAS_MUSL_LIBC=1" 78 - ++ lib.optional (stdenv.hostPlatform.useLLVM or false) "-DLIBCXX_USE_COMPILER_RT=ON" 79 - ++ lib.optionals stdenv.hostPlatform.isWasm [ 80 "-DLIBCXX_ENABLE_THREADS=OFF" 81 "-DLIBCXX_ENABLE_FILESYSTEM=OFF" 82 "-DLIBCXX_ENABLE_EXCEPTIONS=OFF"
··· 2 , monorepoSrc, runCommand 3 , cmake, ninja, python3, fixDarwinDylibNames, version 4 , cxxabi ? if stdenv.hostPlatform.isFreeBSD then libcxxrt else libcxxabi 5 + , libcxxabi, libcxxrt, libunwind 6 , enableShared ? !stdenv.hostPlatform.isStatic 7 8 # If headersOnly is true, the resulting package would only include the headers. ··· 47 48 patches = [ 49 ./gnu-install-dirs.patch 50 ]; 51 52 postPatch = '' ··· 60 nativeBuildInputs = [ cmake ninja python3 ] 61 ++ lib.optional stdenv.isDarwin fixDarwinDylibNames; 62 63 + buildInputs = 64 + lib.optionals (!headersOnly) [ cxxabi ] 65 + ++ lib.optionals (stdenv.hostPlatform.useLLVM or false) [ libunwind ]; 66 67 cmakeFlags = let 68 # See: https://libcxx.llvm.org/BuildingLibcxx.html#cmdoption-arg-libcxx-cxx-abi-string ··· 75 "-DLIBCXX_CXX_ABI=${if headersOnly then "none" else libcxx_cxx_abi_opt}" 76 ] ++ lib.optional (!headersOnly && cxxabi.libName == "c++abi") "-DLIBCXX_CXX_ABI_INCLUDE_PATHS=${cxxabi.dev}/include/c++/v1" 77 ++ lib.optional (stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isWasi) "-DLIBCXX_HAS_MUSL_LIBC=1" 78 + ++ lib.optionals (stdenv.hostPlatform.useLLVM or false) [ 79 + "-DLIBCXX_USE_COMPILER_RT=ON" 80 + # There's precedent for this in llvm-project/libcxx/cmake/caches. 81 + # In a monorepo build you might do the following in the libcxxabi build: 82 + # -DLLVM_ENABLE_PROJECTS=libcxxabi;libunwinder 83 + # -DLIBCXXABI_STATICALLY_LINK_UNWINDER_IN_STATIC_LIBRARY=On 84 + # libcxx appears to require unwind and doesn't pull it in via other means. 85 + "-DLIBCXX_ADDITIONAL_LIBRARIES=unwind" 86 + ] ++ lib.optionals stdenv.hostPlatform.isWasm [ 87 "-DLIBCXX_ENABLE_THREADS=OFF" 88 "-DLIBCXX_ENABLE_FILESYSTEM=OFF" 89 "-DLIBCXX_ENABLE_EXCEPTIONS=OFF"
+7
pkgs/development/compilers/llvm/16/libcxxabi/default.nix
··· 68 ] ++ lib.optionals (stdenv.hostPlatform.useLLVM or false) [ 69 "-DLLVM_ENABLE_LIBCXX=ON" 70 "-DLIBCXXABI_USE_LLVM_UNWINDER=ON" 71 ] ++ lib.optionals stdenv.hostPlatform.isWasm [ 72 "-DLIBCXXABI_ENABLE_THREADS=OFF" 73 "-DLIBCXXABI_ENABLE_EXCEPTIONS=OFF"
··· 68 ] ++ lib.optionals (stdenv.hostPlatform.useLLVM or false) [ 69 "-DLLVM_ENABLE_LIBCXX=ON" 70 "-DLIBCXXABI_USE_LLVM_UNWINDER=ON" 71 + ] ++ lib.optionals ((stdenv.hostPlatform.useLLVM or false) || 72 + (stdenv.hostPlatform.isDarwin && enableShared)) [ 73 + # libcxxabi's CMake looks as though it treats -nostdlib++ as implying -nostdlib, 74 + # but that does not appear to be the case for example when building 75 + # pkgsLLVM.libcxxabi (which uses clangNoCompilerRtWithLibc). 76 + "-DCMAKE_EXE_LINKER_FLAGS=-nostdlib" 77 + "-DCMAKE_SHARED_LINKER_FLAGS=-nostdlib" 78 ] ++ lib.optionals stdenv.hostPlatform.isWasm [ 79 "-DLIBCXXABI_ENABLE_THREADS=OFF" 80 "-DLIBCXXABI_ENABLE_EXCEPTIONS=OFF"
+5
pkgs/development/compilers/llvm/16/libunwind/default.nix
··· 40 cd ../runtimes 41 ''; 42 43 outputs = [ "out" "dev" ]; 44 45 nativeBuildInputs = [ cmake ninja python3 ];
··· 40 cd ../runtimes 41 ''; 42 43 + postInstall = lib.optionalString (enableShared && !stdenv.hostPlatform.isDarwin) '' 44 + # libcxxabi wants to link to libunwind_shared.so (?). 45 + ln -s $out/lib/libunwind.so $out/lib/libunwind_shared.so 46 + ''; 47 + 48 outputs = [ "out" "dev" ]; 49 50 nativeBuildInputs = [ cmake ninja python3 ];
+13
pkgs/development/compilers/llvm/git/default.nix
··· 313 # what stdenv we use here, as long as CMake is happy. 314 cxx-headers = callPackage ./libcxx { 315 inherit llvm_meta; 316 headersOnly = true; 317 }; 318
··· 313 # what stdenv we use here, as long as CMake is happy. 314 cxx-headers = callPackage ./libcxx { 315 inherit llvm_meta; 316 + # Note that if we use the regular stdenv here we'll get cycle errors 317 + # when attempting to use this compiler in the stdenv. 318 + # 319 + # The final stdenv pulls `cxx-headers` from the package set where 320 + # hostPlatform *is* the target platform which means that `stdenv` at 321 + # that point attempts to use this toolchain. 322 + # 323 + # So, we use `stdenv_` (the stdenv containing `clang` from this package 324 + # set, defined below) to sidestep this issue. 325 + # 326 + # Because we only use `cxx-headers` in `libcxxabi` (which depends on the 327 + # clang stdenv _anyways_), this is okay. 328 + stdenv = stdenv_; 329 headersOnly = true; 330 }; 331
+17 -4
pkgs/development/compilers/llvm/git/libcxx/default.nix
··· 2 , monorepoSrc, runCommand 3 , cmake, ninja, python3, fixDarwinDylibNames, version 4 , cxxabi ? if stdenv.hostPlatform.isFreeBSD then libcxxrt else libcxxabi 5 - , libcxxabi, libcxxrt 6 , enableShared ? !stdenv.hostPlatform.isStatic 7 8 # If headersOnly is true, the resulting package would only include the headers. ··· 62 nativeBuildInputs = [ cmake ninja python3 ] 63 ++ lib.optional stdenv.isDarwin fixDarwinDylibNames; 64 65 - buildInputs = lib.optionals (!headersOnly) [ cxxabi ]; 66 67 cmakeFlags = let 68 # See: https://libcxx.llvm.org/BuildingLibcxx.html#cmdoption-arg-libcxx-cxx-abi-string ··· 75 "-DLIBCXX_CXX_ABI=${if headersOnly then "none" else libcxx_cxx_abi_opt}" 76 ] ++ lib.optional (!headersOnly && cxxabi.libName == "c++abi") "-DLIBCXX_CXX_ABI_INCLUDE_PATHS=${cxxabi.dev}/include/c++/v1" 77 ++ lib.optional (stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isWasi) "-DLIBCXX_HAS_MUSL_LIBC=1" 78 - ++ lib.optional (stdenv.hostPlatform.useLLVM or false) "-DLIBCXX_USE_COMPILER_RT=ON" 79 - ++ lib.optionals stdenv.hostPlatform.isWasm [ 80 "-DLIBCXX_ENABLE_THREADS=OFF" 81 "-DLIBCXX_ENABLE_FILESYSTEM=OFF" 82 "-DLIBCXX_ENABLE_EXCEPTIONS=OFF"
··· 2 , monorepoSrc, runCommand 3 , cmake, ninja, python3, fixDarwinDylibNames, version 4 , cxxabi ? if stdenv.hostPlatform.isFreeBSD then libcxxrt else libcxxabi 5 + , libcxxabi, libcxxrt, libunwind 6 , enableShared ? !stdenv.hostPlatform.isStatic 7 8 # If headersOnly is true, the resulting package would only include the headers. ··· 62 nativeBuildInputs = [ cmake ninja python3 ] 63 ++ lib.optional stdenv.isDarwin fixDarwinDylibNames; 64 65 + buildInputs = 66 + lib.optionals (!headersOnly) [ cxxabi ] 67 + ++ lib.optionals (stdenv.hostPlatform.useLLVM or false) [ libunwind ]; 68 + 69 70 cmakeFlags = let 71 # See: https://libcxx.llvm.org/BuildingLibcxx.html#cmdoption-arg-libcxx-cxx-abi-string ··· 78 "-DLIBCXX_CXX_ABI=${if headersOnly then "none" else libcxx_cxx_abi_opt}" 79 ] ++ lib.optional (!headersOnly && cxxabi.libName == "c++abi") "-DLIBCXX_CXX_ABI_INCLUDE_PATHS=${cxxabi.dev}/include/c++/v1" 80 ++ lib.optional (stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isWasi) "-DLIBCXX_HAS_MUSL_LIBC=1" 81 + ++ lib.optionals (stdenv.hostPlatform.useLLVM or false) [ 82 + "-DLIBCXX_USE_COMPILER_RT=ON" 83 + # (Backport fix from 16, which has LIBCXX_ADDITIONAL_LIBRARIES, but 15 84 + # does not appear to) 85 + # There's precedent for this in llvm-project/libcxx/cmake/caches. 86 + # In a monorepo build you might do the following in the libcxxabi build: 87 + # -DLLVM_ENABLE_PROJECTS=libcxxabi;libunwinder 88 + # -DLIBCXXABI_STATICALLY_LINK_UNWINDER_IN_STATIC_LIBRARY=On 89 + # libcxx appears to require unwind and doesn't pull it in via other means. 90 + # "-DLIBCXX_ADDITIONAL_LIBRARIES=unwind" 91 + "-DCMAKE_SHARED_LINKER_FLAGS=-lunwind" 92 + ] ++ lib.optionals stdenv.hostPlatform.isWasm [ 93 "-DLIBCXX_ENABLE_THREADS=OFF" 94 "-DLIBCXX_ENABLE_FILESYSTEM=OFF" 95 "-DLIBCXX_ENABLE_EXCEPTIONS=OFF"
+7
pkgs/development/compilers/llvm/git/libcxxabi/default.nix
··· 68 ] ++ lib.optionals (stdenv.hostPlatform.useLLVM or false) [ 69 "-DLLVM_ENABLE_LIBCXX=ON" 70 "-DLIBCXXABI_USE_LLVM_UNWINDER=ON" 71 ] ++ lib.optionals stdenv.hostPlatform.isWasm [ 72 "-DLIBCXXABI_ENABLE_THREADS=OFF" 73 "-DLIBCXXABI_ENABLE_EXCEPTIONS=OFF"
··· 68 ] ++ lib.optionals (stdenv.hostPlatform.useLLVM or false) [ 69 "-DLLVM_ENABLE_LIBCXX=ON" 70 "-DLIBCXXABI_USE_LLVM_UNWINDER=ON" 71 + ] ++ lib.optionals ((stdenv.hostPlatform.useLLVM or false) || 72 + (stdenv.hostPlatform.isDarwin && enableShared)) [ 73 + # libcxxabi's CMake looks as though it treats -nostdlib++ as implying -nostdlib, 74 + # but that does not appear to be the case for example when building 75 + # pkgsLLVM.libcxxabi (which uses clangNoCompilerRtWithLibc). 76 + "-DCMAKE_EXE_LINKER_FLAGS=-nostdlib" 77 + "-DCMAKE_SHARED_LINKER_FLAGS=-nostdlib" 78 ] ++ lib.optionals stdenv.hostPlatform.isWasm [ 79 "-DLIBCXXABI_ENABLE_THREADS=OFF" 80 "-DLIBCXXABI_ENABLE_EXCEPTIONS=OFF"
+5
pkgs/development/compilers/llvm/git/libunwind/default.nix
··· 40 cd ../runtimes 41 ''; 42 43 outputs = [ "out" "dev" ]; 44 45 nativeBuildInputs = [ cmake ninja python3 ];
··· 40 cd ../runtimes 41 ''; 42 43 + postInstall = lib.optionalString (enableShared && !stdenv.hostPlatform.isDarwin) '' 44 + # libcxxabi wants to link to libunwind_shared.so (?). 45 + ln -s $out/lib/libunwind.so $out/lib/libunwind_shared.so 46 + ''; 47 + 48 outputs = [ "out" "dev" ]; 49 50 nativeBuildInputs = [ cmake ninja python3 ];