From 4b32224b952bcb966567b7c135cd1189d9454250 Mon Sep 17 00:00:00 2001 From: Sunrisepeak Date: Wed, 18 Nov 2026 14:59:18 +0900 Subject: [PATCH 1/3] 0.20.4: the builtins by container, the 486's exclusion by architecture, the allocator by the implementation's statement --- README.md | 13 ++++++++++++- mcpp.toml | 23 ++++++++++++++++++----- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 587722c9..40a0b02a 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ C library. ```toml [dependencies] -openkal-llvm-runtime = "0.20.3" +openkal-llvm-runtime = "0.20.4" ``` > **Engine floor (mcpp 2026.11.2.1):** 0.17.0 is built over openkal-musl 0.26.0, @@ -428,3 +428,14 @@ openkal-musl is the compatible range `^0.28.0`. Runtime 0.19.0 selects openkal-musl 0.28.0 and its matching OpenKal 0.24 implementations. The C++ runtime surface and allocator feature selection remain unchanged. + +## The selections are by container and by statement, not by a list of systems (0.20.4) + +Three selections named systems, so a row a platform defines for a system this package +does not know took none of them: the builtins (it was built with none: `undefined symbol: +__divdi3`), the 486's exclusion of the `__bf16` conversions, and the allocator of the C +library beneath. They now read what the row states. The builtins are the ELF rows' that +state no selection of their own; the 486's exclusion is every i386 row's but Linux's; and +musl's own allocator is taken wherever the implementation states no `openkal.random`, +which mimalloc seeds its heaps from. Every row served before selects what it selected: +the only implementation without `openkal.random` was DOS's, which was named. diff --git a/mcpp.toml b/mcpp.toml index b22c9126..d952b154 100644 --- a/mcpp.toml +++ b/mcpp.toml @@ -1,7 +1,7 @@ [package] namespace = "mcpplibs" name = "openkal-llvm-runtime" -version = "0.20.3" +version = "0.20.4" description = "LLVM's C++ runtime libraries — libc++, libc++abi and libunwind — configured for openkal-musl rather than for a host C library." license = "Apache-2.0" authors = ["mcpplibs"] @@ -234,10 +234,15 @@ cflags = ["-DDISABLE_AARCH64_FMV=1"] # technical experiment only) is the same: its DPMI memory is a machine's few megabytes, and # mimalloc's arenas are placed at 256 MiB. A target's edge replaces a general one, so each # states every feature. -[target.'cfg(not(any(os = "none", os = "dos")))'.dependencies] +# A ROW WHOSE IMPLEMENTATION STATES NO RANDOM SOURCE TAKES musl's OWN TOO (0.20.4): mimalloc +# seeds its heaps from one and says so where there is none (`unable to use secure +# randomness'), and such an implementation is a small machine's or an old system's. The +# implementation's own statement decides (`cfg(interface = ...)'), so a new system is not +# added to a list here. +[target.'cfg(not(any(os = "none", os = "dos", not(interface = "openkal.random"))))'.dependencies] openkal-musl = { version = "^0.29.0", default-features = false, features = ["posix", "malloc-mimalloc"] } -[target.'cfg(any(os = "none", os = "dos"))'.dependencies] +[target.'cfg(any(os = "none", os = "dos", not(interface = "openkal.random")))'.dependencies] openkal-musl = { version = "^0.29.0", default-features = false, features = ["posix", "malloc-mallocng"] } [build] @@ -500,7 +505,13 @@ sources = [ # binds the image's `kal_*' imports, which this package never names. DOS (0.20.3, openkal-dos; # technical experiment only) takes it too: an ELF executable with its headers in its first # segment, which the stub loads. -[target.'cfg(any(os = "linux", os = "openkal", os = "dos"))'.build] +# +# THE SELECTION IS THE ELF ROWS', NOT A LIST OF SYSTEMS (0.20.4). It named Linux, the ok image +# and DOS, so a row a platform defines for another system was built with no builtins at all +# (measured on an i386 row over an implementation this package does not know: `undefined +# symbol: __divdi3', `__atomic_load'). The two systems named are the ones that state their +# own selection below; a new ELF system takes this one and writes no line here. +[target.'cfg(all(object-format = "elf", not(os = "freebsd"), not(os = "none")))'.build] sources = [ "llvm/compiler-rt/lib/builtins/*.c", "!llvm/compiler-rt/lib/builtins/atomic_*.c", @@ -589,7 +600,9 @@ sources = [ # `__bf16' does not exist there, as compiler-rt's own build finds (COMPILER_RT_HAS_BFLOAT16); its # conversions stay out (measured: `__bf16 is not supported on this target', fp_trunc.h). # i686-linux-musl keeps the toolchain's processor, which has SSE2, and the conversions. -[target.'cfg(any(os = "dos", all(os = "openkal", arch = "i686")))'.build] +# The condition is the architecture's rows that state the 486 (0.20.4): every i386 row but +# Linux's, which is the one that keeps the toolchain's processor. +[target.'cfg(all(arch = "i686", not(os = "linux")))'.build] sources = ["!llvm/compiler-rt/lib/builtins/*bf2.c"] [target.'cfg(os = "openkal")'.build] From f3818752815ff21dbe4f303225908f81b10a5d23 Mon Sep 17 00:00:00 2001 From: Sunrisepeak Date: Wed, 18 Nov 2026 15:05:07 +0900 Subject: [PATCH 2/3] ci: the stack under test reads a range of comparators, which the C library states for one implementation --- tools/branch-graph.sh | 39 +++++++++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/tools/branch-graph.sh b/tools/branch-graph.sh index 9df98b09..6f1f47b8 100755 --- a/tools/branch-graph.sh +++ b/tools/branch-graph.sh @@ -39,10 +39,24 @@ branch="${1:-}" root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" cd "$root" -# Whether VERSION satisfies a caret RANGE (^a.b.c: below 1, the same minor -# version; from 1, the same major version; never below a.b.c). -in_range() { - local version="$1" floor="${2#^}" +# Whether VERSION satisfies RANGE, in the two forms the manifests state: a caret +# range (^a.b.c: below 1, the same minor version; from 1, the same major +# version; never below a.b.c), or comparators separated by commas +# (`>=0.10.0, <0.12.0'), each of which must hold. +compare() { # compare A B: prints -1, 0 or 1 + local aM am ap bM bm bp + IFS=. read -r aM am ap <<< "$1" + IFS=. read -r bM bm bp <<< "$2" + local x y + for pair in "$aM:$bM" "${am:-0}:${bm:-0}" "${ap:-0}:${bp:-0}"; do + x="${pair%%:*}"; y="${pair##*:}" + if [ "$x" -lt "$y" ]; then echo -1; return; fi + if [ "$x" -gt "$y" ]; then echo 1; return; fi + done + echo 0 +} +in_caret() { + local version="$1" floor="$2" local vM vm vp fM fm fp IFS=. read -r vM vm vp <<< "$version" IFS=. read -r fM fm fp <<< "$floor" @@ -50,6 +64,23 @@ in_range() { if [ "$fM" = 0 ]; then [ "$vm" = "$fm" ] && [ "$vp" -ge "$fp" ]; return; fi [ "$vm" -gt "$fm" ] || { [ "$vm" = "$fm" ] && [ "$vp" -ge "$fp" ]; } } +in_range() { + local version="$1" range="$2" part bound order + local -a parts + IFS=, read -r -a parts <<< "$range" + for part in "${parts[@]}"; do + part="${part//[[:space:]]/}" + case "$part" in + ^*) in_caret "$version" "${part#^}" || return 1 ;; + \>=*) bound="${part#>=}"; order="$(compare "$version" "$bound")"; [ "$order" != -1 ] || return 1 ;; + \<=*) bound="${part#<=}"; order="$(compare "$version" "$bound")"; [ "$order" != 1 ] || return 1 ;; + \>*) bound="${part#>}"; order="$(compare "$version" "$bound")"; [ "$order" = 1 ] || return 1 ;; + \<*) bound="${part#<}"; order="$(compare "$version" "$bound")"; [ "$order" = -1 ] || return 1 ;; + =*) [ "$(compare "$version" "${part#=}")" = 0 ] || return 1 ;; + *) in_caret "$version" "$part" || return 1 ;; + esac + done +} # Clones a repository of this ecosystem, preferring the branch under test when # that repository has one of the same name. Without one, the default branch is From 849f4a349b462f7bbe01257ed6ffc22166e13f12 Mon Sep 17 00:00:00 2001 From: Sunrisepeak Date: Wed, 18 Nov 2026 15:10:43 +0900 Subject: [PATCH 3/3] 0.20.4: the allocator's edge reads the row's words; mimalloc where it was measured, musl's own elsewhere --- README.md | 23 +++++++++++++---------- mcpp.toml | 19 ++++++++++++------- 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 40a0b02a..324d2c2c 100644 --- a/README.md +++ b/README.md @@ -429,13 +429,16 @@ Runtime 0.19.0 selects openkal-musl 0.28.0 and its matching OpenKal 0.24 implementations. The C++ runtime surface and allocator feature selection remain unchanged. -## The selections are by container and by statement, not by a list of systems (0.20.4) - -Three selections named systems, so a row a platform defines for a system this package -does not know took none of them: the builtins (it was built with none: `undefined symbol: -__divdi3`), the 486's exclusion of the `__bf16` conversions, and the allocator of the C -library beneath. They now read what the row states. The builtins are the ELF rows' that -state no selection of their own; the 486's exclusion is every i386 row's but Linux's; and -musl's own allocator is taken wherever the implementation states no `openkal.random`, -which mimalloc seeds its heaps from. Every row served before selects what it selected: -the only implementation without `openkal.random` was DOS's, which was named. +## A system this package does not know (0.20.4) + +Three selections named the systems they applied to, so a row a platform defines for a +system this package does not know took none of them, or the wrong one: it was built with +no builtins (`undefined symbol: __divdi3`), kept the `__bf16` conversions the 486 has no +type for, and took mimalloc, which asks the implementation beneath it for more than such a +system may have. Each now names the exception and leaves the rest to the general case. The +builtins are the ELF rows' that state no selection of their own; the 486's exclusion is +every i386 row's but Linux's; mimalloc is taken on the systems it was measured on, and +musl's own allocator, which asks for blocks of memory and nothing else, everywhere else. +Every row served before selects what it selected. The conditions are the row's own words +(system, architecture, container): a dependency edge is selected before the graph is +resolved, so what the implementation provides cannot decide it. diff --git a/mcpp.toml b/mcpp.toml index d952b154..85d670ab 100644 --- a/mcpp.toml +++ b/mcpp.toml @@ -234,15 +234,20 @@ cflags = ["-DDISABLE_AARCH64_FMV=1"] # technical experiment only) is the same: its DPMI memory is a machine's few megabytes, and # mimalloc's arenas are placed at 256 MiB. A target's edge replaces a general one, so each # states every feature. -# A ROW WHOSE IMPLEMENTATION STATES NO RANDOM SOURCE TAKES musl's OWN TOO (0.20.4): mimalloc -# seeds its heaps from one and says so where there is none (`unable to use secure -# randomness'), and such an implementation is a small machine's or an old system's. The -# implementation's own statement decides (`cfg(interface = ...)'), so a new system is not -# added to a list here. -[target.'cfg(not(any(os = "none", os = "dos", not(interface = "openkal.random"))))'.dependencies] +# mimalloc IS TAKEN WHERE IT WAS MEASURED, AND musl's OWN EVERYWHERE ELSE (0.20.4). The +# condition named the systems that take musl's own (`none', `dos'), so a row a platform +# defines for a system this package does not know took mimalloc, which asks more of the +# implementation beneath it than that system may have: a random source for its heaps +# (`unable to use secure randomness'), arenas placed far apart, threads. musl's own asks for +# blocks of `openkal.memory' and nothing else, so it is the allocator of a system nobody +# measured, and a new system is not added to a list here. The systems named are the ones the +# C library names an implementation for, less the two above. A dependency edge is selected +# before the graph is resolved, so the condition is the row's own words: what the +# implementation provides (`cfg(interface = ...)') is not known yet at this point. +[target.'cfg(any(os = "linux", os = "macos", os = "windows", os = "freebsd", os = "uefi", os = "openkal"))'.dependencies] openkal-musl = { version = "^0.29.0", default-features = false, features = ["posix", "malloc-mimalloc"] } -[target.'cfg(any(os = "none", os = "dos", not(interface = "openkal.random")))'.dependencies] +[target.'cfg(not(any(os = "linux", os = "macos", os = "windows", os = "freebsd", os = "uefi", os = "openkal")))'.dependencies] openkal-musl = { version = "^0.29.0", default-features = false, features = ["posix", "malloc-mallocng"] } [build]