diff --git a/pkgs/development/compilers/llvm/18/libcxx/0001-darwin-10.12-mbstate_t-fix.patch b/pkgs/development/compilers/llvm/18/libcxx/0001-darwin-10.12-mbstate_t-fix.patch deleted file mode 100644 index 29942f8ed03d..000000000000 --- a/pkgs/development/compilers/llvm/18/libcxx/0001-darwin-10.12-mbstate_t-fix.patch +++ /dev/null @@ -1,31 +0,0 @@ -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 ---- - libcxx/include/__mbstate_t.h | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/libcxx/include/__mbstate_t.h b/libcxx/include/__mbstate_t.h -index bfa6d61..5f51112 100644 ---- a/libcxx/include/__mbstate_t.h -+++ b/libcxx/include/__mbstate_t.h -@@ -42,6 +42,9 @@ - #elif __has_include() - # include // works on most Unixes - #elif __has_include() -+# if __has_include() -+# include -+# endif - # include // works on Darwin - #elif !defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS) && __has_include_next() - # include_next // fall back to the C standard provider of mbstate_t --- -2.43.0 - diff --git a/pkgs/development/compilers/llvm/common/default.nix b/pkgs/development/compilers/llvm/common/default.nix index e7d3a20e1f3f..33e4d3c998dd 100644 --- a/pkgs/development/compilers/llvm/common/default.nix +++ b/pkgs/development/compilers/llvm/common/default.nix @@ -167,12 +167,6 @@ let path = ../15; } ]; - "libcxx/0001-darwin-10.12-mbstate_t-fix.patch" = [ - { - after = "18"; - path = ../18; - } - ]; "libunwind/gnu-install-dirs.patch" = [ { before = "17"; @@ -1083,62 +1077,37 @@ let libcxx = callPackage ./libcxx ( { - patches = - lib.optionals (lib.versionOlder metadata.release_version "16") ( - lib.optional (lib.versions.major metadata.release_version == "15") - # See: - # - https://reviews.llvm.org/D133566 - # - https://github.com/NixOS/nixpkgs/issues/214524#issuecomment-1429146432 - # !!! Drop in LLVM 16+ - ( - fetchpatch { - url = "https://github.com/llvm/llvm-project/commit/57c7bb3ec89565c68f858d316504668f9d214d59.patch"; - hash = "sha256-B07vHmSjy5BhhkGSj3e1E0XmMv5/9+mvC/k70Z29VwY="; - } - ) - ++ [ - (substitute { - src = ./libcxxabi/wasm.patch; - substitutions = [ - "--replace-fail" - "/cmake/" - "/llvm/cmake/" - ]; - }) - ] - ++ lib.optional stdenv.hostPlatform.isMusl (substitute { - src = ./libcxx/libcxx-0001-musl-hacks.patch; + patches = lib.optionals (lib.versionOlder metadata.release_version "16") ( + lib.optional (lib.versions.major metadata.release_version == "15") + # See: + # - https://reviews.llvm.org/D133566 + # - https://github.com/NixOS/nixpkgs/issues/214524#issuecomment-1429146432 + # !!! Drop in LLVM 16+ + ( + fetchpatch { + url = "https://github.com/llvm/llvm-project/commit/57c7bb3ec89565c68f858d316504668f9d214d59.patch"; + hash = "sha256-B07vHmSjy5BhhkGSj3e1E0XmMv5/9+mvC/k70Z29VwY="; + } + ) + ++ [ + (substitute { + src = ./libcxxabi/wasm.patch; substitutions = [ "--replace-fail" - "/include/" - "/libcxx/include/" + "/cmake/" + "/llvm/cmake/" ]; }) - ) - ++ - lib.optional - ( - lib.versions.major metadata.release_version == "17" - && stdenv.hostPlatform.isDarwin - && lib.versionOlder stdenv.hostPlatform.darwinMinVersion "10.13" - ) - # https://github.com/llvm/llvm-project/issues/64226 - ( - fetchpatch { - name = "0042-mbstate_t-not-defined.patch"; - url = "https://github.com/macports/macports-ports/raw/acd8acb171f1658596ed1cf25da48d5b932e2d19/lang/llvm-17/files/0042-mbstate_t-not-defined.patch"; - hash = "sha256-jo+DYA6zuSv9OH3A0bYwY5TlkWprup4OKQ7rfK1WHBI="; - } - ) - ++ - lib.optional - ( - lib.versionAtLeast metadata.release_version "18" - && stdenv.hostPlatform.isDarwin - && lib.versionOlder stdenv.hostPlatform.darwinMinVersion "10.13" - ) - # https://github.com/llvm/llvm-project/issues/64226 - (metadata.getVersionFile "libcxx/0001-darwin-10.12-mbstate_t-fix.patch"); + ] + ++ lib.optional stdenv.hostPlatform.isMusl (substitute { + src = ./libcxx/libcxx-0001-musl-hacks.patch; + substitutions = [ + "--replace-fail" + "/include/" + "/libcxx/include/" + ]; + }) + ); stdenv = if stdenv.hostPlatform.isDarwin then overrideCC darwin.bootstrapStdenv buildLlvmTools.clangWithLibcAndBasicRt