Merge #94160: swift: fix cflags for finding C++ headers

Continuing fallout from commit f3f7612.
This commit is contained in:
Vladimír Čunát 2020-08-03 08:59:50 +02:00
commit 460b2b81d4
No known key found for this signature in database
GPG Key ID: E747DF1F9575A3AA

View File

@ -260,8 +260,8 @@ stdenv.mkDerivation {
'';
buildPhase = ''
# gcc-6.4.0/include/c++/6.4.0/cstdlib:75:15: fatal error: 'stdlib.h' file not found
export NIX_CFLAGS_COMPILE="$(< $NIX_CC/nix-support/libcxx-cxxflags) $NIX_CFLAGS_COMPILE"
# explicitly include C++ headers to prevent errors where stdlib.h is not found from cstdlib
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"