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

Rust version of __attribute(used)__ (GCC) or llvm.used (LLVM). #23577

Closed
dpc opened this issue Mar 21, 2015 · 1 comment
Closed

Rust version of __attribute(used)__ (GCC) or llvm.used (LLVM). #23577

dpc opened this issue Mar 21, 2015 · 1 comment
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.

Comments

@dpc
Copy link
Contributor

dpc commented Mar 21, 2015

There come times when rust symbols are referenced only by external assembler. It seems rustc is eager to remove them (especially with -C lto, even making them public does not help).

In clang and gcc there are ways to prevent it, correspondingly: __attribute__((used)) and llvm.used`

If there's a way to get the same behavior in Rust? If not, can be added?

@steveklabnik steveklabnik added the A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. label Mar 22, 2015
@steveklabnik
Copy link
Member

We do not currently.

If not, can be added?

It might be able to, but significant additions to Rust go through our RFC process, which is in another repository: https://github.com/rust-lang/rfcs/

If you'd like to pursue adding this feature to Rust, please open an issue up over there. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.
Projects
None yet
Development

No branches or pull requests

2 participants