about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-06-10 13:14:31 +0200
committerGitHub <noreply@github.com>2019-06-10 13:14:31 +0200
commit2bb390b28164f9d3dac863a4e16568d84c3e3aee (patch)
tree9d26130395d89628ae38e1062a5d8f1be50e91f8
parente18113916267d46b1705d278ee1392e18ada44c3 (diff)
parent56a7f1e77ecb264e1588924588071d2eef6e1840 (diff)
downloadrust-2bb390b28164f9d3dac863a4e16568d84c3e3aee.tar.gz
rust-2bb390b28164f9d3dac863a4e16568d84c3e3aee.zip
Rollup merge of #61683 - nielx:haiku-stack-limit, r=nagisa
Haiku: the maximum stack size is 16 MB

This keeps the compiler from crashing every time it is invoked. No functional change on other platforms.

This patch is similar to the limitation that is in the [librustdoc/lib.rs](https://github.com/rust-lang/rust/blob/57e13e0325c1d41161a31de1f8520538ec2c575c/src/librustdoc/lib.rs#L89).
-rw-r--r--src/librustc_interface/util.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/librustc_interface/util.rs b/src/librustc_interface/util.rs
index f4f7456a97a..a86d3cc4394 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<usize> {
     // FIXME: Hacks on hacks. If the env is trying to override the stack size