3
0
Fork 0
forked from mirrors/nixpkgs

llvmPackages_12: Fix libunwind, openmp, libcxx, and libcxxabi

All builds succeed now: nix-build -A llvmPackages_12
This commit is contained in:
Michael Weiss 2021-04-01 19:25:58 +02:00
parent 619913c789
commit cc12a82cf2
No known key found for this signature in database
GPG key ID: 5BE487C4D4771D83
5 changed files with 11 additions and 35 deletions

View file

@ -15,14 +15,7 @@ stdenv.mkDerivation {
mv llvm-* llvm
'';
patches = [
(fetchpatch {
# Backported from LLVM 12, avoids clashes with commonly used "block.h" header.
url = "https://github.com/llvm/llvm-project/commit/19bc9ea480b60b607a3e303f20c7a3a2ea553369.patch";
sha256 = "sha256-aWa66ogmPkG0xHzSfcpD0qZyZQcNKwLV44js4eiun78=";
stripLen = 1;
})
] ++ lib.optional stdenv.hostPlatform.isMusl ../../libcxx-0001-musl-hacks.patch;
patches = lib.optional stdenv.hostPlatform.isMusl ../../libcxx-0001-musl-hacks.patch;
preConfigure = lib.optionalString stdenv.hostPlatform.isMusl ''
patchShebangs utils/cat_files.py

View file

@ -1,4 +1,4 @@
{ lib, stdenv, cmake, fetch, libcxx, libunwind, llvm, version
{ lib, stdenv, cmake, python3, fetch, libcxx, libunwind, llvm, version
, enableShared ? !stdenv.hostPlatform.isStatic
}:
@ -8,7 +8,7 @@ stdenv.mkDerivation {
src = fetch "libcxxabi" "1vdc6zld5rlbrbpxf0fxs0m6k1cabpi82ksiwgj1pmhx8l140n0q";
nativeBuildInputs = [ cmake ];
nativeBuildInputs = [ cmake python3 ];
buildInputs = lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD && !stdenv.hostPlatform.isWasm) libunwind;
cmakeFlags = lib.optionals (stdenv.hostPlatform.useLLVM or false) [
@ -21,8 +21,6 @@ stdenv.mkDerivation {
"-DLIBCXXABI_ENABLE_SHARED=OFF"
];
patches = [ ./libcxxabi-no-threads.patch ];
postUnpack = ''
unpackFile ${libcxx.src}
mv libcxx-* libcxx

View file

@ -1,12 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4138acf..41b4763 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -362,6 +362,7 @@ if (NOT LIBCXXABI_ENABLE_THREADS)
" is also set to ON.")
endif()
add_definitions(-D_LIBCXXABI_HAS_NO_THREADS)
+ add_definitions(-D_LIBCPP_HAS_NO_THREADS)
endif()
if (LIBCXXABI_HAS_EXTERNAL_THREAD_API)

View file

@ -1,4 +1,4 @@
{ lib, stdenv, version, fetch, cmake, fetchpatch
{ lib, stdenv, version, fetch, libcxx, llvm, cmake
, enableShared ? !stdenv.hostPlatform.isStatic
}:
@ -8,6 +8,13 @@ stdenv.mkDerivation rec {
src = fetch pname "18n3k2kf6pyvzspnz1i22czbgi14kmch76fxml8kvhky7mw7v1yz";
postUnpack = ''
unpackFile ${libcxx.src}
mv libcxx-* libcxx
unpackFile ${llvm.src}
mv llvm-* llvm
'';
nativeBuildInputs = [ cmake ];
cmakeFlags = lib.optional (!enableShared) "-DLIBUNWIND_ENABLE_SHARED=OFF";

View file

@ -1,7 +1,6 @@
{ lib
, stdenv
, fetch
, fetchpatch
, cmake
, llvm
, perl
@ -14,15 +13,6 @@ stdenv.mkDerivation rec {
src = fetch pname "0kw1g7ndvwi0g7lx5d55mp81h9vffxz820l9r2wjdvvfs3dsyq05";
patches = [
# Fix compilation on aarch64-darwin, remove after the next release.
(fetchpatch {
url = "https://github.com/llvm/llvm-project/commit/7b5254223acbf2ef9cd278070c5a84ab278d7e5f.patch";
sha256 = "sha256-A+9/IVIoazu68FK5H5CiXcOEYe1Hpp4xTx2mIw7m8Es=";
stripLen = 1;
})
];
nativeBuildInputs = [ cmake perl ];
buildInputs = [ llvm ];