Tracking issue for all the ways in which -C compiler flags can alter the ABI
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
If a -C flag alters the ABI, mixing crates built with different flags causes UB. This issue is gathering all the ways in which this can happen, so that we can figure out what to do with them. The general goal is to make it impossible to alter these flags without realizing that they are "special" and need to be set consistently across all crates. Ideally rustc can even check that they are set consistently, though that will not cover dynamic linking.
-Ctarget-featurescan affect the ABI in a bunch of ways- https://github.com/rust-lang/rust/issues/131300
- might also include
-Ccode-model
- might also include
- https://github.com/rust-lang/rust/issues/129893
-Cllvm-argscan set all sorts of flags, some of which can change the ABI
Flags that are sus:
-Cno-redzonecould potentially be a problem- Probably
-Clink-arg(s)can also do bad shenanigans... but it can't really affect ABI, can it? The ABI is already baked into the object files at this point.
This list might be incomplete!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the linked issues on -Ctarget-features, -Cllvm-args, and the other suspected flags, then review the referenced compiler discussion. Done means identifying the ABI-affecting flags and agreeing how rustc should ensure they are configured consistently, including the stated dynamic-linking limitation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100