-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Wasm targets should append lld --stack-first #4496
Copy link
Copy link
Closed
Labels
acceptedThis proposal is planned.This proposal is planned.arch-wasm32-bit and 64-bit WebAssembly32-bit and 64-bit WebAssemblycontributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.This issue is limited in scope and/or knowledge of Zig internals.proposalThis issue suggests language modifications. If it also has the "accepted" label then it is planned.This issue suggests language modifications. If it also has the "accepted" label then it is planned.
Milestone
Metadata
Metadata
Assignees
Labels
acceptedThis proposal is planned.This proposal is planned.arch-wasm32-bit and 64-bit WebAssembly32-bit and 64-bit WebAssemblycontributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.This issue is limited in scope and/or knowledge of Zig internals.proposalThis issue suggests language modifications. If it also has the "accepted" label then it is planned.This issue suggests language modifications. If it also has the "accepted" label then it is planned.
By default, LLVM adopts this memory model:
This means when the stack runs out of space, it will start trampling over global memory before causing a stack overflow.
Appending
--stack-firstwill flip where the stack and the globals are located, so stack overflow will error out immediately instead of corrupting globals.Rust has made a similar decision: rustwasm/team#81 (comment)