From e5ec997164add7b1bc41258fcf2c5cc2ee9fd26f Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Wed, 3 Jan 2024 19:54:04 +0000 Subject: [PATCH] swift: fix build against `gcc-13` Without the change `swift` build fails on bundled `llvm` on `staging-next` as: In file included from /build/src/llvm-project/llvm/lib/Support/Signals.cpp:14: /build/src/llvm-project/llvm/include/llvm/Support/Signals.h:119:24: error: unknown type name 'uintptr_t'; did you mean '__intptr_t'? void CleanupOnSignal(uintptr_t Context); ^~~~~~~~~ __intptr_t THe change pulls in upstream fix. --- pkgs/development/compilers/swift/compiler/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/development/compilers/swift/compiler/default.nix b/pkgs/development/compilers/swift/compiler/default.nix index 30fb18db8fd2..76c2da0a656a 100644 --- a/pkgs/development/compilers/swift/compiler/default.nix +++ b/pkgs/development/compilers/swift/compiler/default.nix @@ -311,6 +311,13 @@ in stdenv.mkDerivation { sha256 = "1rma1al0rbm3s3ql6bnvbcighp74lri1lcrwbyacgdqp80fgw1b6"; }} + # gcc-13 build fixes + patch -p2 -d llvm-project/llvm -i ${fetchpatch { + name = "gcc-13.patch"; + url = "https://github.com/llvm/llvm-project/commit/ff1681ddb303223973653f7f5f3f3435b48a1983.patch"; + hash = "sha256-nkRPWx8gNvYr7mlvEUiOAb1rTrf+skCZjAydJVUHrcI="; + }} + ${lib.optionalString stdenv.isLinux '' substituteInPlace llvm-project/clang/lib/Driver/ToolChains/Linux.cpp \ --replace 'SysRoot + "/lib' '"${glibc}/lib" "' \