-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rust-lld: error: --shared-memory is disallowed #308
Comments
You must always combine the atomics target feature with the mutable-globals and bulk-memory target features, so |
Using those flags gave me a bunch of errors saying Do you perhaps know why that is? |
Can you link to the full compilation log somewhere? That may make it easier to find the issue. |
Command
ConfigCargo.toml[package]
name = "chapturn-sources-wasm"
version = "0.1.0"
authors = ["Mensch272 <47662901+mensch272@users.noreply.github.com>"]
edition = "2021"
[lib]
crate-type = ["cdylib"]
[features]
default = ["console_error_panic_hook"]
[dependencies]
wasm-bindgen = { version = "0.2.78", features = ["serde-serialize"] }
chapturn-sources = { path = "../chapturn-sources" }
chrono = { version = "0.4.19", features = ["serde", "wasmbind"] }
serde = "1.0.130"
parking_lot = { version = "0.11", features = ["nightly"] }
# The `console_error_panic_hook` crate provides better debugging of panics by
# logging them with `console.error`. This is great for development, but requires
# all the `std::fmt` and `std::panicking` infrastructure, so isn't great for
# code size when deploying.
console_error_panic_hook = { version = "0.1.6", optional = true }
# `wee_alloc` is a tiny allocator for wasm that is only ~1K in code size
# compared to the default allocator's ~10K. It is slower than the default
# allocator, however.
#
# Unfortunately, `wee_alloc` requires nightly Rust when targeting wasm for now.
wee_alloc = { version = "0.4.5", optional = true }
[dev-dependencies]
wasm-bindgen-test = "0.3.13"
[profile.dev]
opt-level = 2
incremental = true
[profile.release]
# Tell `rustc` to optimize for small code size.
opt-level = "s"
lto = true .cargo/config.toml[build]
rustflags = ["-Ctarget-feature=+atomics,+mutable-globals,+bulk-memory"] |
This is the issue:
for some reason it ends up loading two copies of libcore. Could you open an issue on https://github.com/rust-lang/cargo? |
Oh ok, thank you. |
I was able to compile it by following this issue wg-cargo-std-aware#50. |
I'm getting linking errors when trying to compile
parking_lot
to wasm32Build
rustflags = "-Ctarget-feature=+atomics"
version = rustc 1.59.0-nightly (404c8471a 2021-12-14)
The text was updated successfully, but these errors were encountered: