diff --git a/pkgs/development/compilers/swift/compiler/patches/clang-purity.patch b/pkgs/development/compilers/swift/compiler/patches/clang-purity.patch index deb230a36c5b..dcb7771008d9 100644 --- a/pkgs/development/compilers/swift/compiler/patches/clang-purity.patch +++ b/pkgs/development/compilers/swift/compiler/patches/clang-purity.patch @@ -3,20 +3,15 @@ From: Will Dietz Date: Thu, 18 May 2017 11:56:12 -0500 Subject: [PATCH] "purity" patch for 5.0 ---- - lib/Driver/ToolChains/Gnu.cpp | 7 ------- - 1 file changed, 7 deletions(-) - -diff --git a/lib/Driver/ToolChains/Gnu.cpp b/lib/Driver/ToolChains/Gnu.cpp -index fe3c0191bb..c6a482bece 100644 ---- a/lib/Driver/ToolChains/Gnu.cpp -+++ b/lib/Driver/ToolChains/Gnu.cpp -@@ -487,12 +487,6 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA, - if (!IsStatic) { +--- clang/lib/Driver/ToolChains/Gnu.cpp ++++ clang/lib/Driver/ToolChains/Gnu.cpp +@@ -480,13 +480,6 @@ + } else { if (Args.hasArg(options::OPT_rdynamic)) CmdArgs.push_back("-export-dynamic"); - -- if (!Args.hasArg(options::OPT_shared) && !IsStaticPIE) { +- if (!Args.hasArg(options::OPT_shared) && !IsStaticPIE && +- !Args.hasArg(options::OPT_r)) { - CmdArgs.push_back("-dynamic-linker"); - CmdArgs.push_back(Args.MakeArgString(Twine(D.DyldPrefix) + - ToolChain.getDynamicLinker(Args))); @@ -24,5 +19,3 @@ index fe3c0191bb..c6a482bece 100644 } CmdArgs.push_back("-o"); --- -2.11.0 diff --git a/pkgs/development/compilers/swift/compiler/patches/swift-linux-fix-libc-paths.patch b/pkgs/development/compilers/swift/compiler/patches/swift-linux-fix-libc-paths.patch index 02cdeb368bb7..a2e84a193dd4 100644 --- a/pkgs/development/compilers/swift/compiler/patches/swift-linux-fix-libc-paths.patch +++ b/pkgs/development/compilers/swift/compiler/patches/swift-linux-fix-libc-paths.patch @@ -5,15 +5,15 @@ patch it to also consider `-idirafter` and `-isystem` as added by cc-wrapper. --- a/lib/ClangImporter/ClangIncludePaths.cpp +++ b/lib/ClangImporter/ClangIncludePaths.cpp -@@ -120,6 +120,7 @@ static clang::driver::Driver createClangDriver(const ASTContext &ctx) { +@@ -142,6 +142,7 @@ /// \return a path without dots (`../`, './'). - static llvm::Optional - findFirstIncludeDir(const llvm::opt::InputArgList &args, -+ const llvm::opt::ArgList &DriverArgs, - const ArrayRef expectedFileNames) { + static llvm::Optional findFirstIncludeDir( + const llvm::opt::InputArgList &args, ++ const llvm::opt::ArgList &DriverArgs, + const ArrayRef expectedFileNames, + const llvm::IntrusiveRefCntPtr &vfs) { // C++ stdlib paths are added as `-internal-isystem`. - std::vector includeDirs = -@@ -128,6 +129,14 @@ findFirstIncludeDir(const llvm::opt::InputArgList &args, +@@ -151,6 +152,14 @@ llvm::append_range(includeDirs, args.getAllArgValues( clang::driver::options::OPT_internal_externc_isystem)); @@ -28,21 +28,21 @@ patch it to also consider `-idirafter` and `-isystem` as added by cc-wrapper. for (const auto &includeDir : includeDirs) { Path dir(includeDir); -@@ -193,7 +202,7 @@ getGlibcFileMapping(ASTContext &ctx) { - // Ideally we would check that all of the headers referenced from the +@@ -218,7 +227,7 @@ // modulemap are present. Path glibcDir; -- if (auto dir = findFirstIncludeDir(parsedIncludeArgs, -+ if (auto dir = findFirstIncludeDir(parsedIncludeArgs, clangDriverArgs, - {"inttypes.h", "unistd.h", "stdint.h"})) { + if (auto dir = findFirstIncludeDir( +- parsedIncludeArgs, {"inttypes.h", "unistd.h", "stdint.h"}, vfs)) { ++ parsedIncludeArgs, clangDriverArgs, {"inttypes.h", "unistd.h", "stdint.h"}, vfs)) { glibcDir = dir.value(); } else { -@@ -251,7 +260,7 @@ getLibStdCxxFileMapping(ASTContext &ctx) { + ctx.Diags.diagnose(SourceLoc(), diag::glibc_not_found, triple.str()); +@@ -276,7 +285,7 @@ auto parsedStdlibArgs = parseClangDriverArgs(clangDriver, stdlibArgStrings); Path cxxStdlibDir; - if (auto dir = findFirstIncludeDir(parsedStdlibArgs, + if (auto dir = findFirstIncludeDir(parsedStdlibArgs, clangDriverArgs, - {"cstdlib", "string", "vector"})) { + {"cstdlib", "string", "vector"}, vfs)) { cxxStdlibDir = dir.value(); } else {