diff options
| author | bors <bors@rust-lang.org> | 2023-07-22 02:58:19 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-07-22 02:58:19 +0000 |
| commit | a47f796a36593d352d79ee66d7f4c12d100f5241 (patch) | |
| tree | e5a44e1a9f07e0861e043d5c3ab38333977cf9fc /compiler/rustc_codegen_ssa | |
| parent | aad221e296715661a12715ab327dce058a807686 (diff) | |
| parent | 179768c36af3c7c4cd83354b15f60e5d6f5b72a9 (diff) | |
Auto merge of #113938 - Mark-Simulacrum:beta-backport, r=Mark-Simulacrum
[beta] backport This PR backports: - #113690: allow opaques to be defined by trait queries, again - #113631: make MCP510 behavior opt-in to avoid conflicts between the CLI and target flavors It also includes a bump of bootstrap to the released stable. r? `@Mark-Simulacrum`
Diffstat (limited to 'compiler/rustc_codegen_ssa')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/back/link.rs | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs index c7925be0d7d..b603a878746 100644 --- a/compiler/rustc_codegen_ssa/src/back/link.rs +++ b/compiler/rustc_codegen_ssa/src/back/link.rs @@ -2970,10 +2970,25 @@ fn add_lld_args(cmd: &mut dyn Linker, sess: &Session, flavor: LinkerFlavor) { return; } + let self_contained_linker = sess.opts.cg.link_self_contained.linker(); + + // FIXME: some targets default to using `lld`, but users can only override the linker on the CLI + // and cannot yet select the precise linker flavor to opt out of that. See for example issue + // #113597 for the `thumbv6m-none-eabi` target: a driver is used, and its default linker + // conflicts with the target's flavor, causing unexpected arguments being passed. + // + // Until the new `LinkerFlavor`-like CLI options are stabilized, we only adopt MCP510's behavior + // if its dedicated unstable CLI flags are used, to keep the current sub-optimal stable + // behavior. + let using_mcp510 = + self_contained_linker || sess.opts.cg.linker_flavor.is_some_and(|f| f.is_unstable()); + if !using_mcp510 && !unstable_use_lld { + return; + } + // 1. Implement the "self-contained" part of this feature by adding rustc distribution // directories to the tool's search path. - let self_contained_linker = sess.opts.cg.link_self_contained.linker() || unstable_use_lld; - if self_contained_linker { + if self_contained_linker || unstable_use_lld { for path in sess.get_tools_search_paths(false) { cmd.arg({ let mut arg = OsString::from("-B"); |
