Skip to content
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

Add support for raw-dylib with stdcall, fastcall functions #86419

Merged
merged 1 commit into from
Jul 10, 2021

Conversation

ricobbe
Copy link
Contributor

@ricobbe ricobbe commented Jun 18, 2021

Next stage of work for #58713: allow extern "stdcall" and extern "fastcall" with #[link(kind = "raw-dylib")].

I've deliberately omitted support for vectorcall, as that doesn't currently work, and I wanted to get this out for review. (I haven't really investigated the vectorcall failure much yet, but at first (very cursory) glance it appears that the problem is elsewhere.)

@rust-highfive
Copy link
Collaborator

r? @matthewjasper

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 18, 2021
@rust-log-analyzer

This comment has been minimized.

@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 23, 2021
@rust-log-analyzer

This comment has been minimized.

@petrochenkov petrochenkov added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 24, 2021
@petrochenkov
Copy link
Contributor

r? @petrochenkov

@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 29, 2021
@ricobbe
Copy link
Contributor Author

ricobbe commented Jul 7, 2021

@rustbot label -S-waiting-on-author +S-waiting-on-review

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 7, 2021
@petrochenkov
Copy link
Contributor

@ricobbe
Could you squash commits after addressing the remaining comments?

@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 7, 2021
@ricobbe
Copy link
Contributor Author

ricobbe commented Jul 7, 2021

Could you squash commits after addressing the remaining comments?

Will do, sure. For my own understanding, what is preferred practice on this? Squash at the end before completing the PR, or squash as I go?

@petrochenkov
Copy link
Contributor

@ricobbe

For my own understanding, what is preferred practice on this? Squash at the end before completing the PR, or squash as I go?

Both ways work for me.
The important part is to have a reasonable git history immediately before merging.

@ricobbe ricobbe force-pushed the raw-dylib-stdcall branch from 35c7a3f to acd703e Compare July 8, 2021 23:45
@ricobbe
Copy link
Contributor Author

ricobbe commented Jul 8, 2021

@rustbot label -S-waiting-on-author +S-waiting-on-review

@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jul 8, 2021
@bors bors added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 9, 2021
@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 9, 2021
@ricobbe ricobbe force-pushed the raw-dylib-stdcall branch from 9c9694f to a867dd4 Compare July 9, 2021 19:05
@ricobbe
Copy link
Contributor Author

ricobbe commented Jul 9, 2021

@rustbot label -S-waiting-on-author +S-waiting-on-review

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 9, 2021
@petrochenkov
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Jul 9, 2021

📌 Commit a867dd4 has been approved by petrochenkov

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 9, 2021
@bors
Copy link
Contributor

bors commented Jul 9, 2021

⌛ Testing commit a867dd4 with merge 8d9d4c8...

@bors
Copy link
Contributor

bors commented Jul 10, 2021

☀️ Test successful - checks-actions
Approved by: petrochenkov
Pushing 8d9d4c8 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jul 10, 2021
@bors bors merged commit 8d9d4c8 into rust-lang:master Jul 10, 2021
@rustbot rustbot added this to the 1.55.0 milestone Jul 10, 2021
@joshtriplett
Copy link
Member

This appears to have added a failing test:

8    = note: see issue #58713 <https://github.com/rust-lang/rust/issues/58713> for more information
9 
9 
10 error: multiple definitions of external function `f` from library `foo.dll` have different calling conventions
-   --> $DIR/multiple-definitions.rs:8:5
12    |
12    |
- LL |     fn f(x: i32);
-    |     ^^^^^^^^^^^^^
+ LL |         fn f(x: i32);
15 
16 error: aborting due to previous error; 1 warning emitted
17

@RalfJung
Copy link
Member

This appears to have added a failing test:

How is that even possible...?

@fee1-dead
Copy link
Member

This is weird, both #86922 and #86857 encountered this but they seem unrelated.

#87075 fails again.

@RalfJung
Copy link
Member

Looks like we have different output on different targets?
But bors wouldn't have landed unless the stderr file is correct for all targets...

@RalfJung
Copy link
Member

Is it possible that something depends on hash table ordering here (like the code that determines which of the "multiple definitions" the span is pointing at)?

@ricobbe
Copy link
Contributor Author

ricobbe commented Jul 12, 2021

I'm finding it a bit hard to follow the flurry of communications about this PR that happened over the weekend. What's the current status of this work--is the multiple-definitions test still failing in automation?

Is it possible that something depends on hash table ordering here (like the code that determines which of the "multiple definitions" the span is pointing at)?

An earlier version of this PR did indeed have this problem. I checked in a fix before the PR was merged, but it's possible that there's still some nondeterminism left.

EDIT: I think there is some nondeterminism left; sorry about that. Although I'm sorting the definitions before checking for multiples, I overlooked the fact that the comparison function I'm using doesn't guarantee a specific order in exactly the case that triggers the error. This should be a relatively simple fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants