From 56a7f1e77ecb264e1588924588071d2eef6e1840 Mon Sep 17 00:00:00 2001 From: Niels Sascha Reedijk Date: Sun, 27 Jan 2019 09:25:25 +0100 Subject: [PATCH] Haiku: the maximum stack size is 16 MB When one tries to create a thread with a requested stack size larger than 16 MB, the call will fail and the compiler will bail out. Therefore we should limit the size of the thread stack to 16 MB on Haiku. --- src/librustc_interface/util.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/librustc_interface/util.rs b/src/librustc_interface/util.rs index f4f7456a97ad6..a86d3cc43948d 100644 --- a/src/librustc_interface/util.rs +++ b/src/librustc_interface/util.rs @@ -121,9 +121,13 @@ pub fn create_session( } // Temporarily have stack size set to 32MB to deal with various crates with long method -// chains or deep syntax trees. +// chains or deep syntax trees, except when on Haiku. // FIXME(oli-obk): get https://github.com/rust-lang/rust/pull/55617 the finish line -const STACK_SIZE: usize = 32 * 1024 * 1024; // 32MB +#[cfg(not(target_os = "haiku"))] +const STACK_SIZE: usize = 32 * 1024 * 1024; + +#[cfg(target_os = "haiku")] +const STACK_SIZE: usize = 16 * 1024 * 1024; fn get_stack_size() -> Option { // FIXME: Hacks on hacks. If the env is trying to override the stack size