@@ -2964,31 +2964,22 @@ fn get_apple_sdk_root(sdk_name: &str) -> Result<String, errors::AppleSdkRootErro
2964
2964
}
2965
2965
}
2966
2966
2967
- /// When using the linker flavors opting in to `lld`, or the unstable `-Zgcc-ld=lld` flag, add the
2968
- /// necessary paths and arguments to invoke it:
2967
+ /// When using the linker flavors opting in to `lld`, add the necessary paths and arguments to
2968
+ /// invoke it:
2969
2969
/// - when the self-contained linker flag is active: the build of `lld` distributed with rustc,
2970
2970
/// - or any `lld` available to `cc`.
2971
2971
fn add_lld_args ( cmd : & mut dyn Linker , sess : & Session , flavor : LinkerFlavor ) {
2972
- let unstable_use_lld = sess. opts . unstable_opts . gcc_ld . is_some ( ) ;
2973
- debug ! ( "add_lld_args requested, flavor: '{flavor:?}', `-Zgcc-ld=lld`: {unstable_use_lld}" ) ;
2974
-
2975
- // Sanity check: using the old unstable `-Zgcc-ld=lld` option requires a `cc`-using flavor.
2976
- let flavor_uses_cc = flavor. uses_cc ( ) ;
2977
- if unstable_use_lld && !flavor_uses_cc {
2978
- sess. emit_fatal ( errors:: OptionGccOnly ) ;
2979
- }
2972
+ debug ! ( "add_lld_args requested, flavor: '{flavor:?}'" ) ;
2980
2973
2981
2974
// If the flavor doesn't use a C/C++ compiler to invoke the linker, or doesn't opt in to `lld`,
2982
2975
// we don't need to do anything.
2983
- let use_lld = flavor. uses_lld ( ) || unstable_use_lld;
2984
- if !flavor_uses_cc || !use_lld {
2976
+ if !( flavor. uses_cc ( ) && flavor. uses_lld ( ) ) {
2985
2977
return ;
2986
2978
}
2987
2979
2988
2980
// 1. Implement the "self-contained" part of this feature by adding rustc distribution
2989
2981
// directories to the tool's search path.
2990
- let self_contained_linker = sess. opts . cg . link_self_contained . linker ( ) || unstable_use_lld;
2991
- if self_contained_linker {
2982
+ if sess. opts . cg . link_self_contained . linker ( ) {
2992
2983
for path in sess. get_tools_search_paths ( false ) {
2993
2984
cmd. arg ( {
2994
2985
let mut arg = OsString :: from ( "-B" ) ;
@@ -3012,13 +3003,13 @@ fn add_lld_args(cmd: &mut dyn Linker, sess: &Session, flavor: LinkerFlavor) {
3012
3003
// shown in issue #101653 and the discussion in PR #101792.
3013
3004
//
3014
3005
// It could be required in some cases of cross-compiling with
3015
- // `-Zgcc-ld=lld` , but this is generally unspecified, and we don't know
3006
+ // LLD , but this is generally unspecified, and we don't know
3016
3007
// which specific versions of clang, macOS SDK, host and target OS
3017
3008
// combinations impact us here.
3018
3009
//
3019
3010
// So we do a simple first-approximation until we know more of what the
3020
3011
// Apple targets require (and which would be handled prior to hitting this
3021
- // `-Zgcc-ld=lld` codepath anyway), but the expectation is that until then
3012
+ // LLD codepath anyway), but the expectation is that until then
3022
3013
// this should be manually passed if needed. We specify the target when
3023
3014
// targeting a different linker flavor on macOS, and that's also always
3024
3015
// the case when targeting WASM.
0 commit comments