Fix build with LLVM trunk. (#2767)

This commit is contained in:
Johan Engelen 2018-07-09 20:09:44 +02:00 committed by Martin Kinkelin
parent 653270df53
commit 0c8c0e6a18
5 changed files with 48 additions and 7 deletions

View file

@ -658,11 +658,18 @@ int linkObjToBinaryGcc(llvm::StringRef outputPath,
const auto fullArgs =
getFullArgs("ld.lld", argsBuilder.args, global.params.verbose);
// CanExitEarly == true means that LLD can and will call `exit()` when errors occur.
const bool CanExitEarly = false;
bool success = false;
if (global.params.targetTriple->isOSBinFormatELF()) {
success = lld::elf::link(fullArgs, /*CanExitEarly*/ false);
success = lld::elf::link(fullArgs, CanExitEarly);
} else if (global.params.targetTriple->isOSBinFormatMachO()) {
#if LDC_LLVM_VER >= 700
success = lld::mach_o::link(fullArgs, CanExitEarly);
#else
success = lld::mach_o::link(fullArgs);
#endif
} else {
error(Loc(), "unknown target binary format for internal linking");
}