mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-08 03:46:02 +03:00
Work around LLD 7 segfault in wasm driver on Linux
This commit is contained in:
parent
9529cbed79
commit
aace02ae13
1 changed files with 6 additions and 1 deletions
|
@ -678,7 +678,7 @@ int linkObjToBinaryGcc(llvm::StringRef outputPath,
|
||||||
getFullArgs("lld", argsBuilder.args, global.params.verbose);
|
getFullArgs("lld", argsBuilder.args, global.params.verbose);
|
||||||
|
|
||||||
// CanExitEarly == true means that LLD can and will call `exit()` when errors occur.
|
// CanExitEarly == true means that LLD can and will call `exit()` when errors occur.
|
||||||
const bool CanExitEarly = false;
|
bool CanExitEarly = false;
|
||||||
|
|
||||||
bool success = false;
|
bool success = false;
|
||||||
if (global.params.targetTriple->isOSBinFormatELF()) {
|
if (global.params.targetTriple->isOSBinFormatELF()) {
|
||||||
|
@ -692,6 +692,11 @@ int linkObjToBinaryGcc(llvm::StringRef outputPath,
|
||||||
} else if (global.params.targetTriple->isOSBinFormatCOFF()) {
|
} else if (global.params.targetTriple->isOSBinFormatCOFF()) {
|
||||||
success = lld::mingw::link(fullArgs);
|
success = lld::mingw::link(fullArgs);
|
||||||
} else if (global.params.targetTriple->isOSBinFormatWasm()) {
|
} else if (global.params.targetTriple->isOSBinFormatWasm()) {
|
||||||
|
#if __linux__ && LDC_LLVM_VER >= 700
|
||||||
|
// FIXME: segfault in cleanup (`freeArena()`) after successful linking,
|
||||||
|
// but only on Linux?
|
||||||
|
CanExitEarly = true;
|
||||||
|
#endif
|
||||||
success = lld::wasm::link(fullArgs, CanExitEarly);
|
success = lld::wasm::link(fullArgs, CanExitEarly);
|
||||||
} else {
|
} else {
|
||||||
error(Loc(), "unknown target binary format for internal linking");
|
error(Loc(), "unknown target binary format for internal linking");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue