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

Enable raw-dylib for bin crates #98989

Merged
merged 1 commit into from
Jul 26, 2022
Merged

Conversation

dpaoliello
Copy link
Contributor

Fixes #93842

When raw-dylib is used in a bin crate, we need to collect all of the raw-dylib functions, generate the import library and add that to the linker command line.

I also changed the tests so that 1) the C++ dlls are created after the Rust dlls, thus there is no chance of accidentally using them in the Rust linking process and 2) disabled generating import libraries when building with MSVC.

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jul 6, 2022
@rustbot
Copy link
Collaborator

rustbot commented Jul 6, 2022

Some changes occurred in compiler/rustc_codegen_gcc

cc @antoyo

Some changes occurred in compiler/rustc_codegen_cranelift

cc @bjorn3

@rust-highfive
Copy link
Collaborator

r? @compiler-errors

(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 Jul 6, 2022
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@compiler-errors
Copy link
Member

r? rust-lang/compiler

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@dpaoliello
Copy link
Contributor Author

r? @michaelwoerister

Copy link
Member

@michaelwoerister michaelwoerister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, @dpaoliello! This looks good to me.

I'm asking for some additional documentation below. Other than that, this looks good to go.

compiler/rustc_codegen_ssa/src/back/link.rs Outdated Show resolved Hide resolved
@michaelwoerister
Copy link
Member

Thanks, @dpaoliello!
@bors r+

@bors
Copy link
Contributor

bors commented Jul 22, 2022

📌 Commit 55118aa501bc31e74996aa7dbd62703202091a98 has been approved by michaelwoerister

It is now in the queue for this repository.

@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 22, 2022
@michaelwoerister
Copy link
Member

This PR modifies platform-specific run-make tests, which can be quite iffy in CI, so:
@bors rollup=never

@bors
Copy link
Contributor

bors commented Jul 22, 2022

⌛ Testing commit 55118aa501bc31e74996aa7dbd62703202091a98 with merge ff37062700ca00a222586134fe66202229a67ea1...

@bors
Copy link
Contributor

bors commented Jul 22, 2022

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jul 22, 2022
@rust-log-analyzer

This comment has been minimized.

@michaelwoerister
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Jul 25, 2022

📌 Commit 1f33785 has been approved by michaelwoerister

It is now in the queue for this repository.

@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 25, 2022
@bors
Copy link
Contributor

bors commented Jul 26, 2022

⌛ Testing commit 1f33785 with merge daaae25...

@bors
Copy link
Contributor

bors commented Jul 26, 2022

☀️ Test successful - checks-actions
Approved by: michaelwoerister
Pushing daaae25 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jul 26, 2022
@bors bors merged commit daaae25 into rust-lang:master Jul 26, 2022
@rustbot rustbot added this to the 1.64.0 milestone Jul 26, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (daaae25): comparison url.

Instruction count

  • Primary benchmarks: no relevant changes found
  • Secondary benchmarks: 😿 relevant regression found
mean1 max count2
Regressions 😿
(primary)
N/A N/A 0
Regressions 😿
(secondary)
0.2% 0.2% 1
Improvements 🎉
(primary)
N/A N/A 0
Improvements 🎉
(secondary)
N/A N/A 0
All 😿🎉 (primary) N/A N/A 0

Max RSS (memory usage)

Results
  • Primary benchmarks: 😿 relevant regression found
  • Secondary benchmarks: 😿 relevant regression found
mean1 max count2
Regressions 😿
(primary)
3.2% 3.2% 1
Regressions 😿
(secondary)
9.7% 9.7% 1
Improvements 🎉
(primary)
N/A N/A 0
Improvements 🎉
(secondary)
N/A N/A 0
All 😿🎉 (primary) 3.2% 3.2% 1

Cycles

Results
  • Primary benchmarks: no relevant changes found
  • Secondary benchmarks: mixed results
mean1 max count2
Regressions 😿
(primary)
N/A N/A 0
Regressions 😿
(secondary)
2.6% 3.0% 5
Improvements 🎉
(primary)
N/A N/A 0
Improvements 🎉
(secondary)
-2.1% -2.1% 1
All 😿🎉 (primary) N/A N/A 0

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

@rustbot label: -perf-regression

Footnotes

  1. the arithmetic mean of the percent change 2 3

  2. number of relevant changes 2 3

@dpaoliello dpaoliello deleted the rawdylibbin branch August 15, 2022 17:09
bjorn3 pushed a commit to bjorn3/rust that referenced this pull request Aug 24, 2022
…ister

Enable raw-dylib for bin crates

Fixes rust-lang#93842

When `raw-dylib` is used in a `bin` crate, we need to collect all of the `raw-dylib` functions, generate the import library and add that to the linker command line.

I also changed the tests so that 1) the C++ dlls are created after the Rust dlls, thus there is no chance of accidentally using them in the Rust linking process and 2) disabled generating import libraries when building with MSVC.
matthiaskrgr pushed a commit to matthiaskrgr/rust that referenced this pull request Mar 7, 2023
…ister

Enable raw-dylib for bin crates

Fixes rust-lang#93842

When `raw-dylib` is used in a `bin` crate, we need to collect all of the `raw-dylib` functions, generate the import library and add that to the linker command line.

I also changed the tests so that 1) the C++ dlls are created after the Rust dlls, thus there is no chance of accidentally using them in the Rust linking process and 2) disabled generating import libraries when building with MSVC.
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. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ICE on #[link(..., kind = "raw-dylib")]
9 participants