-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Audit ABI implementations in rustc_target (vs Clang). #65111
Comments
If my memory serves me right, I asked about a formal ABI specification back when this target was being added and there wasn’t one at the time so we ended up with something implementation defined. Implementation of the ABI in Clang is not a formal spec, either, so I don’t see much purpose in changing one implementation-defined ABI to another one. Maybe makes sense for other formally specified ABIs, though. |
Interoperability between the two? |
More data points:
|
Here's one more:
|
|
While looking into #54341 I wrote a tool for actually generating+compiling+running+checking rust<->C ffi interfaces: https://github.com/Gankra/abi-checker It needs some polish and UX work for it to be totally useful in the context of automated tooling/reporting, but I think it's a pretty useful baseline for just objectively verifying whether C and Rust agree on how different concepts get passed across the FFI boundary. I tried to document/comment it a bunch in case anyone finds it useful to extend and iterate on. |
We should probably run @Gankra's tool instead of our own (less comprehensive) tests. cc @rust-lang/compiler Anyway came here to add one more to the pile:
|
I filed a few new issues on abi-checker and made a metabug for what needs to be done to get this up to snuff for y'all. Please feel free to drive-by it with whatever you want, and to file more issues on the repo. This is not my job atm, but if there's enough interest I can maybe make an argument to mozilla to allocate some resources to it. |
Just a little update on abi-checker:
All the major issues I could think of are now at least minimally resolved, and integrating this tool into rustc's CI should be relatively low-effort (see the above link to how rustc_codegen_cranelift did it). |
Possibly one annoyance remaining is that we currently use rustc by literally invoking |
In #63649 (comment) I wrote:
The context there was that our
wasm32
ABI has been wrong since it was added, andwasm-bindgen
now relies on the wrong ABI.I opened this issue so we don't lose track of this, because I'm sure I will.
The text was updated successfully, but these errors were encountered: