about summary refs log tree commit diff
path: root/pkgs/development/compilers
diff options
context:
space:
mode:
authorWill Dietz <w@wdtz.org>2018-06-23 12:11:18 -0500
committerWill Dietz <w@wdtz.org>2018-06-23 15:53:45 -0500
commitdb7041a0471924ad17c9bf6308fbfd4eea15209c (patch)
tree57eb4c1d8cdf3cbc1d7b7dee9cb5385296c91fa0 /pkgs/development/compilers
parent0b7cc25d19e910a00d39e45813976692ebf02749 (diff)
downloadnixlib-db7041a0471924ad17c9bf6308fbfd4eea15209c.tar
nixlib-db7041a0471924ad17c9bf6308fbfd4eea15209c.tar.gz
nixlib-db7041a0471924ad17c9bf6308fbfd4eea15209c.tar.bz2
nixlib-db7041a0471924ad17c9bf6308fbfd4eea15209c.tar.lz
nixlib-db7041a0471924ad17c9bf6308fbfd4eea15209c.tar.xz
nixlib-db7041a0471924ad17c9bf6308fbfd4eea15209c.tar.zst
nixlib-db7041a0471924ad17c9bf6308fbfd4eea15209c.zip
libc++{,abi}_38: musl fixes, cmake is nativeBuildInput
Diffstat (limited to 'pkgs/development/compilers')
-rw-r--r--pkgs/development/compilers/llvm/3.8/libc++/default.nix13
-rw-r--r--pkgs/development/compilers/llvm/3.8/libc++abi.nix3
2 files changed, 13 insertions, 3 deletions
diff --git a/pkgs/development/compilers/llvm/3.8/libc++/default.nix b/pkgs/development/compilers/llvm/3.8/libc++/default.nix
index cc3f5545146c..5a0410302f2f 100644
--- a/pkgs/development/compilers/llvm/3.8/libc++/default.nix
+++ b/pkgs/development/compilers/llvm/3.8/libc++/default.nix
@@ -17,15 +17,22 @@ stdenv.mkDerivation rec {
   patches = [
     # glibc 2.26 fix
     ../../3.9/libc++/xlocale-glibc-2.26.patch
-  ] ++ lib.optional stdenv.isDarwin ./darwin.patch;
+  ]
+  ++ lib.optional stdenv.isDarwin ./darwin.patch
+  ++ stdenv.lib.optionals stdenv.hostPlatform.isMusl [
+    ../../libcxx-0001-musl-hacks.patch
+    ../../libcxx-max_align_t.patch
+  ];
+
+  nativeBuildInputs = [ cmake ];
 
-  buildInputs = [ cmake libcxxabi ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
+  buildInputs = [ libcxxabi ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
 
   cmakeFlags = [
     "-DLIBCXX_LIBCXXABI_LIB_PATH=${libcxxabi}/lib"
     "-DLIBCXX_LIBCPPABI_VERSION=2"
     "-DLIBCXX_CXX_ABI=libcxxabi"
-  ];
+  ] ++ stdenv.lib.optional stdenv.hostPlatform.isMusl "-DLIBCXX_HAS_MUSL_LIBC=1";
 
   enableParallelBuilding = true;
 
diff --git a/pkgs/development/compilers/llvm/3.8/libc++abi.nix b/pkgs/development/compilers/llvm/3.8/libc++abi.nix
index 45fb7b5be4f6..8b25681c2dbf 100644
--- a/pkgs/development/compilers/llvm/3.8/libc++abi.nix
+++ b/pkgs/development/compilers/llvm/3.8/libc++abi.nix
@@ -15,6 +15,9 @@ stdenv.mkDerivation {
     export cmakeFlags="-DLLVM_PATH=$PWD/$(ls -d llvm-*) -DLIBCXXABI_LIBCXX_INCLUDES=$PWD/$(ls -d libcxx-*)/include"
   '' + stdenv.lib.optionalString stdenv.isDarwin ''
     export TRIPLE=x86_64-apple-darwin
+  '' + stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
+    patch -p1 -d $(ls -d libcxx-*) -i ${../libcxx-0001-musl-hacks.patch}
+    patch -p1 -d $(ls -d libcxx-*) -i ${../libcxx-max_align_t.patch}
   '';
 
   installPhase = if stdenv.isDarwin