From 6692cbbe18ad108affccfb9cb85d53e2583408ec Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Mon, 15 Apr 2019 20:41:50 -0400 Subject: [PATCH] disable threads when linking WebAssembly to work around an LLD bug See #2283 --- src/link.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/link.cpp b/src/link.cpp index 6c6ff07ba..ad4bd7765 100644 --- a/src/link.cpp +++ b/src/link.cpp @@ -1091,6 +1091,11 @@ static void construct_linker_job_wasm(LinkJob *lj) { CodeGen *g = lj->codegen; lj->args.append("-error-limit=0"); + + // This works around a deadlock in LLD's wasm code. + // See https://github.com/ziglang/zig/issues/2283. + lj->args.append("--no-threads"); + if (g->zig_target->os != OsWASI) { lj->args.append("--no-entry"); // So lld doesn't look for _start. }