dioxus icon indicating copy to clipboard operation
dioxus copied to clipboard

Some linker args (atomics & bulk-memory) breaks assets

Open wheregmis opened this issue 2 weeks ago • 2 comments

For any app, just following the instructions for the following crate and modifying the .cargo/config.toml as below will break the assets https://github.com/RReverser/wasm-bindgen-rayon

[target.wasm32-unknown-unknown]
rustflags = [
    "-C",
    "target-feature=+atomics,+bulk-memory",
    "-C",
    "link-arg=--shared-memory",
    "-C",
    "link-arg=--max-memory=1073741824",
    "-C",
    "link-arg=--import-memory",
    "-C",
    "link-arg=--export=__wasm_init_tls",
    "-C",
    "link-arg=--export=__tls_size",
    "-C",
    "link-arg=--export=__tls_align",
    "-C",
    "link-arg=--export=__tls_base",
]

[unstable]
build-std = ["panic_abort", "std"]

repro: https://github.com/wheregmis/rustflags_dioxus

wheregmis avatar Dec 10 '25 00:12 wheregmis

I will try to give an attempt for the fix

wheregmis avatar Dec 10 '25 00:12 wheregmis

couldnt fix it sadly waiting for some pros

wheregmis avatar Dec 10 '25 02:12 wheregmis

I don't think that setup will work with hotpatching enabled, but from your issue this seems to just break asset collection in regular mode? Not sure if we can get fixed memory setups working with hotpatching.

jkelleyrtp avatar Dec 12 '25 01:12 jkelleyrtp

I don't think that setup will work with hotpatching enabled, but from your issue this seems to just break asset collection in regular mode? Not sure if we can get fixed memory setups working with hotpatching.

Yes, in my current scenerio, its breaking assets collection in regular mode. (PS: I wasnt running it with hotpatching, tried with dx bundle to see maybe for release build it works, but that wasnt a success either)

wheregmis avatar Dec 12 '25 14:12 wheregmis