Skip to content

Commit 8edcda4

Browse files
authored
Update threads-xform for current nightly (#2183)
This commit updates the threads transformation for LLVM 10 where LLD has has breaking changes from LLVM 9. While previously the support here attempted to straddle multiple LLVM styles this is now removed in favor of simply supporting LLVM 10's style of output. This means that wasm-bindgen will only be compatible with recent nightlies and forward. The major change here is that the `__wasm_init_memory` function is automatically called by the `start` function. We handle that by placing the previous `start` function first, before stack/tls allocation. Other changes are to delete all the old code from pre-llvm-9. Closes #2175
1 parent 0d39f90 commit 8edcda4

File tree

3 files changed

+71
-304
lines changed

3 files changed

+71
-304
lines changed

azure-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ jobs:
183183
steps:
184184
- template: ci/azure-install-rust.yml
185185
parameters:
186-
toolchain: nightly-2020-01-06
186+
toolchain: nightly-2020-06-03
187187
- script: rustup component add rust-src
188188
displayName: "install rust-src"
189189
- script: |

crates/cli-support/src/lib.rs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -301,23 +301,6 @@ impl Bindgen {
301301
}
302302
};
303303

304-
// This isn't the hardest thing in the world too support but we
305-
// basically don't know how to rationalize #[wasm_bindgen(start)] and
306-
// the actual `start` function if present. Figure this out later if it
307-
// comes up, but otherwise we should continue to be compatible with
308-
// LLVM's output today.
309-
//
310-
// Note that start function handling in `js/mod.rs` will need to be
311-
// updated as well, because `#[wasm_bindgen(start)]` is inserted *after*
312-
// a module's start function, if any, because we assume start functions
313-
// only show up when injected on behalf of wasm-bindgen's passes.
314-
if module.start.is_some() {
315-
bail!(
316-
"wasm-bindgen is currently incompatible with modules that \
317-
already have a start function"
318-
);
319-
}
320-
321304
self.threads
322305
.run(&mut module)
323306
.with_context(|| "failed to prepare module for threading")?;

0 commit comments

Comments
 (0)