Skip to content

Commit 8729ba3

Browse files
committed
Remove outdated workaround for -mmacosx-version-min=
This didn't actually activate properly, since cmake-rs calls cc-rs internally, and as such the flag was set anyhow.
1 parent 25e13fd commit 8729ba3

File tree

1 file changed

+8
-40
lines changed
  • src/bootstrap/src/core/build_steps

1 file changed

+8
-40
lines changed

src/bootstrap/src/core/build_steps/llvm.rs

+8-40
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ impl Step for Llvm {
534534
cfg.define("LLVM_VERSION_SUFFIX", suffix);
535535
}
536536

537-
configure_cmake(builder, target, &mut cfg, true, ldflags, &[]);
537+
configure_cmake(builder, target, &mut cfg, true, ldflags);
538538
configure_llvm(builder, target, &mut cfg);
539539

540540
for (key, val) in &builder.config.llvm_build_config {
@@ -623,7 +623,6 @@ fn configure_cmake(
623623
cfg: &mut cmake::Config,
624624
use_compiler_launcher: bool,
625625
mut ldflags: LdFlags,
626-
suppressed_compiler_flag_prefixes: &[&str],
627626
) {
628627
// Do not print installation messages for up-to-date files.
629628
// LLVM and LLD builds can produce a lot of those and hit CI limits on log size.
@@ -757,17 +756,8 @@ fn configure_cmake(
757756
}
758757

759758
cfg.build_arg("-j").build_arg(builder.jobs().to_string());
760-
let mut cflags: OsString = builder
761-
.extra_cflags(target, GitRepo::Llvm, CLang::C)
762-
.into_iter()
763-
.filter(|flag| {
764-
!suppressed_compiler_flag_prefixes
765-
.iter()
766-
.any(|suppressed_prefix| flag.starts_with(suppressed_prefix))
767-
})
768-
.collect::<Vec<String>>()
769-
.join(" ")
770-
.into();
759+
let mut cflags: OsString =
760+
builder.extra_cflags(target, GitRepo::Llvm, CLang::C).join(" ").into();
771761
if let Some(ref s) = builder.config.llvm_cflags {
772762
cflags.push(" ");
773763
cflags.push(s);
@@ -777,17 +767,8 @@ fn configure_cmake(
777767
cflags.push(format!(" --target={target}"));
778768
}
779769
cfg.define("CMAKE_C_FLAGS", cflags);
780-
let mut cxxflags: OsString = builder
781-
.extra_cflags(target, GitRepo::Llvm, CLang::Cxx)
782-
.into_iter()
783-
.filter(|flag| {
784-
!suppressed_compiler_flag_prefixes
785-
.iter()
786-
.any(|suppressed_prefix| flag.starts_with(suppressed_prefix))
787-
})
788-
.collect::<Vec<String>>()
789-
.join(" ")
790-
.into();
770+
let mut cxxflags: OsString =
771+
builder.extra_cflags(target, GitRepo::Llvm, CLang::Cxx).join(" ").into();
791772
if let Some(ref s) = builder.config.llvm_cxxflags {
792773
cxxflags.push(" ");
793774
cxxflags.push(s);
@@ -950,7 +931,7 @@ impl Step for Enzyme {
950931
// FIXME(ZuseZ4): Find a nicer way to use Enzyme Debug builds
951932
//cfg.profile("Debug");
952933
//cfg.define("CMAKE_BUILD_TYPE", "Debug");
953-
configure_cmake(builder, target, &mut cfg, true, LdFlags::default(), &[]);
934+
configure_cmake(builder, target, &mut cfg, true, LdFlags::default());
954935

955936
// Re-use the same flags as llvm to control the level of debug information
956937
// generated for lld.
@@ -1065,7 +1046,7 @@ impl Step for Lld {
10651046
ldflags.push_all("-Wl,-rpath,'$ORIGIN/../../../'");
10661047
}
10671048

1068-
configure_cmake(builder, target, &mut cfg, true, ldflags, &[]);
1049+
configure_cmake(builder, target, &mut cfg, true, ldflags);
10691050
configure_llvm(builder, target, &mut cfg);
10701051

10711052
// Re-use the same flags as llvm to control the level of debug information
@@ -1164,20 +1145,7 @@ impl Step for Sanitizers {
11641145
// Unfortunately sccache currently lacks support to build them successfully.
11651146
// Disable compiler launcher on Darwin targets to avoid potential issues.
11661147
let use_compiler_launcher = !self.target.contains("apple-darwin");
1167-
// Since v1.0.86, the cc crate adds -mmacosx-version-min to the default
1168-
// flags on MacOS. A long-standing bug in the CMake rules for compiler-rt
1169-
// causes architecture detection to be skipped when this flag is present,
1170-
// and compilation fails. https://github.com/llvm/llvm-project/issues/88780
1171-
let suppressed_compiler_flag_prefixes: &[&str] =
1172-
if self.target.contains("apple-darwin") { &["-mmacosx-version-min="] } else { &[] };
1173-
configure_cmake(
1174-
builder,
1175-
self.target,
1176-
&mut cfg,
1177-
use_compiler_launcher,
1178-
LdFlags::default(),
1179-
suppressed_compiler_flag_prefixes,
1180-
);
1148+
configure_cmake(builder, self.target, &mut cfg, use_compiler_launcher, LdFlags::default());
11811149

11821150
t!(fs::create_dir_all(&out_dir));
11831151
cfg.out_dir(out_dir);

0 commit comments

Comments
 (0)