Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -428,3 +428,17 @@ 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.

## 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.
28 changes: 23 additions & 5 deletions mcpp.toml
Original file line number Diff line number Diff line change
@@ -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"]
Expand Down Expand Up @@ -234,10 +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.
[target.'cfg(not(any(os = "none", os = "dos")))'.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"))'.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]
Expand Down Expand Up @@ -500,7 +510,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",
Expand Down Expand Up @@ -589,7 +605,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]
Expand Down
39 changes: 35 additions & 4 deletions tools/branch-graph.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,48 @@ 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"
[ "$vM" = "$fM" ] || return 1
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
Expand Down
Loading