Only use coresimd when codegen_backend is LLVM
This commit is contained in:
parent
c7c534fa0e
commit
a5330415aa
5 changed files with 31 additions and 7 deletions
|
@ -107,6 +107,13 @@ fn main() {
|
||||||
env::join_paths(&dylib_path).unwrap());
|
env::join_paths(&dylib_path).unwrap());
|
||||||
let mut maybe_crate = None;
|
let mut maybe_crate = None;
|
||||||
|
|
||||||
|
// Don't use metadata only backend for snapshot compiler, because it may be broken
|
||||||
|
if env::var("RUSTC_SHOULD_USE_METADATA_ONLY_BACKEND").is_ok() && stage != "0" {
|
||||||
|
//cmd.arg("-Zcodegen-backend=metadata_only");
|
||||||
|
} else {
|
||||||
|
cmd.arg("--cfg").arg("codegen_backend=\"llvm\"");
|
||||||
|
}
|
||||||
|
|
||||||
// Print backtrace in case of ICE
|
// Print backtrace in case of ICE
|
||||||
if env::var("RUSTC_BACKTRACE_ON_ICE").is_ok() && env::var("RUST_BACKTRACE").is_err() {
|
if env::var("RUSTC_BACKTRACE_ON_ICE").is_ok() && env::var("RUST_BACKTRACE").is_err() {
|
||||||
cmd.env("RUST_BACKTRACE", "1");
|
cmd.env("RUST_BACKTRACE", "1");
|
||||||
|
|
|
@ -747,6 +747,10 @@ impl<'a> Builder<'a> {
|
||||||
stage = compiler.stage;
|
stage = compiler.stage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if self.config.rust_codegen_backends.is_empty() {
|
||||||
|
cargo.env("RUSTC_SHOULD_USE_METADATA_ONLY_BACKEND", "1");
|
||||||
|
}
|
||||||
|
|
||||||
let mut extra_args = env::var(&format!("RUSTFLAGS_STAGE_{}", stage)).unwrap_or_default();
|
let mut extra_args = env::var(&format!("RUSTFLAGS_STAGE_{}", stage)).unwrap_or_default();
|
||||||
if stage != 0 {
|
if stage != 0 {
|
||||||
let s = env::var("RUSTFLAGS_STAGE_NOT_0").unwrap_or_default();
|
let s = env::var("RUSTFLAGS_STAGE_NOT_0").unwrap_or_default();
|
||||||
|
|
|
@ -241,12 +241,13 @@ macro_rules! vector_impl { ($([$f:ident, $($args:tt)*]),*) => { $($f!($($args)*)
|
||||||
#[path = "../stdsimd/coresimd/mod.rs"]
|
#[path = "../stdsimd/coresimd/mod.rs"]
|
||||||
#[allow(missing_docs, missing_debug_implementations, dead_code, unused_imports)]
|
#[allow(missing_docs, missing_debug_implementations, dead_code, unused_imports)]
|
||||||
#[unstable(feature = "stdsimd", issue = "48556")]
|
#[unstable(feature = "stdsimd", issue = "48556")]
|
||||||
#[cfg(not(stage0))] // allow changes to how stdsimd works in stage0
|
// allow changes to how stdsimd works in stage0 and don't use whithout LLVM
|
||||||
|
#[cfg(all(not(stage0), codegen_backend="llvm"))]
|
||||||
mod coresimd;
|
mod coresimd;
|
||||||
|
|
||||||
#[unstable(feature = "stdsimd", issue = "48556")]
|
#[unstable(feature = "stdsimd", issue = "48556")]
|
||||||
#[cfg(not(stage0))]
|
#[cfg(all(not(stage0), codegen_backend="llvm"))]
|
||||||
pub use coresimd::simd;
|
pub use coresimd::simd;
|
||||||
#[stable(feature = "simd_arch", since = "1.27.0")]
|
#[stable(feature = "simd_arch", since = "1.27.0")]
|
||||||
#[cfg(not(stage0))]
|
#[cfg(all(not(stage0), codegen_backend="llvm"))]
|
||||||
pub use coresimd::arch;
|
pub use coresimd::arch;
|
||||||
|
|
|
@ -1418,6 +1418,18 @@ pub fn default_configuration(sess: &Session) -> ast::CrateConfig {
|
||||||
if sess.opts.crate_types.contains(&CrateTypeProcMacro) {
|
if sess.opts.crate_types.contains(&CrateTypeProcMacro) {
|
||||||
ret.insert((Symbol::intern("proc_macro"), None));
|
ret.insert((Symbol::intern("proc_macro"), None));
|
||||||
}
|
}
|
||||||
|
/*if nightly_options::is_nightly_build() {
|
||||||
|
let backend_name = sess.opts
|
||||||
|
.debugging_opts
|
||||||
|
.codegen_backend
|
||||||
|
.as_ref()
|
||||||
|
.map(|s| s as &str)
|
||||||
|
.unwrap_or("llvm");
|
||||||
|
ret.insert((
|
||||||
|
Symbol::intern("codegen_backend"),
|
||||||
|
Some(Symbol::intern(backend_name)),
|
||||||
|
));
|
||||||
|
}*/
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -523,22 +523,22 @@ pub mod rt;
|
||||||
#[path = "../stdsimd/stdsimd/mod.rs"]
|
#[path = "../stdsimd/stdsimd/mod.rs"]
|
||||||
#[allow(missing_debug_implementations, missing_docs, dead_code)]
|
#[allow(missing_debug_implementations, missing_docs, dead_code)]
|
||||||
#[unstable(feature = "stdsimd", issue = "48556")]
|
#[unstable(feature = "stdsimd", issue = "48556")]
|
||||||
#[cfg(all(not(stage0), not(test)))]
|
#[cfg(all(not(stage0), not(test), codegen_backend="llvm"))]
|
||||||
mod stdsimd;
|
mod stdsimd;
|
||||||
|
|
||||||
// A "fake" module needed by the `stdsimd` module to compile, not actually
|
// A "fake" module needed by the `stdsimd` module to compile, not actually
|
||||||
// exported though.
|
// exported though.
|
||||||
#[cfg(not(stage0))]
|
#[cfg(all(not(stage0), codegen_backend="llvm"))]
|
||||||
mod coresimd {
|
mod coresimd {
|
||||||
pub use core::arch;
|
pub use core::arch;
|
||||||
pub use core::simd;
|
pub use core::simd;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[unstable(feature = "stdsimd", issue = "48556")]
|
#[unstable(feature = "stdsimd", issue = "48556")]
|
||||||
#[cfg(all(not(stage0), not(test)))]
|
#[cfg(all(not(stage0), not(test), codegen_backend="llvm"))]
|
||||||
pub use stdsimd::simd;
|
pub use stdsimd::simd;
|
||||||
#[stable(feature = "simd_arch", since = "1.27.0")]
|
#[stable(feature = "simd_arch", since = "1.27.0")]
|
||||||
#[cfg(all(not(stage0), not(test)))]
|
#[cfg(all(not(stage0), not(test), codegen_backend="llvm"))]
|
||||||
pub use stdsimd::arch;
|
pub use stdsimd::arch;
|
||||||
|
|
||||||
// Include a number of private modules that exist solely to provide
|
// Include a number of private modules that exist solely to provide
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue