Skip to content

Rewrite setjmp/longjmp docs#562

Merged
alexcrichton merged 2 commits intoWebAssembly:mainfrom
alexcrichton:update-setjmp-longjmp-docs
Sep 12, 2025
Merged

Rewrite setjmp/longjmp docs#562
alexcrichton merged 2 commits intoWebAssembly:mainfrom
alexcrichton:update-setjmp-longjmp-docs

Conversation

@alexcrichton
Copy link
Copy Markdown
Collaborator

  • Provide flags for emitting the standard exception-handling instructions.
  • More further explain what flags are doing.
  • Show a sample program that can be compiled both ways.
  • Delegate running in a runtime to various runtimes, so remove the "run the program" documentation here.
  • Remove wasm-opt documentation since it's now documented how to emit the standard instructions directly with LLVM.

* Provide flags for emitting the standard exception-handling
  instructions.
* More further explain what flags are doing.
* Show a sample program that can be compiled both ways.
* Delegate running in a runtime to various runtimes, so remove the "run
  the program" documentation here.
* Remove `wasm-opt` documentation since it's now documented how to
  emit the standard instructions directly with LLVM.
SetjmpLongjmp.md Outdated
history and has a "legacy" version which shipped in browsers as well. This means
that there are two different, but similar, sets of instructions that can be
emitted to support `setjmp` and `longjmp`. LLVM is capable of emitting both at
this time.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be helpful if I could connect these two versions of instructions with the llvm name/setting for that here, e.g. "emitting both as of release XXX, using the legacy exception-handling instructions by default, or the standard exception-handling instructions when passed -mllvm -wasm-use-legacy-eh=false." I know you can connect these dots a few paragraphs down but it helps here too.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sort of intentionally dancing around the question of the default and all the examples here explicitly specify -wasm-use-legacy-eh=true|false in that I'd ideally like to not cause more confusion by documenting a default that becomes obsolete soon (hopefully...)

@alexcrichton alexcrichton enabled auto-merge (squash) September 11, 2025 23:51
@alexcrichton alexcrichton merged commit d90d7de into WebAssembly:main Sep 12, 2025
17 of 18 checks passed
@alexcrichton alexcrichton deleted the update-setjmp-longjmp-docs branch March 11, 2026 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants