Merge pull request #3887 from tinysun212/pr-autolink-cygwin

[Autolink] Autolinking on COFF for Cygwin/MinGW
This commit is contained in:
Dmitri Gribenko
2016-08-07 12:54:57 -07:00
committed by GitHub
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.