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

Tracking Issue for bare_link_kind #132061

Open
4 tasks
ChrisDenton opened this issue Oct 23, 2024 · 1 comment
Open
4 tasks

Tracking Issue for bare_link_kind #132061

ChrisDenton opened this issue Oct 23, 2024 · 1 comment
Labels
A-linkage Area: linking into static, shared libraries and binaries C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC O-windows Operating system: Windows S-blocked Status: Blocked on something else such as an RFC or other implementation work. S-waiting-on-team Status: Awaiting decision from the relevant subteam (see the T-<team> label). T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-lang Relevant to the language team, which will review and decide on the PR/issue.

Comments

@ChrisDenton
Copy link
Member

This is spun off from RFC 1717 (rust-lang/rfcs#1717) which is already implemented for #[link(name = "...", kind = "dylib")]
The feature gate for the issue is #![feature(bare_link_kind)].

Summary

rust-lang/rfcs#1717 implemented dllimport semantics for Windows externs (see the RFC for details). That is, it tells codegen to mark an item as being imported from a DLL:

// kind is "dylib" so dllimport applied to BAR and baz
#[link(name="foo", kind="dylib")]
extern {
    static BAR: u32;
    fn baz();
}

This tracking issue is for applying dllimport without knowing the lib name. E.g.:

// the lib is supplied separately
// via a build script, the command line, an external build system or even just a separate extern block.
#[link(kind = "dylib")]
extern {
    static BAR: u32;
    fn baz();
}

Only "dylib" and "static" kinds are allowed to be used without supplying a name.

About tracking issues

Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Discussion comments will get marked as off-topic or deleted.
Repeated discussions on the tracking issue may lead to the tracking issue getting locked.

Steps

Unresolved Questions

Implementation history

@ChrisDenton ChrisDenton added C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC T-lang Relevant to the language team, which will review and decide on the PR/issue. labels Oct 23, 2024
@ChrisDenton
Copy link
Member Author

I'd emphasise that the use of dllimport was already decided in the RFC. This is just for applying them without giving a lib name. Given the limited scope of this I was persuaded that it doesn't need a new RFC but it still needs some form of @rust-lang/lang approval.

@jieyouxu jieyouxu added A-linkage Area: linking into static, shared libraries and binaries T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. O-windows Operating system: Windows labels Oct 23, 2024
@ChrisDenton ChrisDenton added the S-waiting-on-team Status: Awaiting decision from the relevant subteam (see the T-<team> label). label Oct 25, 2024
@ChrisDenton ChrisDenton added the S-blocked Status: Blocked on something else such as an RFC or other implementation work. label Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linkage Area: linking into static, shared libraries and binaries C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC O-windows Operating system: Windows S-blocked Status: Blocked on something else such as an RFC or other implementation work. S-waiting-on-team Status: Awaiting decision from the relevant subteam (see the T-<team> label). T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-lang Relevant to the language team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants