mirror of
https://github.com/ziglang/zig.git
synced 2024-11-27 23:52:31 +00:00
Add comment explaining --stack-first option
This commit is contained in:
parent
fb9d5529da
commit
bf273b7aec
@ -2107,6 +2107,10 @@ static void construct_linker_job_wasm(LinkJob *lj) {
|
||||
lj->args.append("-z");
|
||||
lj->args.append(buf_ptr(buf_sprintf("stack-size=%" ZIG_PRI_usize, stack_size)));
|
||||
|
||||
// put stack before globals so that stack overflow results in segfault immediately before corrupting globals
|
||||
// see https://github.com/ziglang/zig/issues/4496
|
||||
lj->args.append("--stack-first");
|
||||
|
||||
if (g->out_type != OutTypeExe) {
|
||||
lj->args.append("--no-entry"); // So lld doesn't look for _start.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user