Skip to content

Commit 6843ea4

Browse files
committed
Auto merge of #28717 - nagisa:optional-no-landing-pads, r=alexcrichton
Part of #28710 Landing pads during stage0 are now enabled by defaullt. Since this has its downsides and upsides either way, I made it possible to change the option through configure.
2 parents c2be91e + a7f2a78 commit 6843ea4

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

configure

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,7 @@ opt ccache 0 "invoke gcc/clang via ccache to reuse object files between builds"
578578
opt local-rust 0 "use an installed rustc rather than downloading a snapshot"
579579
opt llvm-static-stdcpp 0 "statically link to libstdc++ for LLVM"
580580
opt rpath 0 "build rpaths into rustc itself"
581+
opt stage0-landing-pads 1 "enable landing pads during bootstrap with stage0"
581582
# This is used by the automation to produce single-target nightlies
582583
opt dist-host-only 0 "only install bins for the host architecture"
583584
opt inject-std-version 1 "inject the current compiler version of libstd into programs"

mk/main.mk

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,10 @@ RUST_LIB_FLAGS_ST3 += -C prefer-dynamic
170170

171171
# Landing pads require a lot of codegen. We can get through bootstrapping faster
172172
# by not emitting them.
173-
RUSTFLAGS_STAGE0 += -Z no-landing-pads
173+
174+
ifdef CFG_DISABLE_STAGE0_LANDING_PADS
175+
RUSTFLAGS_STAGE0 += -Z no-landing-pads
176+
endif
174177

175178
# Enable MIR to "always build" for crates where this works. This is
176179
# just temporary while MIR is being actively built up -- it's just a

src/libstd/sys/common/unwind/mod.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,18 @@ use sys_common::mutex::Mutex;
8181
#[path = "seh.rs"] #[doc(hidden)]
8282
pub mod imp;
8383

84+
// SNAP: i686-pc-windows-gnu
85+
#[cfg(all(stage0, windows, target_arch = "x86_64", target_env = "gnu"))]
86+
#[path = "seh64_gnu.rs"] #[doc(hidden)]
87+
pub mod imp;
88+
89+
// SNAP: x86_64-pc-windows-msvc
90+
#[cfg(all(stage0, windows, target_arch = "x86_64", target_env = "msvc"))]
91+
#[path = "seh.rs"] #[doc(hidden)]
92+
pub mod imp;
93+
8494
// x86_64-pc-windows-*
85-
#[cfg(all(windows, target_arch = "x86_64"))]
95+
#[cfg(all(not(stage0), windows, target_arch = "x86_64"))]
8696
#[path = "seh64_gnu.rs"] #[doc(hidden)]
8797
pub mod imp;
8898

0 commit comments

Comments
 (0)