-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document the -Wl,--stack-first
option to clang.
#2703
Document the -Wl,--stack-first
option to clang.
#2703
Conversation
As discussed in WebAssembly/wasi-libc#233, document the `-Wl,--stack-first` option to help users diagnose stack overflow errors.
that stack overflow will often lead to corrupted globals. The | ||
`-Wl,--stack-first` flag to clang instructs it to put the stack first, followed | ||
by the globals and the heap, which may produce slightly larger code, but will | ||
more reliably trap on stack overflow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worth linking to https://lld.llvm.org/WebAssembly.html so folks find discover other useful linker flags?
How about For more information on this and other linker flags supported by wasm-ld see https://lld.llvm.org/WebAssembly.html
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. Seems that some useful flags are not described on the page, such as --growable-table
and --export
. I assume it is not actively being updated. Maybe ./wasm-ld --help
would be more extensive, but one cannot see it online. It's also not described on that page of flags.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be out of date, but that is not indented. Its generated directly from this file in the llvm source tree so it probably just needs an update: https://github.com/llvm/llvm-project/blob/main/lld/docs/WebAssembly.rst. Linking to something readable online is think is better than assuming the reader has a command line to hand.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That document also has more useful information about the linker in addition to what --help
provides.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good thought; I'd now added a link to the lld WebAssembly docs.
As discussed in WebAssembly/wasi-libc#233, document the
-Wl,--stack-first
option to help users diagnose stack overflow errors.