From f3ea8478299b7aa02a546efb46bad05d4a1fd44b Mon Sep 17 00:00:00 2001 From: Sam <30577766+Samasaur1@users.noreply.github.com> Date: Thu, 18 Sep 2025 11:40:55 -0700 Subject: [PATCH] swiftPackages.swift{,-corelibs-libdispatch}: fix build with modern clang We apply this patch to the copy of libdispatch that's copied into Swift and to the standalone build. --- pkgs/development/compilers/swift/compiler/default.nix | 7 +++++++ pkgs/development/compilers/swift/libdispatch/default.nix | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/pkgs/development/compilers/swift/compiler/default.nix b/pkgs/development/compilers/swift/compiler/default.nix index e7b1f84d9941..49aa743d098f 100644 --- a/pkgs/development/compilers/swift/compiler/default.nix +++ b/pkgs/development/compilers/swift/compiler/default.nix @@ -425,6 +425,13 @@ stdenv.mkDerivation { hash = "sha256-wPZQ4wtEWk8HaKMfzjamlU6p/IW5EFiTssY63rGM+ZA="; } } + patch -p1 -d swift-corelibs-libdispatch -i ${ + # Fix the build with modern Clang. + fetchpatch { + url = "https://github.com/swiftlang/swift-corelibs-libdispatch/commit/38872e2d44d66d2fb94186988509defc734888a5.patch"; + hash = "sha256-GABwDeTjciV36Sa0FS10mCfFCqRoBBstgW/OiKdPahA="; + } + } ''} ''; diff --git a/pkgs/development/compilers/swift/libdispatch/default.nix b/pkgs/development/compilers/swift/libdispatch/default.nix index 4b30a1d80673..0779b96e923e 100644 --- a/pkgs/development/compilers/swift/libdispatch/default.nix +++ b/pkgs/development/compilers/swift/libdispatch/default.nix @@ -38,6 +38,10 @@ stdenv.mkDerivation { url = "https://github.com/swiftlang/swift-corelibs-libdispatch/commit/30bb8019ba79cdae0eb1dc0c967c17996dd5cc0a.patch"; hash = "sha256-wPZQ4wtEWk8HaKMfzjamlU6p/IW5EFiTssY63rGM+ZA="; }) + (fetchpatch { + url = "https://github.com/swiftlang/swift-corelibs-libdispatch/commit/38872e2d44d66d2fb94186988509defc734888a5.patch"; + hash = "sha256-GABwDeTjciV36Sa0FS10mCfFCqRoBBstgW/OiKdPahA="; + }) ./disable-swift-overlay.patch ];