delete more cfg(bootstrap)
This commit is contained in:
parent
11191279b7
commit
fdf6cc34b2
4 changed files with 22 additions and 38 deletions
|
@ -2164,18 +2164,11 @@ pub fn id() -> u32 {
|
||||||
/// to provide similar functionality.
|
/// to provide similar functionality.
|
||||||
#[cfg_attr(not(test), lang = "termination")]
|
#[cfg_attr(not(test), lang = "termination")]
|
||||||
#[stable(feature = "termination_trait_lib", since = "1.61.0")]
|
#[stable(feature = "termination_trait_lib", since = "1.61.0")]
|
||||||
#[rustc_on_unimplemented(
|
#[rustc_on_unimplemented(on(
|
||||||
on(
|
cause = "MainFunctionType",
|
||||||
all(not(bootstrap), cause = "MainFunctionType"),
|
message = "`main` has invalid return type `{Self}`",
|
||||||
message = "`main` has invalid return type `{Self}`",
|
label = "`main` can only return types that implement `{Termination}`"
|
||||||
label = "`main` can only return types that implement `{Termination}`"
|
))]
|
||||||
),
|
|
||||||
on(
|
|
||||||
bootstrap,
|
|
||||||
message = "`main` has invalid return type `{Self}`",
|
|
||||||
label = "`main` can only return types that implement `{Termination}`"
|
|
||||||
)
|
|
||||||
)]
|
|
||||||
pub trait Termination {
|
pub trait Termination {
|
||||||
/// Is called to get the representation of the value as status code.
|
/// Is called to get the representation of the value as status code.
|
||||||
/// This status code is returned to the operating system.
|
/// This status code is returned to the operating system.
|
||||||
|
|
|
@ -184,12 +184,7 @@ pub unsafe fn init(argc: isize, argv: *const *const u8, sigpipe: u8) {
|
||||||
sigpipe::SIG_DFL => (true, Some(libc::SIG_DFL)),
|
sigpipe::SIG_DFL => (true, Some(libc::SIG_DFL)),
|
||||||
_ => unreachable!(),
|
_ => unreachable!(),
|
||||||
};
|
};
|
||||||
// The bootstrap compiler doesn't know about sigpipe::DEFAULT, and always passes in
|
if sigpipe_attr_specified {
|
||||||
// SIG_IGN. This causes some tests to fail because they expect SIGPIPE to be reset to
|
|
||||||
// default on process spawning (which doesn't happen if #[unix_sigpipe] is specified).
|
|
||||||
// Since we can't differentiate between the cases here, treat SIG_IGN as DEFAULT
|
|
||||||
// unconditionally.
|
|
||||||
if sigpipe_attr_specified && !(cfg!(bootstrap) && sigpipe == sigpipe::SIG_IGN) {
|
|
||||||
UNIX_SIGPIPE_ATTR_SPECIFIED.store(true, crate::sync::atomic::Ordering::Relaxed);
|
UNIX_SIGPIPE_ATTR_SPECIFIED.store(true, crate::sync::atomic::Ordering::Relaxed);
|
||||||
}
|
}
|
||||||
if let Some(handler) = handler {
|
if let Some(handler) = handler {
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
#![cfg_attr(
|
#![cfg_attr(
|
||||||
any(
|
any(
|
||||||
all(target_arch = "arm", any(target_os = "linux", target_os = "android")),
|
all(target_arch = "arm", any(target_os = "linux", target_os = "android")),
|
||||||
all(bootstrap, target_arch = "aarch64", any(target_os = "linux", target_os = "android")),
|
|
||||||
all(target_arch = "powerpc", target_os = "linux"),
|
all(target_arch = "powerpc", target_os = "linux"),
|
||||||
all(target_arch = "powerpc64", target_os = "linux"),
|
all(target_arch = "powerpc64", target_os = "linux"),
|
||||||
),
|
),
|
||||||
|
|
|
@ -691,26 +691,23 @@ impl Step for Rustc {
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
// cfg(bootstrap): remove if condition once the bootstrap compiler supports dylib LTO
|
match builder.config.rust_lto {
|
||||||
if compiler.stage != 0 {
|
RustcLto::Thin | RustcLto::Fat => {
|
||||||
match builder.config.rust_lto {
|
// Since using LTO for optimizing dylibs is currently experimental,
|
||||||
RustcLto::Thin | RustcLto::Fat => {
|
// we need to pass -Zdylib-lto.
|
||||||
// Since using LTO for optimizing dylibs is currently experimental,
|
cargo.rustflag("-Zdylib-lto");
|
||||||
// we need to pass -Zdylib-lto.
|
// Cargo by default passes `-Cembed-bitcode=no` and doesn't pass `-Clto` when
|
||||||
cargo.rustflag("-Zdylib-lto");
|
// compiling dylibs (and their dependencies), even when LTO is enabled for the
|
||||||
// Cargo by default passes `-Cembed-bitcode=no` and doesn't pass `-Clto` when
|
// crate. Therefore, we need to override `-Clto` and `-Cembed-bitcode` here.
|
||||||
// compiling dylibs (and their dependencies), even when LTO is enabled for the
|
let lto_type = match builder.config.rust_lto {
|
||||||
// crate. Therefore, we need to override `-Clto` and `-Cembed-bitcode` here.
|
RustcLto::Thin => "thin",
|
||||||
let lto_type = match builder.config.rust_lto {
|
RustcLto::Fat => "fat",
|
||||||
RustcLto::Thin => "thin",
|
_ => unreachable!(),
|
||||||
RustcLto::Fat => "fat",
|
};
|
||||||
_ => unreachable!(),
|
cargo.rustflag(&format!("-Clto={}", lto_type));
|
||||||
};
|
cargo.rustflag("-Cembed-bitcode=yes");
|
||||||
cargo.rustflag(&format!("-Clto={}", lto_type));
|
|
||||||
cargo.rustflag("-Cembed-bitcode=yes");
|
|
||||||
}
|
|
||||||
RustcLto::ThinLocal => { /* Do nothing, this is the default */ }
|
|
||||||
}
|
}
|
||||||
|
RustcLto::ThinLocal => { /* Do nothing, this is the default */ }
|
||||||
}
|
}
|
||||||
|
|
||||||
builder.info(&format!(
|
builder.info(&format!(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue