Utilize cfg(bootstrap) over cfg(stage0)
Also removes stage1, stage2 cfgs being passed to rustc to ensure that stage1 and stage2 are only differentiated as a group (i.e., only through not bootstrap).
This commit is contained in:
@@ -89,12 +89,16 @@ fn main() {
|
|||||||
|
|
||||||
let mut cmd = Command::new(rustc);
|
let mut cmd = Command::new(rustc);
|
||||||
cmd.args(&args)
|
cmd.args(&args)
|
||||||
.arg("--cfg")
|
|
||||||
.arg(format!("stage{}", stage))
|
|
||||||
.env(bootstrap::util::dylib_path_var(),
|
.env(bootstrap::util::dylib_path_var(),
|
||||||
env::join_paths(&dylib_path).unwrap());
|
env::join_paths(&dylib_path).unwrap());
|
||||||
let mut maybe_crate = None;
|
let mut maybe_crate = None;
|
||||||
|
|
||||||
|
// Non-zero stages must all be treated uniformly to avoid problems when attempting to uplift
|
||||||
|
// compiler libraries and such from stage 1 to 2.
|
||||||
|
if stage == "0" {
|
||||||
|
cmd.arg("--cfg").arg("bootstrap");
|
||||||
|
}
|
||||||
|
|
||||||
// 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");
|
||||||
|
|||||||
@@ -341,7 +341,7 @@ impl Step for StartupObjects {
|
|||||||
if !up_to_date(src_file, dst_file) {
|
if !up_to_date(src_file, dst_file) {
|
||||||
let mut cmd = Command::new(&builder.initial_rustc);
|
let mut cmd = Command::new(&builder.initial_rustc);
|
||||||
builder.run(cmd.env("RUSTC_BOOTSTRAP", "1")
|
builder.run(cmd.env("RUSTC_BOOTSTRAP", "1")
|
||||||
.arg("--cfg").arg("stage0")
|
.arg("--cfg").arg("bootstrap")
|
||||||
.arg("--target").arg(target)
|
.arg("--target").arg(target)
|
||||||
.arg("--emit=obj")
|
.arg("--emit=obj")
|
||||||
.arg("-o").arg(dst_file)
|
.arg("-o").arg(dst_file)
|
||||||
|
|||||||
@@ -1242,17 +1242,17 @@ extern "rust-intrinsic" {
|
|||||||
|
|
||||||
/// Returns the result of an unchecked addition, resulting in
|
/// Returns the result of an unchecked addition, resulting in
|
||||||
/// undefined behavior when `x + y > T::max_value()` or `x + y < T::min_value()`.
|
/// undefined behavior when `x + y > T::max_value()` or `x + y < T::min_value()`.
|
||||||
#[cfg(not(stage0))]
|
#[cfg(not(bootstrap))]
|
||||||
pub fn unchecked_add<T>(x: T, y: T) -> T;
|
pub fn unchecked_add<T>(x: T, y: T) -> T;
|
||||||
|
|
||||||
/// Returns the result of an unchecked substraction, resulting in
|
/// Returns the result of an unchecked substraction, resulting in
|
||||||
/// undefined behavior when `x - y > T::max_value()` or `x - y < T::min_value()`.
|
/// undefined behavior when `x - y > T::max_value()` or `x - y < T::min_value()`.
|
||||||
#[cfg(not(stage0))]
|
#[cfg(not(bootstrap))]
|
||||||
pub fn unchecked_sub<T>(x: T, y: T) -> T;
|
pub fn unchecked_sub<T>(x: T, y: T) -> T;
|
||||||
|
|
||||||
/// Returns the result of an unchecked multiplication, resulting in
|
/// Returns the result of an unchecked multiplication, resulting in
|
||||||
/// undefined behavior when `x * y > T::max_value()` or `x * y < T::min_value()`.
|
/// undefined behavior when `x * y > T::max_value()` or `x * y < T::min_value()`.
|
||||||
#[cfg(not(stage0))]
|
#[cfg(not(bootstrap))]
|
||||||
pub fn unchecked_mul<T>(x: T, y: T) -> T;
|
pub fn unchecked_mul<T>(x: T, y: T) -> T;
|
||||||
|
|
||||||
/// Performs rotate left.
|
/// Performs rotate left.
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ assert_eq!(size_of::<Option<core::num::", stringify!($Ty), ">>(), size_of::<", s
|
|||||||
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
|
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
|
||||||
#[repr(transparent)]
|
#[repr(transparent)]
|
||||||
#[rustc_layout_scalar_valid_range_start(1)]
|
#[rustc_layout_scalar_valid_range_start(1)]
|
||||||
#[cfg_attr(not(stage0), rustc_nonnull_optimization_guaranteed)]
|
#[cfg_attr(not(bootstrap), rustc_nonnull_optimization_guaranteed)]
|
||||||
pub struct $Ty($Int);
|
pub struct $Ty($Int);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ use crate::cmp::Ordering;
|
|||||||
#[stable(feature = "nonnull", since = "1.25.0")]
|
#[stable(feature = "nonnull", since = "1.25.0")]
|
||||||
#[repr(transparent)]
|
#[repr(transparent)]
|
||||||
#[rustc_layout_scalar_valid_range_start(1)]
|
#[rustc_layout_scalar_valid_range_start(1)]
|
||||||
#[cfg_attr(not(stage0), rustc_nonnull_optimization_guaranteed)]
|
#[cfg_attr(not(bootstrap), rustc_nonnull_optimization_guaranteed)]
|
||||||
pub struct NonNull<T: ?Sized> {
|
pub struct NonNull<T: ?Sized> {
|
||||||
pointer: *const T,
|
pointer: *const T,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user