-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Handling of stdcall (and other x86-32-specific ABIs) on non-x86-32 Windows targets is inconsistent #137018
Comments
It's just generally more strict. As far as I recall this is intentional, cc @dpaoliello. For example: #[link(name = "library", kind = "raw-dylib")]
extern "cdecl" { // or stdcall
fn test();
} This is rejected on |
I think we should make up our mind: either "stdcall" is a legal ABI string on these targets, or it is not.
|
This comment has been minimized.
This comment has been minimized.
@Aditya-PS-05 currently this issue is about discussing what to do next; there is no agreed-upon plan for what to do yet. Reading the past comments, it seems like ~noone argued in favor of the status quo. So maybe the best next step is to have a FCW lint against
This should probably re-introduce the lint that was removed in #129935.
Either way, raw-dylib shouldn't have its own "does this ABI make sense" logic (currently located here); it should call |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Yes, it was intentional, although I would describe it more as "let's start restrictive and we'll loosen things later" rather than "this is the absolute correct behavior": #86419 (comment)
raw-dylib has its own logic for historical reasons: primarily that it wasn't supported for all calling conventions or all arches for a while, hence its own logic to filter to what it did support. Personally, I'm going to bow out of this discussion. I previously said that having this behavior would cause a proliferation of |
Not sure what exactly you are referring to with "this behavior". Maybe this part of your Zulip message?
For the case of "stdcall on win32, C everywhere else", we have the |
"cdecl" is an ABI that we have supported since pre-1.0, but it is implemented as a complete alias for |
I'm pretty sure the history is
So... I would propose we ask t-lang to approve the intention of completing what was started in #86231. The goal would be:
The status quo is:
If people want the behavior of "stdcall on win32, C everywhere else", they can use @ChrisDenton @workingjubilee any objections to this plan? |
I have no objections. |
Yeah, a few years sounds like a reasonably long timeline to start thinking about the next steps here. I do recall there being some push-back against making |
Do you have a link to that? In the final PR, so far I only saw @petrochenkov also asking for the ABIs to be rejected on other targets. Also note that thiscall is already x86-32-only. I couldn't find a record in our bugtracker of anyone complaining about that. |
I do wish we had a nicer way for users to select ABI based on target that doesn't involve either duplicating a lot of unrelated code or putting the entire extern block in a macro. I think that would have made the decision here a lot easier. |
I seem to recall there was a proposal once for allowing macros in the ABI string position, which would make this slightly less annoying albeit still a bit awkward. |
We generally accept
stdcall
on non-x86-32 Windows targets (while rejecting it on other non-x86-32 targets). See the discussion about this at #86231 (comment) and #86231 (comment). However, @ChrisDenton points out that theraw-dylib
feature is more strict here. That's an inconsistency that we should probably fix?@ChrisDenton can you give an example of what exactly is being rejected by raw-dylib here?
Cc @workingjubilee @rust-lang/lang @nagisa @petrochenkov
The text was updated successfully, but these errors were encountered: