-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
linker: Reorder linker arguments #85086
Conversation
petrochenkov
commented
May 8, 2021
•
edited
Loading
edited
- Split arguments into order-independent and order-dependent, to define more precisely what (pre-,post-,late-,)link-args mean.
- Add some comments.
r? @estebank (rust-highfive has picked a reviewer for you, use r? to override) |
r? @nagisa |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
728b735
to
416b9b8
Compare
This comment has been minimized.
This comment has been minimized.
8a91aca
to
875f95a
Compare
This should be ready now. |
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.
Implementation looks good to me, broadly speaking. There are some inline nits that I left, but otherwise r=me.
// ---------------------- Object code and libraries, order-dependent ------------------------- | ||
|
||
// Pre-link CRT objects. | ||
add_pre_link_objects(cmd, sess, link_output_kind, crt_objects_fallback); |
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.
AFAICT in the past we did not export_symbols
from the CRT objects nor the sanitizer libraries. Are there bugs that are fixed by this re-ordering? And if so, can they be linked in the commit message, or at least this change called out if there isn't an issue?
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.
Moving export_symbols
to before add_pre_link_objects
doesn't fix any issues, it's just for gathering objects/libraries into one group and options to another.
@@ -1373,11 +1364,6 @@ impl<'a> Linker for PtxLinker<'a> { | |||
self.cmd.arg("-o").arg(path); | |||
} | |||
|
|||
fn finalize(&mut self) { |
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.
Is there context for this removal that is necessary to understand why this argument is no longer necessary?
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.
The necessary part is replaced with fn reset_per_library_state
, other uses are just random order-independent flags which are moved to fn add_order_independent_options
.
This comment has been minimized.
This comment has been minimized.
- Combine all native library arguments together, to simplify potential support for library deduplication and similar things - Split arguments into order-independent and order-dependent, to define more precisely what (pre,post,late)-link-args mean
@bors r=nagisa |
📌 Commit 3eab280 has been approved by |
☀️ Test successful - checks-actions |