[Autolink] Autolinking on COFF for Cygwin/MinGW

Cygwin and MinGW should use the autolink feature in the sameway of Linux
due to the linker's limit. Now swift-autolink-extract recognizes the
COFF format file for Cygwin/MinGW.
This commit is contained in:
Han Sangjin
2016-08-06 21:45:25 +09:00
parent 2ef0a8fdcb
commit 0747503b0f
9 changed files with 66 additions and 29 deletions

View File

@@ -1316,7 +1316,8 @@ void Driver::buildActions(const ToolChain &TC,
if (OI.shouldLink() && !AllLinkerInputs.empty()) {
auto *LinkAction = new LinkJobAction(AllLinkerInputs, OI.LinkAction);
if (TC.getTriple().getObjectFormat() == llvm::Triple::ELF) {
if (TC.getTriple().getObjectFormat() == llvm::Triple::ELF ||
TC.getTriple().isOSCygMing()) {
// On ELF platforms there's no built in autolinking mechanism, so we
// pull the info we need from the .o files directly and pass them as an
// argument input file to the linker.