From a2a9cc68fe44a4a667dddd01c17b3dcceefb5a5a Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 26 Apr 2018 06:56:37 -0700 Subject: [PATCH] rustc: Disable threads in LLD for wasm Upstream bug reports (rustwasm/wasm-bindgen#119) show that this may be the culprit of odd crashes/hangs. The linker is a tiny fraction of build time anyway right now so let's disable it and figure out how to possibly reenable it later if necessary. --- src/librustc_trans/back/linker.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/librustc_trans/back/linker.rs b/src/librustc_trans/back/linker.rs index e001e809ee5f0..883625a2dd7c9 100644 --- a/src/librustc_trans/back/linker.rs +++ b/src/librustc_trans/back/linker.rs @@ -959,7 +959,11 @@ impl Linker for WasmLd { } fn finalize(&mut self) -> Command { - self.cmd.arg("--threads"); + // There have been reports in the wild (rustwasm/wasm-bindgen#119) of + // using threads causing weird hangs and bugs. Disable it entirely as + // this isn't yet the bottleneck of compilation at all anyway. + self.cmd.arg("--no-threads"); + self.cmd.arg("-z").arg("stack-size=1048576"); // FIXME we probably shouldn't pass this but instead pass an explicit