-
Notifications
You must be signed in to change notification settings - Fork 13.4k
linker: Update some outdated comments #99993
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -187,12 +187,12 @@ pub enum MetadataPosition { | |
Last, | ||
} | ||
|
||
// For rlibs we "pack" rustc metadata into a dummy object file. When rustc | ||
// creates a dylib crate type it will pass `--whole-archive` (or the | ||
// platform equivalent) to include all object files from an rlib into the | ||
// final dylib itself. This causes linkers to iterate and try to include all | ||
// files located in an archive, so if metadata is stored in an archive then | ||
// it needs to be of a form that the linker will be able to process. | ||
// For rlibs we "pack" rustc metadata into a dummy object file. | ||
// | ||
// Historically it was needed because rustc linked rlibs as whole-archive in some cases. | ||
// In that case linkers try to include all files located in an archive, so if metadata is stored | ||
// in an archive then it needs to be of a form that the linker is able to process. | ||
// Now it's not clear whether metadata still needs to be wrapped into an object file or not. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Some comments in source code say that you cannot put a random non-object file into the first position in an archive. I'd like to make a YOLO PR that removes the object file wrapping from metadata, but still puts it on the first place in the archive, and run this PR through various targets available on CI. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I recall correctly on macOS non-object files must be at the end. I believe I recall hitting this requirement early on in the development of cg_clif. |
||
// | ||
// Note, though, that we don't actually want this metadata to show up in any | ||
// final output of the compiler. Instead this is purely for rustc's own | ||
|
Uh oh!
There was an error while loading. Please reload this page.