aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorJakub Konka <kubkon@jakubkonka.com>2020-06-05 22:21:33 +0200
committerAndrew Kelley <andrew@ziglang.org>2020-06-08 17:44:06 -0400
commit0ff5d7b24e2017199566d1bab75254fa5ef68611 (patch)
tree0c44d8f84b155eedef9e7cbfba47c0834d700a84 /src/main.cpp
parentcde7c756767348e4c96770327b490f824f2a8e60 (diff)
downloadzig-0ff5d7b24e2017199566d1bab75254fa5ef68611.tar.gz
zig-0ff5d7b24e2017199566d1bab75254fa5ef68611.zip
Add option for overriding the stack size
This commit adds a `--stack [size]` link-time option to zig compiler allowing the user to override the default stack size set for the specified executable/library format. This is currently limited to ELF, COFF and Wasm however (i.e., Mach-O is excluded).
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 41aade9431..6d5f1f3f76 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -126,6 +126,7 @@ static int print_full_usage(const char *arg0, FILE *file, int return_code) {
" -l[lib] alias for --library\n"
" -rdynamic add all symbols to the dynamic symbol table\n"
" -rpath [path] add directory to the runtime library search path\n"
+ " --stack [size] (linux, windows, Wasm) override default stack size\n"
" --subsystem [subsystem] (windows) /SUBSYSTEM:<subsystem> to the linker\n"
" -F[dir] (darwin) add search path for frameworks\n"
" -framework [name] (darwin) link against framework\n"
@@ -1231,6 +1232,8 @@ static int main0(int argc, char **argv) {
ver_patch = atoi(argv[i]);
} else if (strcmp(arg, "--test-cmd") == 0) {
test_exec_args.append(argv[i]);
+ } else if (strcmp(arg, "--stack") == 0) {
+ stack_size_override = atoi(argv[i]);
} else if (strcmp(arg, "--subsystem") == 0) {
if (strcmp(argv[i], "console") == 0) {
subsystem = TargetSubsystemConsole;