rust-lang / lang-team

Home of the Rust lang team
http://lang-team.rust-lang.org/
Apache License 2.0
202 stars 48 forks source link

Design meeting: resolve ABI issues around target-feature #235

Closed RalfJung closed 10 months ago

RalfJung commented 11 months ago

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

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.

calebzulawski commented 11 months ago

I don't know the intended permissions, but the hackmd isn't publicly visible

RalfJung commented 11 months ago

Sorry for that -- fixed.

RalfJung commented 10 months ago

@traviscross

This question is scheduled for a T-lang design meeting on 2023-12-20

With the rust-lang website down... can you remind us of the time and place of these meetings?

RalfJung commented 10 months ago

I did find the calendar link on this page but I can't view the calendar, it requires logging with a Google account and I don't have one (nor do I want to create one).

Jules-Bertholet commented 10 months ago

1pm - 2pm (Eastern Time - New York) Wed Dec 20, 2023 https://meet.jit.si/ferris-rules Design meeting schedule: https://github.com/orgs/rust-lang/projects/31

traviscross commented 10 months ago

Cross-posting from #116584...

We discussed this question in the T-lang design meeting on 2023-12-20. The consensus was generally in favor of fixing this, and we were interested in seeing more work in this direction. While we considered various ways that this could be fixed, we were supportive of finding the most minimal, simplest way to fix this as the first step, assuming that such an approach proves to be feasible. We'll need to see at least the results of a crater run and further analysis to confirm that feasibility.

We appreciate @RalfJung and all the others who have been investing time to push this forward.

RalfJung commented 2 months ago

We finally have an implementation of this in https://github.com/rust-lang/rust/pull/127731. :)

Would be nice to get some feedback from the team on whether that's a good direction to proceed in.