treewide: Get rid of cc.gcc

Instead, we have a new `gccForLibs`, which has the appropriate
definition for e.g. avoiding `x86_32` linking problems.
This commit is contained in:
John Ericson
2020-08-02 17:12:05 +00:00
parent 3541e8b4fb
commit 92f96f47b0
17 changed files with 78 additions and 86 deletions
+4 -3
View File
@@ -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="$(< $NIX_CC/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"