Skip to content

Fix wasm_threads example for rustc changes - #1090

Open
kevinmehall wants to merge 1 commit into
trunk-rs:mainfrom
kevinmehall:fix-wasm-threads
Open

Fix wasm_threads example for rustc changes#1090
kevinmehall wants to merge 1 commit into
trunk-rs:mainfrom
kevinmehall:fix-wasm-threads

Conversation

@kevinmehall

Copy link
Copy Markdown

The wasm_threads example currently fails at runtime with:

panicked at wasm_thread-0.3.0/src/wasm32/mod.rs:349:10:
called `Result::unwrap()` on an `Err` value: JsValue(DataCloneError: WebAssembly.Memory object could not be cloned.

This is because last year, rustc stopped setting the necessary linker options based on the atomics target feature and these linker options must now be passed explicitly.

rust-lang/rust#147225

These rustflags come from the rustc PR, with the addition of __heap_base because I was getting an error "failed to find __heap_base for injecting thread id" without it.

The `wasm_threads` example currently fails at runtime with:

```
panicked at wasm_thread-0.3.0/src/wasm32/mod.rs:349:10:
called `Result::unwrap()` on an `Err` value: JsValue(DataCloneError: WebAssembly.Memory object could not be cloned.
```

This is because last year, rustc stopped setting the necessary linker options
based on the atomics target feature and these linker options must now be passed
explicitly.

rust-lang/rust#147225

These rustflags come from the rustc PR, with the addition of `__heap_base`
because I was getting an error `failed to find \`__heap_base\` for injecting
thread id` without it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant