-
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
#[used(linker)]
attribute
#91504
#[used(linker)]
attribute
#91504
Conversation
Some changes occured to rustc_codegen_gcc cc @antoyo |
(rust-highfive has picked a reviewer for you, use r? to override) |
r? @nikic |
Generally okay with this addition, but I believe this should land under a feature gate first. There's at least a bit of design space here. For example, is Of course this needs some tests, at least a codegen test for cc @nagisa |
@nikic Is there a way to gate |
I've changed the attribute arg to |
This comment has been minimized.
This comment has been minimized.
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.
I've changed the attribute arg to
linker
andcompiler
as suggested by @nikic. Remaining things are tests...
Thanks for the update! Yes, I believe we need one test for the feature gate, and one codegen test that checks llvm.used
/llvm.compiler.used
is emitted in LLVM IR.
Can you please also open a tracking issue for the feature?
This comment has been minimized.
This comment has been minimized.
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.
Looks like src/collect.rs will need a // ignore-tidy-filelength
because you were the lucky person to cross an arbitrary threshold...
@nikic Thanks! I've addressed all your comments. |
This comment has been minimized.
This comment has been minimized.
I've opened a tracking issue and added it here. @bors r+ |
📌 Commit 1705933 has been approved by |
@nikic Ah, that got under my radar. Thanks for opening a tracking issue :) |
`#[used(linker)]` attribute See dtolnay/linkme#41 (comment).
…askrgr Rollup of 6 pull requests Successful merges: - rust-lang#91443 (Better suggestions when user tries to collect into an unsized `[_]`) - rust-lang#91504 (`#[used(linker)]` attribute) - rust-lang#93503 (debuginfo: Fix DW_AT_containing_type vtable debuginfo regression) - rust-lang#93753 (Complete removal of #[main] attribute from compiler) - rust-lang#93799 (Fix typo in `std::fmt` docs) - rust-lang#93813 (Make a few cleanup MIR passes public) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
See dtolnay/linkme#41 (comment).