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

Allow #[linkage] on any statics not just foreign statics. #18890

Merged
merged 4 commits into from
Nov 18, 2014

Conversation

luqmana
Copy link
Member

@luqmana luqmana commented Nov 12, 2014

This is especially useful for declaring a static with external linkage in an executable. There isn't any way to do that currently since we mark everything in an executable as internal by default.

Also, a quick fix to have the no-compiler-rt target option respected when building staticlibs as well.

}
}
}
_ => {}
Copy link
Member

Choose a reason for hiding this comment

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

This allows #[linkage] on any item, right? I suppose it's ok behind a feature gate, but I'm not sure how much sense it makes to put this on a function, but who knows!

@alexcrichton
Copy link
Member

I do think that this shouldn't be the only way to control the linkage of a static, it should be declared as extern if it's publicly visible as well (as we do for libraries). That can be done as part of a later PR anyway though.

Could you add a test for this? Both for the linkage working as well as a test that it's feature gated?

@bors bors merged commit 33893ae into rust-lang:master Nov 18, 2014
@luqmana luqmana deleted the tf branch July 15, 2015 23:55
lnicola pushed a commit to lnicola/rust that referenced this pull request Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants