Skip to content

Make Wasm link section conditional on compiler version#75

Merged
dtolnay merged 1 commit intomasterfrom
wasm
Dec 20, 2024
Merged

Make Wasm link section conditional on compiler version#75
dtolnay merged 1 commit intomasterfrom
wasm

Conversation

@dtolnay
Copy link
Copy Markdown
Owner

@dtolnay dtolnay commented Dec 20, 2024

In order to avoid triggering a link error where there didn't used to be one. #74 causes rust-lld errors like this in compilers older than nightly-2024-12-19:

error: linking with `wasm-component-ld` failed: exit status: 1
  |
  = note: "wasm-component-ld" "-flavor" "wasm" "--export" "__main_void" "--export" "cabi_realloc" "-z" "stack-size=1048576" "--stack-first" "--allow-undefined" "--no-demangle" {...} "-l" "c" "-L" ".rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-wasip2/lib/self-contained" "-o" "target/wasm32-wasip2/debug/deps/repro-2c59c9d65bdd9014.wasm" "--gc-sections" "-O0"
  = note: rust-lld: error: target/wasm32-wasip2/debug/deps/repro-2c59c9d65bdd9014.am9l6ff8xuqu3stbvow8o8tiz.rcgu.o: invalid data symbol offset: `_ZN5repro1_6__CTOR17h2780dd13c1356084E` (offset: 4 segment size: 1)
          error: failed to invoke LLD: exit status: 1

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