Skip to content

Commit

Permalink
Remove unnecessary -fembed-bitcode usage now that it's deprecated
Browse files Browse the repository at this point in the history
This is a partial revert of 6d819a4
because rust-lang/cc-rs#812 removed this flag
entirely, meaning we shouldn't have to pass this manually anymore
  • Loading branch information
keith committed Nov 17, 2023
1 parent 069a4af commit f490968
Showing 1 changed file with 3 additions and 19 deletions.
22 changes: 3 additions & 19 deletions src/bootstrap/src/core/build_steps/llvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ impl Step for Llvm {
cfg.define("LLVM_VERSION_SUFFIX", suffix);
}

configure_cmake(builder, target, &mut cfg, true, ldflags, &[]);
configure_cmake(builder, target, &mut cfg, true, ldflags);
configure_llvm(builder, target, &mut cfg);

for (key, val) in &builder.config.llvm_build_config {
Expand Down Expand Up @@ -573,7 +573,6 @@ fn configure_cmake(
cfg: &mut cmake::Config,
use_compiler_launcher: bool,
mut ldflags: LdFlags,
extra_compiler_flags: &[&str],
) {
// Do not print installation messages for up-to-date files.
// LLVM and LLD builds can produce a lot of those and hit CI limits on log size.
Expand Down Expand Up @@ -716,9 +715,6 @@ fn configure_cmake(
if builder.config.llvm_clang_cl.is_some() {
cflags.push(&format!(" --target={target}"));
}
for flag in extra_compiler_flags {
cflags.push(&format!(" {flag}"));
}
cfg.define("CMAKE_C_FLAGS", cflags);
let mut cxxflags: OsString = builder.cflags(target, GitRepo::Llvm, CLang::Cxx).join(" ").into();
if let Some(ref s) = builder.config.llvm_cxxflags {
Expand All @@ -728,9 +724,6 @@ fn configure_cmake(
if builder.config.llvm_clang_cl.is_some() {
cxxflags.push(&format!(" --target={target}"));
}
for flag in extra_compiler_flags {
cxxflags.push(&format!(" {flag}"));
}
cfg.define("CMAKE_CXX_FLAGS", cxxflags);
if let Some(ar) = builder.ar(target) {
if ar.is_absolute() {
Expand Down Expand Up @@ -899,7 +892,7 @@ impl Step for Lld {
ldflags.push_all("-Wl,-rpath,'$ORIGIN/../../../'");
}

configure_cmake(builder, target, &mut cfg, true, ldflags, &[]);
configure_cmake(builder, target, &mut cfg, true, ldflags);
configure_llvm(builder, target, &mut cfg);

// Re-use the same flags as llvm to control the level of debug information
Expand Down Expand Up @@ -998,16 +991,7 @@ impl Step for Sanitizers {
// Unfortunately sccache currently lacks support to build them successfully.
// Disable compiler launcher on Darwin targets to avoid potential issues.
let use_compiler_launcher = !self.target.contains("apple-darwin");
let extra_compiler_flags: &[&str] =
if self.target.contains("apple") { &["-fembed-bitcode=off"] } else { &[] };
configure_cmake(
builder,
self.target,
&mut cfg,
use_compiler_launcher,
LdFlags::default(),
extra_compiler_flags,
);
configure_cmake(builder, self.target, &mut cfg, use_compiler_launcher, LdFlags::default());

t!(fs::create_dir_all(&out_dir));
cfg.out_dir(out_dir);
Expand Down

0 comments on commit f490968

Please sign in to comment.