Issue |
146713
|
Summary |
[wasm-ld] using `--import-memory` cancels out `--page-size=N` options without telling user.
|
Labels |
new issue
|
Assignees |
|
Reporter |
anlavandier
|
The current version of the Webassembly linker `wasm-ld` allows the argument `--page-size=N` with N being either `1` or `65536` since the merging of #128942. For some reason, when also passing the `--import-memory` flag, the `page-size` is completely disregarded without telling the caller. This results in `.wasm` files that try to import a memory with the default page-size even if `--page-size=1` was given.
# How to reproduce
I don't know anything about linkers and discovered that while compiling rust code to wasm bytecode so it's what I'll describe.
Setup :
```bash
rustc -Vv
rustc 1.88.0 (6b00bc388 2025-06-23)
binary: rustc
commit-hash: 6b00bc3880198600130e1cf62b8f8a93494488cc
commit-date: 2025-06-23
host: x86_64-unknown-linux-gnu
release: 1.88.0
LLVM version: 20.1.5
wasm-ld --version
LLD 21.0.0 (https://github.com/llvm/llvm-project.git 1b7cbe1f871ebe572e383a2531257b88168eea1b) # Compiled from source on 2.07.25
```
```
cargo new --lib wasm-ld-bug-test
cd wasm-ld-bug-test
```
add
```toml
[lib]
crate-type=["cdylib", "rlib]
```
to the `Cargo.toml`
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs