From a39e8143fe3f5959f3e1239eb4104f3da352660b Mon Sep 17 00:00:00 2001 From: mertcandav Date: Sun, 18 Aug 2024 16:35:25 +0300 Subject: [PATCH] jule: all programs have 8MB stack-size platform-independently --- src/julec/compile.jule | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/julec/compile.jule b/src/julec/compile.jule index 984b17368..867218657 100644 --- a/src/julec/compile.jule +++ b/src/julec/compile.jule @@ -30,6 +30,9 @@ use types for std::jule::types use std::process::{ProcessError, Cmd} use strings for std::strings::{StrBuilder} +// Default stack size of Jule programs. +const StackSize = "0x800000" + static mut OutDir = "dist" static mut OutName = "ir.cpp" static mut Out = "" @@ -105,9 +108,12 @@ fn isCppSourceFile(path: str): bool { } fn pushCompCmdClang(mut &cmd: StrBuilder) { + cmd.WriteStr(`-Wl,-stack_size,` + StackSize + " ") + // Disable all warnings. cmd.WriteStr("-Wno-everything ") + // Set C++ standard. cmd.WriteStr("--std=") match env::CppStd { @@ -131,6 +137,8 @@ fn pushCompCmdClang(mut &cmd: StrBuilder) { } fn pushCompCmdGcc(mut &cmd: StrBuilder) { + cmd.WriteStr(`-Wl,--stack,` + StackSize + " ") + // Disable all warnings. cmd.WriteStr("-w ")