Skip to content

register openkal-llvm-runtime 0.15.0 - #456

Merged
Sunrisepeak merged 1 commit into
mainfrom
register-openkal-llvm-runtime-0-15-0
Sep 20, 2026
Merged

Sunrisepeak merged 1 commit into
mainfrom
register-openkal-llvm-runtime-0-15-0

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

thread_local destructors run, on every target this package builds for. The
defect had three layers and the first two fail differently, which is why
fixing only the first would have been worse than leaving it:

  1. EXPORT. Upstream libc++abi exports __cxa_thread_atexit on Linux and
    Fuchsia only, because elsewhere another runtime already does --- an
    ordinary MinGW target gets it from libmingw32.a. openkal replaces the C
    library and its runtime together, so both sides assumed the other would.
    doctest and spdlog in this repository's own compatibility suite stop
    at ld.lld: error: undefined symbol: __cxa_thread_atexit.

  2. STORAGE. With the guard open the link succeeded AND NOTHING WAS
    DESTROYED. The fallback keeps its pending-destructor list in a __thread
    variable; this runtime is built with -femulated-tls for PE, and emutls
    keeps its per-thread blocks behind a pthread key of its own whose
    destructor had already released this thread's block. Measured under wine,
    one thread:

    registered dtor, dtors=0x7ffffe994680, &dtors=0x7ffffe9946a8
    run_dtors called, dtors=0,             &dtors=0x7ffffe9946c8
    

    The list now lives in the TLS key's own value, which no other key's
    teardown can reach.

  3. APPLE. Surfaced by the criterion written for layer two: clang lowers a
    thread_local with a destructor to _tlv_atexit on Mach-O, and then the
    weak-symbol probe for __cxa_thread_atexit_impl --- an ELF idiom ld64
    does not honour in a static link --- became the error itself.

Criterion, two conditions and neither sufficient, in examples/cxx on
x86_64-linux-gnu and x86_64-windows-gnu (wine), failures: 0:

ok: a thread_local is constructed in a spawned thread
ok: and its destructor runs when that thread ends

Cross-verified against mcpp 2026.9.21.2 before that engine merged: five jobs
green, including both host-dimension rows. Registration only; nothing is
re-pinned onto it by this change.

`thread_local` destructors run, on every target this package builds for. The
defect had three layers and the first two fail differently, which is why
fixing only the first would have been worse than leaving it:

  1. EXPORT. Upstream libc++abi exports `__cxa_thread_atexit` on Linux and
     Fuchsia only, because elsewhere another runtime already does --- an
     ordinary MinGW target gets it from `libmingw32.a`. openkal replaces the C
     library and its runtime together, so both sides assumed the other would.
     `doctest` and `spdlog` in this repository's own compatibility suite stop
     at `ld.lld: error: undefined symbol: __cxa_thread_atexit`.

  2. STORAGE. With the guard open the link succeeded AND NOTHING WAS
     DESTROYED. The fallback keeps its pending-destructor list in a `__thread`
     variable; this runtime is built with `-femulated-tls` for PE, and emutls
     keeps its per-thread blocks behind a pthread key of its own whose
     destructor had already released this thread's block. Measured under wine,
     one thread:

         registered dtor, dtors=0x7ffffe994680, &dtors=0x7ffffe9946a8
         run_dtors called, dtors=0,             &dtors=0x7ffffe9946c8

     The list now lives in the TLS key's own value, which no other key's
     teardown can reach.

  3. APPLE. Surfaced by the criterion written for layer two: clang lowers a
     `thread_local` with a destructor to `_tlv_atexit` on Mach-O, and then the
     weak-symbol probe for `__cxa_thread_atexit_impl` --- an ELF idiom ld64
     does not honour in a static link --- became the error itself.

Criterion, two conditions and neither sufficient, in `examples/cxx` on
x86_64-linux-gnu and x86_64-windows-gnu (wine), `failures: 0`:

    ok: a thread_local is constructed in a spawned thread
    ok: and its destructor runs when that thread ends

Cross-verified against mcpp 2026.9.21.2 before that engine merged: five jobs
green, including both host-dimension rows. Registration only; nothing is
re-pinned onto it by this change.
@Sunrisepeak
Sunrisepeak merged commit e75e07d into main Sep 20, 2026
9 checks passed
@Sunrisepeak
Sunrisepeak deleted the register-openkal-llvm-runtime-0-15-0 branch September 20, 2026 21:40
Sunrisepeak added a commit that referenced this pull request Sep 20, 2026
THE TWO MOVE TOGETHER BECAUSE THE MEASUREMENT IS ABOUT WHAT THE PAIR DOES.

The engine withdraws `__CYGWIN__`. Four members of this suite --- archive
(xz), sqlite3, mimalloc, c-ares --- stopped at `#include <windows.h>` reached
through `#if defined(_WIN32) || defined(__CYGWIN__)`, and upstream means "Win32
is available" by that name. THIS MEASUREMENT IS THE CRITERION FOR THAT
CHANGE: the `windows.h` group should reach zero, and nothing that ran before
should stop running.

`runtime` -> 0.15.0 is what keeps the withdrawal safe. It pins openkal-musl
0.19.0, and both read `__MCPP_TARGET_WINDOWS__` in the INSTALLED headers that
size `jmp_buf` and `unw_context_t`, keeping `|| defined(__CYGWIN__)` beside
it. Measured on the engine branch before it merged: against the PUBLISHED
0.13.0, an openkal program for x86_64-windows-gnu fails on libunwind's two
`static_assert`s. Registered and published first --- #453, #455, #456 ---
before this line moved.

0.15.0 also makes `thread_local` destructors run, which `doctest` and
`spdlog` stop on today with `undefined symbol: __cxa_thread_atexit`. Those two
are the other half of what this run should report.

`openkal-compat.yml`'s MCPP_VERSION moves with `pins.toml` because that
workflow checks the two agree. `latest_mcpp` moves; `min_mcpp` DOES NOT ---
this release adds no manifest key, so no client loses the index.
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.

1 participant