From b99e2b8b14f4ba50f9eb80bd5a2c1824099a7f96 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Tue, 1 Dec 2020 11:46:15 -0500 Subject: [PATCH] clang/darwin: Use response files with ld64.lld.darwinnew The new MachO lld just grew support for response files in D92149, so let the clang driver use it. Differential Revision: https://reviews.llvm.org/D92399 --- clang/lib/Driver/ToolChains/Darwin.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/clang/lib/Driver/ToolChains/Darwin.cpp b/clang/lib/Driver/ToolChains/Darwin.cpp index db3d57a48098..f1846a573914 100644 --- a/clang/lib/Driver/ToolChains/Darwin.cpp +++ b/clang/lib/Driver/ToolChains/Darwin.cpp @@ -697,8 +697,10 @@ void darwin::Linker::ConstructJob(Compilation &C, const JobAction &JA, } } - ResponseFileSupport ResponseSupport = ResponseFileSupport::AtFileUTF8(); - if (Version[0] < 607) { + ResponseFileSupport ResponseSupport; + if (Version[0] >= 607 || LinkerIsLLDDarwinNew) { + ResponseSupport = ResponseFileSupport::AtFileUTF8(); + } else { // For older versions of the linker, use the legacy filelist method instead. ResponseSupport = {ResponseFileSupport::RF_FileList, llvm::sys::WEM_UTF8, "-filelist"};