Stream: git-wasmtime

Topic: wasmtime / issue #10758 cranelift-object: Support marking...


view this post on Zulip Wasmtime GitHub notifications bot (May 09 2025 at 20:19):

bjorn3 opened issue #10758:

Feature

See title.

Benefit

This is required for implementing #[used(linker)] in cg_clif. This attribute is equivalent to attribute((used)) in C. And on all non-ELF platforms it is the default. when #[used] is used. On ELF platforms it may become the default in the future.

Implementation

Add a flag to DataDescription and then set the right symbol flag for the given object file format.

view this post on Zulip Wasmtime GitHub notifications bot (May 22 2025 at 16:17):

alexcrichton added the cranelift label to Issue #10758.

view this post on Zulip Wasmtime GitHub notifications bot (May 29 2025 at 16:36):

Noratrieb commented on issue #10758:

Note that #[used(linker)] is __attribute__((used,retain)), not __attribute__((used)), which is just #[used(compiler)].
| | Compiler | Linker |
|------|-------------------------|-----------------------------------------------------|
| C | __attribute__((used)) | __attribute__((retain)) (note that you need both) |
| Rust | #[used(compiler)] | #[used(linker)] |
| LLVM | @llvm.compiler.used | @llvm.used |
| ELF | - | SHT_GNU_RETAIN ("R" in Assembly) |

view this post on Zulip Wasmtime GitHub notifications bot (May 29 2025 at 18:39):

Noratrieb edited a comment on issue #10758:

Note that #[used(linker)] is __attribute__((used,retain)), not __attribute__((used)), which is just #[used(compiler)].
| | Compiler | Linker |
|------|-------------------------|-----------------------------------------------------|
| GCC C | __attribute__((used)) | __attribute__((retain)) (note that you need both) |
| Rust | #[used(compiler)] | #[used(linker)] |
| LLVM | @llvm.compiler.used | @llvm.used |
| ELF | - | SHT_GNU_RETAIN ("R" in Assembly) |

view this post on Zulip Wasmtime GitHub notifications bot (Jul 09 2025 at 10:32):

bjorn3 commented on issue #10758:

https://github.com/bytecodealliance/wasmtime/pull/11206 implements this on the Cranelift side and https://github.com/rust-lang/rustc_codegen_cranelift/tree/used_static has the cg_clif changes.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 10 2025 at 17:24):

abrown closed issue #10758:

Feature

See title.

Benefit

This is required for implementing #[used(linker)] in cg_clif. This attribute is equivalent to attribute((used)) in C. And on all non-ELF platforms it is the default. when #[used] is used. On ELF platforms it may become the default in the future.

Implementation

Add a flag to DataDescription and then set the right symbol flag for the given object file format.


Last updated: Dec 06 2025 at 07:03 UTC