-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Fix dllimports of static data from rlibs #28646
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
extern crate foo; | ||
|
||
fn main() { | ||
println!("The answer is {} !", foo::FOO); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be a run-pass
instead of a run-make
test? Without any C dependencies it should be fine for inclusion there. You'll need to tag the dependency as // no-prefer-dynamic
as well as #![crate_type = "rlib"]
to ensure it's not built as a DLL, however.
r? |
Am I right, this PR should fix link errors on msvc platforms that look like #28169? |
Hm yeah this should fix issues like that, what version of the compiler are you using? I just downloaded the latest nightly and tested it out and it worked for me, so perhaps a stale download link was used? Or maybe the wrong compiler? |
ah, also nominating for a backport to beta |
I tried the
|
Oh dear, that is indeed bad! Looks like the naming conventions are different for 32-bit than they are for 64. Who knew! I'm working on a patch, thanks for letting us know @alexbool! |
Accepting for backport to beta |
As discussed in the referenced issues, this PR makes rustc emit
__imp_<symbol>
stubs for all public static data to ensure smooth linking in on-windows-msvc
targets.Resolves #26591, cc #27438