Description
Summary
Target features generally control which instructions codegen may use during the final step of generating assembly, but some of them also affect how arguments and return values are passed across function call boundaries.
This means that in general, code compiled with different target features is not ABI-compatible and cannot be linked with each other.
In particular, since the standard library is shipped in binary form pre-built for the default set of target features, enabling/disabling particular features means that calling standard library methods suddenly causes Undefined Behavior.
That's a soundness bug that we clearly should tackle.
Background reading
Design meeting document: https://hackmd.io/e4bYAMh2RWG2yKZHivmF9Q
- Tracking issue: 32bit x86 targets without SSE2 have unsound floating point behavior rust#114479
- The ABI of float types can be changed by
-Ctarget-feature
rust#116344 - Remove ability to disable some target features rust#116584
About this issue
This issue corresponds to a lang-team design meeting proposal. It corresponds to a possible topic of discussion that may be scheduled for deeper discussion during one of our design meetings.