From 33348470713fe91641ad80d00bb470e804c0a4bc Mon Sep 17 00:00:00 2001 From: mertcandav Date: Sun, 18 Aug 2024 17:42:41 +0300 Subject: [PATCH] compiler: minor fixes for stack size handling --- src/julec/compile.jule | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/julec/compile.jule b/src/julec/compile.jule index 867218657..a0916e18c 100644 --- a/src/julec/compile.jule +++ b/src/julec/compile.jule @@ -108,7 +108,12 @@ fn isCppSourceFile(path: str): bool { } fn pushCompCmdClang(mut &cmd: StrBuilder) { - cmd.WriteStr(`-Wl,-stack_size,` + StackSize + " ") + match build::Os { + | build::DistOs.Darwin: + cmd.WriteStr(`-Wl,-stack_size,` + StackSize + " ") + |: + cmd.WriteStr(`-Wl,-z,stack-size=` + StackSize + " ") + } // Disable all warnings. cmd.WriteStr("-Wno-everything ") @@ -137,7 +142,7 @@ fn pushCompCmdClang(mut &cmd: StrBuilder) { } fn pushCompCmdGcc(mut &cmd: StrBuilder) { - cmd.WriteStr(`-Wl,--stack,` + StackSize + " ") + cmd.WriteStr(`-Wl,-z,stack-size=` + StackSize + ` `) // Disable all warnings. cmd.WriteStr("-w ")