File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -565,6 +565,21 @@ jobs:
565565
566566 # ⭐ And the one that is this machine, run rather than inspected — the same
567567 # criterion the Linux job holds itself to, applied from a different host.
568+ # ⭐ AND A HOSTED C++ PROGRAM, WHICH IS WHERE THREADS AND FILES ARE.
569+ #
570+ # `same-source` also runs on bare metal, so it cannot start a thread;
571+ # `examples/cxx` can, and on Windows a joined std::thread was an access
572+ # violation until openkal-musl 0.13.2 widened C++ `pthread_t`.
573+ - name : A hosted C++ program above it runs on this host
574+ run : |
575+ set -euo pipefail
576+ cd examples/cxx
577+ rm -rf target
578+ # The other observations were written for Linux; this step asks for the
579+ # thread, so a difference elsewhere is reported without failing it.
580+ mcpp run --target '${{ matrix.native }}' 2>&1 | tee out.log || true
581+ grep -q 'ok: a thread is started and joined' out.log
582+
568583 - name : The artefact for this host runs on it
569584 run : |
570585 set -euo pipefail
Original file line number Diff line number Diff line change 1818#include < filesystem>
1919#include < random>
2020#include < system_error>
21+ #include < thread>
2122
2223// ⭐ THREE NAMES A PROGRAM ABOVE THIS STACK MAY USE, ASSERTED BY COMPILING.
2324//
@@ -67,6 +68,20 @@ int main() {
6768 check (hidden + weak == 18 && weak_alias{3 }.value == 3 ,
6869 " hidden, weak and weak_alias are the program's own identifiers" );
6970
71+ // --- std::thread, which is the C++ face of openkal.task -----------------
72+ //
73+ // ⚠️ A THREAD THAT STARTS IS NOT A THREAD THAT IS JOINED. libc++ keeps the
74+ // pthread_t it was given, and musl declared that type `unsigned long` for
75+ // C++ --- thirty-two bits on Windows --- so the join read through half a
76+ // pointer and ended the program. Fixed in openkal-musl 0.13.2.
77+ {
78+ int written = 0 ;
79+ std::thread worker ([&] { written = 42 ; });
80+ const bool joinable = worker.joinable ();
81+ worker.join ();
82+ check (joinable && written == 42 && !worker.joinable (), " a thread is started and joined" );
83+ }
84+
7085 // --- std::filesystem, which is the C++ face of openkal.fs ---------------
7186
7287 namespace fs = std::filesystem;
Original file line number Diff line number Diff line change 11[package ]
22namespace = " mcpplibs"
33name = " openkal-llvm-runtime"
4- version = " 0.9.2 "
4+ version = " 0.9.3 "
55description = " LLVM's C++ runtime libraries — libc++, libc++abi and libunwind — configured for openkal-musl rather than for a host C library."
66license = " Apache-2.0"
77authors = [" mcpplibs" ]
@@ -208,7 +208,7 @@ sources = [
208208cflags = [" -DDISABLE_AARCH64_FMV=1" ]
209209
210210[dependencies ]
211- openkal-musl = " 0.13.1 "
211+ openkal-musl = " 0.13.2 "
212212
213213[build ]
214214cxx_standard = " c++23"
You can’t perform that action at this time.
0 commit comments