about summary refs log tree commit diff
path: root/pkgs/development/compilers/llvm
diff options
context:
space:
mode:
authorWeijia Wang <9713184+wegank@users.noreply.github.com>2024-02-24 08:45:44 +0100
committerGitHub <noreply@github.com>2024-02-24 08:45:44 +0100
commit1fd991c51ada473f33d8661566a218de773f4e1c (patch)
tree12410a21af135cd14a793815cf205d9f67b01f74 /pkgs/development/compilers/llvm
parentf63ce824cd2f036216eb5f637dfef31e1a03ee89 (diff)
parenta9db778648cf22419ea7b768016c74a4d8b0b69f (diff)
Merge pull request #291045 from wegank/llvm-git-darwin
llvmPackages_git.libcxxabi: unbreak on x86_64-darwin
Diffstat (limited to 'pkgs/development/compilers/llvm')
-rw-r--r--pkgs/development/compilers/llvm/git/libcxx/0001-darwin-10.12-mbstate_t-fix.patch31
-rw-r--r--pkgs/development/compilers/llvm/git/libcxx/default.nix5
-rw-r--r--pkgs/development/compilers/llvm/git/libcxxabi/default.nix3
3 files changed, 36 insertions, 3 deletions
diff --git a/pkgs/development/compilers/llvm/git/libcxx/0001-darwin-10.12-mbstate_t-fix.patch b/pkgs/development/compilers/llvm/git/libcxx/0001-darwin-10.12-mbstate_t-fix.patch
new file mode 100644
index 0000000000000..0a2e8db07391c
--- /dev/null
+++ b/pkgs/development/compilers/llvm/git/libcxx/0001-darwin-10.12-mbstate_t-fix.patch
@@ -0,0 +1,31 @@
+From 9c1cb26c1dd3f92d1c1177e548107d2cd3c5e616 Mon Sep 17 00:00:00 2001
+From: annalee <150648636+a-n-n-a-l-e-e@users.noreply.github.com>
+Date: Fri, 23 Feb 2024 22:58:58 +0000
+Subject: [PATCH] darwin 10.12 mbstate_t fix
+
+https://github.com/llvm/llvm-project/issues/64226
+
+removes space from
+https://github.com/macports/macports-ports/raw/acd8acb171f1658596ed1cf25da48d5b932e2d19/lang/llvm-17/files/0042-mbstate_t-not-defined.patch
+so it applies cleanly
+---
+ include/__mbstate_t.h | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/include/__mbstate_t.h b/include/__mbstate_t.h
+index bfa6d61..5f51112 100644
+--- a/include/__mbstate_t.h
++++ b/include/__mbstate_t.h
+@@ -42,6 +42,9 @@
+ #elif __has_include(<bits/types/mbstate_t.h>)
+ #  include <bits/types/mbstate_t.h> // works on most Unixes
+ #elif __has_include(<sys/_types/_mbstate_t.h>)
++#  if __has_include(<machine/_types.h>)
++#    include <machine/_types.h>
++#  endif
+ #  include <sys/_types/_mbstate_t.h> // works on Darwin
+ #elif !defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS) && __has_include_next(<wchar.h>)
+ #  include_next <wchar.h> // fall back to the C standard provider of mbstate_t
+-- 
+2.43.0
+
diff --git a/pkgs/development/compilers/llvm/git/libcxx/default.nix b/pkgs/development/compilers/llvm/git/libcxx/default.nix
index 9b37a246d9208..11f4c6fe5fd10 100644
--- a/pkgs/development/compilers/llvm/git/libcxx/default.nix
+++ b/pkgs/development/compilers/llvm/git/libcxx/default.nix
@@ -45,6 +45,11 @@ stdenv.mkDerivation rec {
     chmod -R u+w .
   '';
 
+  patches = lib.optionals (stdenv.isDarwin && lib.versionOlder stdenv.hostPlatform.darwinMinVersion "10.13") [
+    # https://github.com/llvm/llvm-project/issues/64226
+    ./0001-darwin-10.12-mbstate_t-fix.patch
+  ];
+
   postPatch = ''
     cd ../runtimes
   '';
diff --git a/pkgs/development/compilers/llvm/git/libcxxabi/default.nix b/pkgs/development/compilers/llvm/git/libcxxabi/default.nix
index f2811fa08bb6d..8e19796543250 100644
--- a/pkgs/development/compilers/llvm/git/libcxxabi/default.nix
+++ b/pkgs/development/compilers/llvm/git/libcxxabi/default.nix
@@ -126,8 +126,5 @@ stdenv.mkDerivation rec {
     # the UIUC License (a BSD-like license)":
     license = with lib.licenses; [ mit ncsa ];
     maintainers = llvm_meta.maintainers ++ [ lib.maintainers.vlstill ];
-    # Broken until https://github.com/llvm/llvm-project/issues/64226 is resolved
-    # We should check if the version is not 10.13 but that is currently broken.
-    broken = stdenv.isDarwin && stdenv.isx86_64;
   };
 }