Merge pull request #35695 from dtzWill/fix/swift-gcc7

swift: add include for <functional> (#35689)
This commit is contained in:
Will Dietz 2018-02-26 21:03:23 -06:00 committed by GitHub
commit 5069ad2c28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -145,7 +145,6 @@ let
url = "https://github.com/apple/swift-llbuild/commit/303a89bc6da606c115560921a452686aa0655f5e.diff"; url = "https://github.com/apple/swift-llbuild/commit/303a89bc6da606c115560921a452686aa0655f5e.diff";
sha256 = "04sw7ym1grzggj1v3xrzr2ljxz8rf9rnn9n5fg1xjbwlrdagkc7m"; sha256 = "04sw7ym1grzggj1v3xrzr2ljxz8rf9rnn9n5fg1xjbwlrdagkc7m";
}; };
in in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "swift-${version_friendly}"; name = "swift-${version_friendly}";
@ -247,6 +246,9 @@ stdenv.mkDerivation rec {
# https://bugs.swift.org/browse/SR-5779 # https://bugs.swift.org/browse/SR-5779
sed -i -e 's|"-latomic"|"-Wl,-rpath,${clang.cc.gcc.lib}/lib" "-L${clang.cc.gcc.lib}/lib" "-latomic"|' swift/cmake/modules/AddSwift.cmake sed -i -e 's|"-latomic"|"-Wl,-rpath,${clang.cc.gcc.lib}/lib" "-L${clang.cc.gcc.lib}/lib" "-latomic"|' swift/cmake/modules/AddSwift.cmake
# https://bugs.swift.org/browse/SR-4838
sed -i -e '30i#include <functional>' lldb/include/lldb/Utility/TaskPool.h
substituteInPlace clang/lib/Driver/ToolChains.cpp \ substituteInPlace clang/lib/Driver/ToolChains.cpp \
--replace ' addPathIfExists(D, SysRoot + "/usr/lib", Paths);' \ --replace ' addPathIfExists(D, SysRoot + "/usr/lib", Paths);' \
' addPathIfExists(D, SysRoot + "/usr/lib", Paths); addPathIfExists(D, "${glibc}/lib", Paths);' ' addPathIfExists(D, SysRoot + "/usr/lib", Paths); addPathIfExists(D, "${glibc}/lib", Paths);'
@ -287,7 +289,7 @@ stdenv.mkDerivation rec {
# TODO: Use wrappers to get these on the PATH for swift tools, instead # TODO: Use wrappers to get these on the PATH for swift tools, instead
ln -s ${clang}/bin/* $out/bin/ ln -s ${clang}/bin/* $out/bin/
ln -s ${targetPackages.stdenv.cc.bintools}/bin/ar $out/bin/ar ln -s ${targetPackages.stdenv.cc.bintools.bintools_bin}/bin/ar $out/bin/ar
wrapProgram $out/bin/swift \ wrapProgram $out/bin/swift \
--suffix C_INCLUDE_PATH : $out/lib/swift/clang/include \ --suffix C_INCLUDE_PATH : $out/lib/swift/clang/include \