Repository navigation
cobalt: the no-exceptions driver and stack probe under the -O3 link - #2
Merged
Merged
Conversation
The superproject links an emscripten program at its compile's level of optimization (webcpporg/webcpp#18), -O3 in a release build, which turns Emscripten's ASSERTIONS off. Native code's abort() then prints "Aborted()" where a debug link prints "Aborted(native code called abort())", and the driver of test/no_exceptions, which required the second, failed move_off and borrowed_race_off in release, in the exceptions and borrowed_race lanes. It now requires either line, exactly: no other abort of Emscripten's runtime has an empty reason, and a trap, or an abort for another reason, prints neither. Checked against both builds, and against stand-in programs that trap or abort for another reason, which it rejects. cobalt_stack_optimized_link_* linked release with <linkflags>-O3, which release now does itself; the probe keeps its debug and release builds.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Title: cobalt: the no-exceptions driver and stack probe under the -O3 link
The superproject now links an emscripten program at its compile's level of optimization (webcpporg/webcpp#18):
-O3in a release build, which turns Emscripten'sASSERTIONSoff.Changes
test/no_exceptions/driver.py. Native code'sabort()printsAborted(native code called abort())in a debug link andAborted()in a release one, followed in release by "Build with -sASSERTIONS for more info." The driver requiredRuntimeError: Aborted(native code called abort()), somove_offandborrowed_race_offfailed in release in theexceptionsandborrowed_racelanes. It now requires one of the twoAborted(...)lines, exactly, which Emscripten prints before it throws: no other abort of its runtime has an empty reason, and a trap, or an abort for another reason, prints another line. Checked with the release and debug probes (the old driver fails the release one), and with stand-in programs that trap, or abort withRuntimeError: unreachable,undefinedor an assertion as the reason, which the new driver rejects. The driver has no tests of its own.test/Jamfile.cobalt_stack_optimized_link_*linked release with<linkflags>-O3, which release now does itself; the probe keeps its debug and release builds. Measured on 2026-11-15: at most 1,036 bytes in debug and 384 in release with exceptions, 704 and 232 without.No user-visible change, so no changelog line.
Verification
Local, macOS arm64, Emscripten 6.0.11, Node 26.13.0, each lane from scratch (
b2 -a) in its own build directory, with the CI's options, invariant=releaseandvariant=debug, verdict bytools/report/report.py:libs/cobalt/test libs/cobalt/example), cobalt, cobalt_asyncify, asyncify, spsc-sequence, spsc-wakeup, migrated-portable, migrated-worker-modules, portable-counterparts, exceptions, borrowed_race: passed, release and debug.b2 -a libs/cobalt/doc: passed.No CI was run.
Depends on webcpporg/webcpp#18 (merged).
🤖 Generated with Claude Code