summary refs log tree commit diff
path: root/pkgs/development/compilers/swift/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/compilers/swift/default.nix')
-rw-r--r--pkgs/development/compilers/swift/default.nix7
1 files changed, 4 insertions, 3 deletions
diff --git a/pkgs/development/compilers/swift/default.nix b/pkgs/development/compilers/swift/default.nix
index 3340d99b6f1..c4144532c58 100644
--- a/pkgs/development/compilers/swift/default.nix
+++ b/pkgs/development/compilers/swift/default.nix
@@ -2,6 +2,7 @@
 , cmake
 , coreutils
 , glibc
+, gccForLibs
 , which
 , perl
 , libedit
@@ -121,7 +122,7 @@ let
   cmakeFlags = [
     "-DGLIBC_INCLUDE_PATH=${stdenv.cc.libc.dev}/include"
     "-DC_INCLUDE_DIRS=${stdenv.lib.makeSearchPathOutput "dev" "include" devInputs}:${libxml2.dev}/include/libxml2"
-    "-DGCC_INSTALL_PREFIX=${clang.cc.gcc}"
+    "-DGCC_INSTALL_PREFIX=${gccForLibs}"
   ];
 
 in
@@ -199,7 +200,7 @@ stdenv.mkDerivation {
     substituteInPlace swift/stdlib/public/Platform/CMakeLists.txt \
       --replace '/usr/include' "${stdenv.cc.libc.dev}/include"
     substituteInPlace swift/utils/build-script-impl \
-      --replace '/usr/include/c++' "${clang.cc.gcc}/include/c++"
+      --replace '/usr/include/c++' "${gccForLibs}/include/c++"
     patch -p1 -d swift -i ${./patches/glibc-arch-headers.patch}
     patch -p1 -d swift -i ${./patches/0001-build-presets-linux-don-t-require-using-Ninja.patch}
     patch -p1 -d swift -i ${./patches/0002-build-presets-linux-allow-custom-install-prefix.patch}
@@ -264,7 +265,7 @@ stdenv.mkDerivation {
     export NIX_CFLAGS_COMPILE="$(< ${clang}/nix-support/libcxx-cxxflags) $NIX_CFLAGS_COMPILE"
     # During the Swift build, a full local LLVM build is performed and the resulting clang is invoked.
     # This compiler is not using the Nix wrappers, so it needs some help to find things.
-    export NIX_LDFLAGS_BEFORE="-rpath ${clang.cc.gcc.lib}/lib -L${clang.cc.gcc.lib}/lib $NIX_LDFLAGS_BEFORE"
+    export NIX_LDFLAGS_BEFORE="-rpath ${gccForLibs.lib}/lib -L${gccForLibs.lib}/lib $NIX_LDFLAGS_BEFORE"
     # However, we want to use the wrapped compiler whenever possible.
     export CC="${clang}/bin/clang"