Skip to content

Commit

Permalink
Change -Cembed-bitcode=no use to -Cbitcode-in-rlib=no.
Browse files Browse the repository at this point in the history
Because the latter will replace the planned use of the former in rustc.
  • Loading branch information
nnethercote committed Apr 19, 2020
1 parent f044cf9 commit cb48e3a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions src/cargo/core/compiler/build_context/target_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ pub struct TargetInfo {
pub rustflags: Vec<String>,
/// Extra flags to pass to `rustdoc`, see `env_args`.
pub rustdocflags: Vec<String>,
/// REmove this when it hits stable (1.44)
pub supports_embed_bitcode: Option<bool>,
/// Remove this when it hits stable (1.44)
pub supports_bitcode_in_rlib: Option<bool>,
}

/// Kind of each file generated by a Unit, part of `FileType`.
Expand Down Expand Up @@ -105,10 +105,10 @@ impl TargetInfo {
.args(&rustflags)
.env_remove("RUSTC_LOG");

let mut embed_bitcode_test = process.clone();
embed_bitcode_test.arg("-Cembed-bitcode");
let supports_embed_bitcode = match kind {
CompileKind::Host => Some(rustc.cached_output(&embed_bitcode_test).is_ok()),
let mut bitcode_in_rlib_test = process.clone();
bitcode_in_rlib_test.arg("-Cbitcode-in-rlib");
let supports_bitcode_in_rlib = match kind {
CompileKind::Host => Some(rustc.cached_output(&bitcode_in_rlib_test).is_ok()),
_ => None,
};

Expand Down Expand Up @@ -196,7 +196,7 @@ impl TargetInfo {
"RUSTDOCFLAGS",
)?,
cfg,
supports_embed_bitcode,
supports_bitcode_in_rlib,
})
}

Expand Down
4 changes: 2 additions & 2 deletions src/cargo/core/compiler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -821,10 +821,10 @@ fn build_base_args<'a, 'cfg>(
.bcx
.target_data
.info(CompileKind::Host)
.supports_embed_bitcode
.supports_bitcode_in_rlib
.unwrap()
{
cmd.arg("-Cembed-bitcode=no");
cmd.arg("-Cbitcode-in-rlib=no");
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/testsuite/rustc_info_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::env;

#[cargo_test]
fn rustc_info_cache() {
// TODO: need to gate this on nightly as soon as -Cembed-bitcode lands in
// TODO: need to gate this on nightly as soon as -Cbitcode-in-rlib lands in
// nightly
if true {
return;
Expand Down

0 comments on commit cb48e3a

Please sign in to comment.