-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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: Refactor library linking methods in trait Linker
#120099
Conversation
(rustbot has picked a reviewer for you, use r? to override) |
} else { | ||
self.linker_args(&[OsString::from("--whole-archive"), path.into()]); | ||
self.linker_arg("--whole-archive"); | ||
self.cmd.arg(path); |
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.
why is this not a linker arg?
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.
For consistency with !whole_archive
case above, whether -Wl,
is added doesn't matter in this context.
We could probably consistently add it in all cases though, to save C compiler some work? (Looking into files and determining that they should indeed be passed through to the linker.)
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.
We could probably consistently add it in all cases though, to save C compiler some work
This would be some larger work, so I've just reverted this change for now.
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.
to save C compiler some work? (Looking into files and determining that they should indeed be passed through to the linker.)
Update: gcc doesn't even inspect the passed .o and .a files, it just looks at file extensions.
clang does call fstat on them, but doesn't inspect the contents either.
@bors r+ |
linker: Refactor library linking methods in `trait Linker` Linkers are not aware of Rust libraries, they look like regular static or dynamic libraries to them, so Rust-specific methods in `trait Linker` do not make much sense. They can be either removed or renamed to something more suitable. Commits after the second one are cleanups.
Rollup of 12 pull requests Successful merges: - rust-lang#112806 (Small code improvements in `collect_intra_doc_links.rs`) - rust-lang#119460 (coverage: Never emit improperly-ordered coverage regions) - rust-lang#119766 (Split tait and impl trait in assoc items logic) - rust-lang#120062 (llvm: change data layout bug to an error and make it trigger more) - rust-lang#120099 (linker: Refactor library linking methods in `trait Linker`) - rust-lang#120139 (Do not normalize closure signature when building `FnOnce` shim) - rust-lang#120160 (Manually implement derived `NonZero` traits.) - rust-lang#120171 (Fix assume and assert in jump threading) - rust-lang#120183 (Add `#[coverage(off)]` to closures introduced by `#[test]` and `#[bench]`) - rust-lang#120195 (add several resolution test cases) - rust-lang#120259 (Split Diagnostics for Uncommon Codepoints: Add List to Display Characters Involved) - rust-lang#120261 (Provide structured suggestion to use trait objects in some cases of `if` arm type divergence) r? `@ghost` `@rustbot` modify labels: rollup
Might this have caused #120279 (comment)? |
Hmm, yes, quite likely. |
Rename `link_(dylib,framework)`, remove `link_rust_dylib`.
Rename `link(_whole)(staticlib,rlib)` to something more suitable.
Fixed up the extension. |
linker: Refactor library linking methods in `trait Linker` Linkers are not aware of Rust libraries, they look like regular static or dynamic libraries to them, so Rust-specific methods in `trait Linker` do not make much sense. They can be either removed or renamed to something more suitable. Commits after the second one are cleanups.
Rollup of 8 pull requests Successful merges: - rust-lang#119305 (Add `AsyncFn` family of traits) - rust-lang#119389 (Provide more context on recursive `impl` evaluation overflow) - rust-lang#120062 (llvm: change data layout bug to an error and make it trigger more) - rust-lang#120099 (linker: Refactor library linking methods in `trait Linker`) - rust-lang#120201 (Bump some deps with syn 1.0 dependencies) - rust-lang#120230 (Assert that a single scope is passed to `for_scope`) - rust-lang#120278 (Remove --fatal-warnings on wasm targets) - rust-lang#120292 (coverage: Dismantle `Instrumentor` and flatten span refinement) r? `@ghost` `@rustbot` modify labels: rollup
linker: Refactor library linking methods in `trait Linker` Linkers are not aware of Rust libraries, they look like regular static or dynamic libraries to them, so Rust-specific methods in `trait Linker` do not make much sense. They can be either removed or renamed to something more suitable. Commits after the second one are cleanups.
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#118208 (Rewrite the BTreeMap cursor API using gaps) - rust-lang#120099 (linker: Refactor library linking methods in `trait Linker`) - rust-lang#120165 (Switch `NonZero` alias direction.) - rust-lang#120288 (Bump `askama` version) - rust-lang#120306 (Clean up after clone3 removal from pidfd code (docs and tests)) - rust-lang#120316 (Don't call `walk_` functions directly if there is an equivalent `visit_` method) - rust-lang#120330 (Remove coroutine info when building coroutine drop body) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#118208 (Rewrite the BTreeMap cursor API using gaps) - rust-lang#120099 (linker: Refactor library linking methods in `trait Linker`) - rust-lang#120288 (Bump `askama` version) - rust-lang#120306 (Clean up after clone3 removal from pidfd code (docs and tests)) - rust-lang#120316 (Don't call `walk_` functions directly if there is an equivalent `visit_` method) - rust-lang#120330 (Remove coroutine info when building coroutine drop body) - rust-lang#120332 (Remove unused struct) - rust-lang#120338 (Fix links to [strict|exposed] provenance sections of `[std|core]::ptr`) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#120099 - petrochenkov:linkapi, r=WaffleLapkin linker: Refactor library linking methods in `trait Linker` Linkers are not aware of Rust libraries, they look like regular static or dynamic libraries to them, so Rust-specific methods in `trait Linker` do not make much sense. They can be either removed or renamed to something more suitable. Commits after the second one are cleanups.
Linkers are not aware of Rust libraries, they look like regular static or dynamic libraries to them, so Rust-specific methods in
trait Linker
do not make much sense.They can be either removed or renamed to something more suitable.
Commits after the second one are cleanups.