Repository navigation
Commit e75e07d
authored
register openkal-llvm-runtime 0.15.0 (#456)
`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.1 parent 6db50b8 commit e75e07d
1 file changed
Lines changed: 37 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
30 | 46 | | |
31 | 47 | | |
32 | 48 | | |
| |||
51 | 67 | | |
52 | 68 | | |
53 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
54 | 77 | | |
55 | 78 | | |
56 | 79 | | |
| |||
228 | 251 | | |
229 | 252 | | |
230 | 253 | | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
231 | 261 | | |
232 | 262 | | |
233 | 263 | | |
| |||
405 | 435 | | |
406 | 436 | | |
407 | 437 | | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
408 | 445 | | |
409 | 446 | | |
410 | 447 | | |
| |||
0 commit comments