Skip to content

Commit 5d72c38

Browse files
committed
Haiku: the maximum stack size is 16 MB, so keep it there on that platform.
1 parent 3f83559 commit 5d72c38

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/librustc_driver/lib.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1461,9 +1461,14 @@ fn parse_crate_attrs<'a>(sess: &'a Session, input: &Input) -> PResult<'a, Vec<as
14611461
}
14621462

14631463
// Temporarily have stack size set to 32MB to deal with various crates with long method
1464-
// chains or deep syntax trees.
1464+
// chains or deep syntax trees, except when on Haiku
14651465
// FIXME(oli-obk): get https://github.com/rust-lang/rust/pull/55617 the finish line
1466-
const STACK_SIZE: usize = 32 * 1024 * 1024; // 32MB
1466+
1467+
#[cfg(not(target_os = "haiku"))]
1468+
const STACK_SIZE: usize = 32 * 1024 * 1024;
1469+
1470+
#[cfg(target_os = "haiku")]
1471+
const STACK_SIZE: usize = 16 * 1024 * 1024;
14671472

14681473
/// Runs `f` in a suitable thread for running `rustc`; returns a `Result` with either the return
14691474
/// value of `f` or -- if a panic occurs -- the panic value.

0 commit comments

Comments
 (0)