-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Implement #[link_ordinal(n)]
#89025
Implement #[link_ordinal(n)]
#89025
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Question for reviewers: in attempting to clean up the error checking for (I refer to cleaning up the error checking because the messages rustc issues in certain circumstances are, at best, misleading: |
@ricobbe I'm just giving my personal views here, am no reviewer in any official capacity, but I think that duplication should be avoided and ideally it should be re-used. I think it should be possible to obtain the attrs with something like Also, IMO the error message doesn't have to be perfect, but of course improvements are always nice. |
@est31 Ok, I've pushed changes that use the info from |
This comment has been minimized.
This comment has been minimized.
2c537c4
to
142f6c0
Compare
@joshtriplett do you have a sense of when you'll be able to take a look at this? |
LGTM from a purely language perspective. Deferring to compiler folks on the implementation strategy. |
@joshtriplett Thanks for the review! I'm happy for the compiler folks to take a look at it, though I will say that this PR is a straightforward extension of the basic import-by-name raw-dylib work from PR #84171. |
r? @michaelwoerister |
I'll take a look tomorrow. |
@michaelwoerister: 🔑 Insufficient privileges: Not in reviewers |
@rust-lang/infra, any idea what that is about? |
Let's give it another try: @bors r+ |
📌 Commit 142f6c0 has been approved by |
…ichaelwoerister Implement `#[link_ordinal(n)]` Allows the use of `#[link_ordinal(n)]` with `#[link(kind = "raw-dylib")]`, allowing Rust to link against DLLs that export symbols by ordinal rather than by name. As long as the ordinal matches, the name of the function in Rust is not required to match the name of the corresponding function in the exporting DLL. Part of rust-lang#58713.
…ichaelwoerister Implement `#[link_ordinal(n)]` Allows the use of `#[link_ordinal(n)]` with `#[link(kind = "raw-dylib")]`, allowing Rust to link against DLLs that export symbols by ordinal rather than by name. As long as the ordinal matches, the name of the function in Rust is not required to match the name of the corresponding function in the exporting DLL. Part of rust-lang#58713.
…ingjubilee Rollup of 8 pull requests Successful merges: - rust-lang#87918 (Enable AutoFDO.) - rust-lang#88137 (On macOS, make strip="symbols" not pass any options to strip) - rust-lang#88772 (Fixed confusing wording on Result::map_or_else.) - rust-lang#89025 (Implement `#[link_ordinal(n)]`) - rust-lang#89082 (Implement rust-lang#85440 (Random test ordering)) - rust-lang#89288 (Wrapper for `-Z gcc-ld=lld` to invoke rust-lld with the correct flavor) - rust-lang#89476 (Correct decoding of foreign expansions during incr. comp.) - rust-lang#89622 (Use correct edition for panic in [debug_]assert!().) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Allows the use of
#[link_ordinal(n)]
with#[link(kind = "raw-dylib")]
, allowing Rust to link against DLLs that export symbols by ordinal rather than by name. As long as the ordinal matches, the name of the function in Rust is not required to match the name of the corresponding function in the exporting DLL.Part of #58713.