From 5b9aa26401f13e9023bcc0e480694462f4cf031f Mon Sep 17 00:00:00 2001 From: Rémy Rakic Date: Wed, 20 Sep 2023 20:25:17 +0000 Subject: implement opt out `-Clink-self-contained=-linker` record both enabled and disabled components so that they can be merged with the ones that the target spec will define --- compiler/rustc_codegen_ssa/src/back/link.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'compiler/rustc_codegen_ssa/src/back') diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs index 464424409c7..28a51711b93 100644 --- a/compiler/rustc_codegen_ssa/src/back/link.rs +++ b/compiler/rustc_codegen_ssa/src/back/link.rs @@ -2978,8 +2978,9 @@ fn add_lld_args(cmd: &mut dyn Linker, sess: &Session, flavor: LinkerFlavor) { } // 1. Implement the "self-contained" part of this feature by adding rustc distribution - // directories to the tool's search path. - if sess.opts.cg.link_self_contained.linker() { + // directories to the tool's search path: + // - if the self-contained linker is enabled on the CLI. + if sess.opts.cg.link_self_contained.is_linker_enabled() { for path in sess.get_tools_search_paths(false) { cmd.arg({ let mut arg = OsString::from("-B"); @@ -2990,7 +2991,7 @@ fn add_lld_args(cmd: &mut dyn Linker, sess: &Session, flavor: LinkerFlavor) { } // 2. Implement the "linker flavor" part of this feature by asking `cc` to use some kind of - // `lld` as the linker. + // `lld` as the linker. cmd.arg("-fuse-ld=lld"); if !flavor.is_gnu() { -- cgit 1.4.1-3-g733a5