-
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
Add -Z external-clangrt
#121207
Add -Z external-clangrt
#121207
Conversation
rustbot has assigned @michaelwoerister. Use r? to explicitly pick a reviewer |
This looks similar to one of unimplemented parts of |
I certainly don't want to duplicate functionality. If there is a way to do the same thing with a different combination of flags we'd prefer that. |
Here is some documentation on the unstable values for That indeed seems like the preferable way of exposing this knob. (Thanks @petrochenkov, I would have missed that!) @chriswailes, do you want to look into updating the PR accordingly? |
@michaelwoerister Yes, I'll give this a look and see if it covers our use case. |
During the discussion of the alternative PR #121420 it turned out that expressing this via Let's add the @bors r+ rollup |
…michaelwoerister Add `-Z external-clangrt` This adds the unstable `-Z external-clangrt` flag that will prevent rustc from emitting linker paths for the in-tree LLVM sanitizer runtime library.
…iaskrgr Rollup of 12 pull requests Successful merges: - rust-lang#104353 (Add CStr::bytes iterator) - rust-lang#120699 (Document `TRACK_DIAGNOSTIC` calls.) - rust-lang#121207 (Add `-Z external-clangrt`) - rust-lang#122397 (Various cleanups around the const eval query providers) - rust-lang#122416 (Various style improvements to `rustc_lint::levels`) - rust-lang#122422 (compiletest: Allow `only-unix` in test headers) - rust-lang#122424 (fix: typos) - rust-lang#122425 (Increase timeout for new bors bot) - rust-lang#122426 (Fix StableMIR `WrappingRange::is_full` computation) - rust-lang#122430 (Generate link to `Local` in `hir::Let` documentation) - rust-lang#122434 (pattern analysis: rename a few types) - rust-lang#122437 (pattern analysis: remove `MaybeInfiniteInt::JustAfterMax`) r? `@ghost` `@rustbot` modify labels: rollup
f1d594e
to
173cf70
Compare
This adds the unstable `-Z external-sanitizer-runtime` flag that will prevent rustc from emitting linker paths for the in-tree LLVM sanitizer runtime library.
173cf70
to
bf2858a
Compare
I've added the commit that breaks apart the conditional as well as rebased the patch on ToT. |
Need r+ again after push |
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.
Thanks for updating the code, @chriswailes. I think it's not quite right now though.
// both executables and dynamic shared objects. On most other platforms the | ||
// runtimes are currently distributed as static libraries which should be | ||
// linked to executables only. | ||
if matches!(crate_type, CrateType::Rlib | CrateType::Staticlib) { |
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 wonder if this code path can even ever be hit for those crate types since those don't involve a linking step. In any case, the comment about seems fit better for the next condition. Also, is there a reason why Windows is not mentioned anymore?
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 rushed the rebase process and incorrectly resurrected the old version of the comments. Fixed in the new commit.
|
||
if matches!(crate_type, CrateType::Dylib | CrateType::Cdylib | CrateType::ProcMacro) | ||
&& (sess.target.is_like_osx || sess.target.is_like_msvc) | ||
{ |
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.
Hm, isn't this the wrong way around now? That is, if this is some kind of dylib, then we do need to link the runtime on osx- and msvc-like platforms.
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.
Correct. Fixed.
Thanks, @chriswailes! |
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#121207 (Add `-Z external-clangrt`) - rust-lang#122174 (diagnostics: suggest `Clone` bounds when noop `clone()`) - rust-lang#122471 (preserve span when evaluating mir::ConstOperand) - rust-lang#122515 (Pass the correct DefId when suggesting writing the aliased Self type out) - rust-lang#122523 (Ensure RPITITs are created before def-id freezing) - rust-lang#122526 (Docs for `thir::ExprKind::Use` and `thir::ExprKind::Let`) - rust-lang#122527 (Clean up AstConv) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#121207 - chriswailes:z-external-clangrt, r=michaelwoerister Add `-Z external-clangrt` This adds the unstable `-Z external-clangrt` flag that will prevent rustc from emitting linker paths for the in-tree LLVM sanitizer runtime library.
This adds the unstable
-Z external-clangrt
flag that will prevent rustc from emitting linker paths for the in-tree LLVM sanitizer runtime library.