Skip to content

Commit 00c0a6c

Browse files
authored
0.9.3 --- follow openkal-musl 0.13.2 (#18)
Carries openkal-musl 0.13.2, which fixes a defect every C++ consumer of this package on Windows is exposed to: musl's C++ pthread_t was thirty-two bits there, so a std::thread faulted when it was joined. A version requirement here is exact, so consumers reach the fix only through this release. examples/cxx now starts and joins a std::thread, and the host jobs run it.
1 parent 414fb6f commit 00c0a6c

3 files changed

Lines changed: 32 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff 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

examples/cxx/src/main.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
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;

mcpp.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
namespace = "mcpplibs"
33
name = "openkal-llvm-runtime"
4-
version = "0.9.2"
4+
version = "0.9.3"
55
description = "LLVM's C++ runtime libraries — libc++, libc++abi and libunwind — configured for openkal-musl rather than for a host C library."
66
license = "Apache-2.0"
77
authors = ["mcpplibs"]
@@ -208,7 +208,7 @@ sources = [
208208
cflags = ["-DDISABLE_AARCH64_FMV=1"]
209209

210210
[dependencies]
211-
openkal-musl = "0.13.1"
211+
openkal-musl = "0.13.2"
212212

213213
[build]
214214
cxx_standard = "c++23"

0 commit comments

Comments
 (0)