Skip to content

Commit 877fa6b

Browse files
committed
require -Z unstable-options to use the new linker-flavor flag values
only the stable values for `-Clinker-flavor` can be used on stable until we have more feedback on the interface
1 parent 8d80814 commit 877fa6b

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

compiler/rustc_session/src/config.rs

+12-2
Original file line numberDiff line numberDiff line change
@@ -2442,9 +2442,19 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
24422442
);
24432443
}
24442444

2445-
// Until the unstable flag is removed, ensure `-Zgcc-ld=lld` and `-Clinker-flavor=gcc:lld` have
2446-
// a matching linker choice.
24472445
if let Some(LinkerFlavorCli::Gcc { use_ld }) = &cg.linker_flavor {
2446+
// For testing purposes, until we have more feedback about these options: ensure `-Z
2447+
// unstable-options` is enabled when using the `gcc` linker flavor enrichments.
2448+
if !unstable_opts.unstable_options {
2449+
early_error(
2450+
error_format,
2451+
"the `gcc:*` linker flavor is unstable, the `-Z unstable-options` \
2452+
flag must also be passed to use it",
2453+
);
2454+
}
2455+
2456+
// Until the unstable flag is removed, ensure `-Zgcc-ld=lld` and `-Clinker-flavor=gcc:lld`
2457+
// have a matching linker choice.
24482458
if use_ld != "lld" && unstable_opts.gcc_ld == Some(LdImpl::Lld) {
24492459
early_error(
24502460
error_format,

0 commit comments

Comments
 (0)