Clang Driver: Use Apple ld64's new @response-file support.
authorJames Y Knight <jyknight@google.com>
Mon, 29 Jun 2020 22:26:53 +0000 (18:26 -0400)
committerJames Y Knight <jyknight@google.com>
Mon, 29 Jun 2020 22:26:53 +0000 (18:26 -0400)
commit381df1653c927efa9dac86c24a9db2b98f270de0
treea73945054af31088a8cebdb030f67912cf40abda
parentbdcd20062933df3d6a3401dfe0a1fb8c2cb8071f
Clang Driver: Use Apple ld64's new @response-file support.

In XCode 12, ld64 got support for @files, in addition to the old
-filelist mechanism. Response files allow passing all command-line
arguments to the linker via a file, rather than just filenames, and is
therefore preferred.

Because of the way response-file support is currently implemented as
part of the Tool class in Clang, this change requires an ugly backdoor
function to access Args. A follow-up commit fixes this, but I've
ordered this change first, for easier backportability.

I've added no tests here, because unfortunately, there don't appear to
be _any_ response-file emission automated tests, and I don't see an
obvious way to add them. I've tested that this change works as
expected locally.

Differential Revision: https://reviews.llvm.org/D82777
clang/include/clang/Driver/ToolChain.h
clang/lib/Driver/ToolChains/Darwin.cpp
clang/lib/Driver/ToolChains/Darwin.h