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
49 changes: 49 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ name: CI
# host-graph a build program is compiled as an ok image and run by okrun
# i686 Linux's thirty-two bit row: the hosted program and the
# specification's conformance suite, run on Linux x86_64
# riscv64 Linux's riscv64 row: the hosted program and the specification's
# conformance suite, built on Linux x86_64 and run under qemu-user
# i686-openkal the ok image of i386, run by okrun built for i686-linux-musl
# dos a DOS program, and the i386 image carried as one (technical
# experiment only), run under DOSBox Staging through dirun
Expand Down Expand Up @@ -305,6 +307,53 @@ jobs:
grep -qE '^observations: [0-9]+ held, 0 did not hold' conformance.log \
|| { echo "::error::an observation did not hold on i686-linux-musl"; exit 1; }

# Linux's riscv64 row (0.32.1): openkal-linux's riscv64 layer beneath the
# family, built here and run under qemu's user-mode translator --- the hosted
# program through the row's runner, and the specification's conformance suite,
# whose programs start one another, through the kernel's registration of the
# translator for riscv64 executables.
riscv64:
needs: resolves
name: riscv64-linux-musl (built on Linux x86_64, run under qemu-user)
runs-on: ubuntu-24.04
timeout-minutes: 90
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4

- uses: mcpp-community/setup-mcpp@v1
with:
version: ${{ env.MCPP_VERSION }}
xlings-version: ${{ env.XLINGS_VERSION }}

- name: The hosted program, through the row's runner
working-directory: checks/hosted
run: |
mcpp run --target riscv64-linux-musl -- one two | tee run.log
grep -q "hosted ok: hosted" run.log || { echo "::error::the hosted program's output"; exit 1; }
grep -q "hosted args: 3 two" run.log || { echo "::error::the hosted program's arguments"; exit 1; }
p=$(find target/riscv64-linux-musl -path '*bin/hosted' -type f | head -1)
file "$p"
file "$p" | grep -q 'ELF 64-bit' && file "$p" | grep -q 'RISC-V' && file "$p" | grep -q 'statically linked' \
|| { echo "::error::riscv64-linux-musl is not a static riscv64 program"; exit 1; }

- name: The specification's conformance suite
run: |
set -euo pipefail
sudo apt-get install -y -qq qemu-user-static > /dev/null
[ -e /proc/sys/fs/binfmt_misc/qemu-riscv64 ] \
|| { echo "::error::the translator is not registered for riscv64 executables"; exit 1; }
spec=$(sed -n 's/^openkal *= *"\(.*\)"/\1/p' mcpp.toml | head -1)
impl=$(sed -n 's/^openkal-linux *= *"\(.*\)"/\1/p' mcpp.toml | head -1)
git clone --quiet --depth 1 --branch "$spec" https://github.com/mcpplibs/openkal.git .spec
git clone --quiet --depth 1 --branch "$impl" https://github.com/mcpplibs/openkal-linux.git .impl
bash .spec/tools/run-conformance.sh openkal-linux .impl full,optional \
--target riscv64-linux-musl --platform "path:$GITHUB_WORKSPACE" | tee conformance.log
grep -qE '^observations: [0-9]+ held, 0 did not hold' conformance.log \
|| { echo "::error::an observation did not hold on riscv64-linux-musl"; exit 1; }

uefi:
needs: resolves
name: x86_64-uefi (built on Linux x86_64, run under OVMF)
Expand Down
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,21 @@ status 3. A row is added for a machine with no operating system above RISC-V SBI
firmware, `riscv64-none-musl` (below), with openkal-opensbi 0.10.1 joining the
group. It holds 0.31.3's member, openkal-image 0.7.3.

Platform 0.32.1 is a patch of the group with openkal-linux 0.27.2, which adds
riscv64 and reads a frame chain where `process_vm_readv` is absent. It adds the
row `riscv64-linux-musl` to the hosted arrangement: openkal-musl 0.30.3 over
openkal-linux's riscv64 system-call layer, with openkal-llvm-runtime 0.21.0 above
it. What the conformance suite measured under the translator is in the two
members. openkal-musl defines `__riscv_flush_icache`, the call the compiler makes
for `__builtin___clear_cache` on riscv64 Linux, and `__tls_get_addr` from the
thread pointer, the call riscv64's static link keeps for a general-dynamic access.
openkal-linux gives the riscv64 record of a signal's action the 32 bytes the
translator writes, and reads an ended program's record only where it was written.
A provider entry states the row's runner, qemu's user-mode translator
(`xim:qemu-user-riscv64`) on Linux x86_64, which runs without being enabled. CI
builds and runs a hosted program there and the specification's conformance suite
through the platform.

Platform 0.31.3 is a patch of the group with one member. openkal-image 0.7.3:
okrun's command line is a function of the runner (`okrun_main`), and the
carrier, as a package's runner, is that function, so it names itself the
Expand Down Expand Up @@ -550,7 +565,7 @@ previous patch's.
|---|---|
| `mcpp test` | the test image runs on the machine's architecture; the other architecture is built |
| `checks/image` | a project without declarations builds, runs and packs (M2 and M3) |
| `checks/hosted` | the hosted arrangement runs on Linux, macOS and Windows |
| `checks/hosted` | the hosted arrangement runs on Linux, macOS and Windows; on Linux x86_64 also as `i686-linux-musl` and, under qemu-user, `riscv64-linux-musl`, each with the specification's conformance suite |
| `checks/host-graph` | a build program runs as an ok image |
| `checks/snapshot` | a C++ program starts from a snapshot of its initialisers, and a start whose named value differs does not |
| `checks/i386` | an ok image of i386 is built in both modes, checked by okld and run by okrun built for i686-linux-musl; packed with `--systems dos-i686`, it runs as a DOS program |
Expand Down
47 changes: 33 additions & 14 deletions mcpp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
[package]
namespace = "mcpplibs"
name = "openkal-platform"
version = "0.32.0"
version = "0.32.1"
description = "The platform of ok images (<arch>-openkal): their toolchain, C library and C++ run-time, tools, compile and link conventions, seal, runner and carrier, as one versioned statement mcpp reads."
license = "Apache-2.0"
authors = ["mcpplibs"]
Expand Down Expand Up @@ -73,7 +73,7 @@ debuggee = ["okrun", "--debugger", "{}"]
[platform.layers]
compiler-runtime = "openkal-llvm-runtime@0.21.0"
"c++-abi" = "openkal-llvm-runtime@0.21.0"
c-abi = { name = "openkal-musl", version = "0.30.1", default-features = false, features = ["posix", "malloc-mimalloc"] }
c-abi = { name = "openkal-musl", version = "0.30.3", default-features = false, features = ["posix", "malloc-mimalloc"] }

# Built for the building machine: `okld` writes and checks the notes, `okrun`
# runs an image, `okprof` reads what a measured run recorded (0.23.0: the
Expand Down Expand Up @@ -214,15 +214,17 @@ seal = [["okld", "note", "{}"], ["okld", "place", "{}"], ["okld", "check", "{}
# `<arch>-freebsd-musl` are the system with no C library of its own beneath.
# `i686-linux-musl` (0.28.0) is the thirty-two bit row of Linux (openkal 0.25.1,
# clause 5.5): openkal-linux's i386 system-call layer beneath openkal-musl's.
# `riscv64-linux-musl` (0.32.1): openkal-linux 0.27.2's riscv64 layer beneath
# openkal-musl's, run under qemu's user-mode translator (the provider below).
targets = ["x86_64-linux-gnu", "aarch64-linux-gnu", "x86_64-linux-musl", "aarch64-linux-musl",
"x86_64-macos", "aarch64-macos", "x86_64-windows-gnu", "x86_64-windows-musl",
"x86_64-freebsd-musl", "aarch64-freebsd-musl", "i686-linux-musl"]
"x86_64-freebsd-musl", "aarch64-freebsd-musl", "i686-linux-musl", "riscv64-linux-musl"]
toolchain = "llvm@23.1.3"

[platform.hosted.layers]
compiler-runtime = "openkal-llvm-runtime@0.21.0"
"c++-abi" = "openkal-llvm-runtime@0.21.0"
c-abi = { name = "openkal-musl", version = "0.30.1", default-features = false, features = ["posix", "malloc-mimalloc"] }
c-abi = { name = "openkal-musl", version = "0.30.3", default-features = false, features = ["posix", "malloc-mimalloc"] }

# THE HOSTED ROWS' RUNNERS ON ANOTHER SYSTEM (0.29.0; mcpp 2026.11.16.1 reads a
# runner's `enabled`). A FreeBSD program runs in the FreeBSD virtual machine of
Expand All @@ -240,7 +242,7 @@ serves = ["x86_64-freebsd-musl"]
hosted = true
base = "none"
toolchain = "llvm@23.1.3"
layers = { compiler-runtime = "openkal-llvm-runtime@0.21.0", "c++-abi" = "openkal-llvm-runtime@0.21.0", c-abi = { name = "openkal-musl", version = "0.30.1", default-features = false, features = ["posix", "malloc-mimalloc"] } }
layers = { compiler-runtime = "openkal-llvm-runtime@0.21.0", "c++-abi" = "openkal-llvm-runtime@0.21.0", c-abi = { name = "openkal-musl", version = "0.30.3", default-features = false, features = ["posix", "malloc-mimalloc"] } }
runner = { cmd = ["dirun", "--profile", "{pkg:freebsd-disk-image}/dirun.toml", "--emulator", "{pkg:qemu-x86}/bin/qemu-system-x86_64", "--", "{}"], host = "any", hosts = ["linux-x86_64"], requires = ["xim:dirun@0.6.0", "xim:freebsd-disk-image@14.5-1", "xim:qemu-x86@9.2.4-1"], enabled = false }

[[platform.provider]]
Expand All @@ -249,7 +251,7 @@ serves = ["aarch64-freebsd-musl"]
hosted = true
base = "none"
toolchain = "llvm@23.1.3"
layers = { compiler-runtime = "openkal-llvm-runtime@0.21.0", "c++-abi" = "openkal-llvm-runtime@0.21.0", c-abi = { name = "openkal-musl", version = "0.30.1", default-features = false, features = ["posix", "malloc-mimalloc"] } }
layers = { compiler-runtime = "openkal-llvm-runtime@0.21.0", "c++-abi" = "openkal-llvm-runtime@0.21.0", c-abi = { name = "openkal-musl", version = "0.30.3", default-features = false, features = ["posix", "malloc-mimalloc"] } }
runner = { cmd = ["dirun", "--profile", "{pkg:aarch64-freebsd-disk-image}/dirun.toml", "--var", "firmware={pkg:ovmf}/share/edk2/edk2-aarch64-code.fd", "--emulator", "{pkg:qemu-system}/bin/qemu-system-aarch64", "--", "{}"], host = "any", hosts = ["linux-x86_64"], requires = ["xim:dirun@0.6.0", "xim:aarch64-freebsd-disk-image@14.5-1", "xim:ovmf@9.2.4-4", "xim:qemu-system@9.2.4"], enabled = false }

[[platform.provider]]
Expand All @@ -258,9 +260,22 @@ serves = ["x86_64-windows-musl"]
hosted = true
base = "none"
toolchain = "llvm@23.1.3"
layers = { compiler-runtime = "openkal-llvm-runtime@0.21.0", "c++-abi" = "openkal-llvm-runtime@0.21.0", c-abi = { name = "openkal-musl", version = "0.30.1", default-features = false, features = ["posix", "malloc-mimalloc"] } }
layers = { compiler-runtime = "openkal-llvm-runtime@0.21.0", "c++-abi" = "openkal-llvm-runtime@0.21.0", c-abi = { name = "openkal-musl", version = "0.30.3", default-features = false, features = ["posix", "malloc-mimalloc"] } }
runner = { cmd = ["wine", "{}"], host = "same-arch", hosts = ["linux-x86_64"], requires = ["xim:wine@11.0"], enabled = false }

# A riscv64 Linux program runs on an x86_64 Linux machine under qemu's user-mode
# translator (0.32.1), the runner mcpp's own row of the musl cross payload states
# (design 2026-11-22 §3.19). It makes nothing outside the program's own files, so
# it runs without being enabled.
[[platform.provider]]
name = "qemu-user"
serves = ["riscv64-linux-musl"]
hosted = true
base = "none"
toolchain = "llvm@23.1.3"
layers = { compiler-runtime = "openkal-llvm-runtime@0.21.0", "c++-abi" = "openkal-llvm-runtime@0.21.0", c-abi = { name = "openkal-musl", version = "0.30.3", default-features = false, features = ["posix", "malloc-mimalloc"] } }
runner = { cmd = ["qemu-riscv64-static", "{}"], host = "any", hosts = ["linux-x86_64"], requires = ["xim:qemu-user-riscv64@7.2.0"] }

# The runners require dirun 0.5.0 and ovmf 9.2.4-3 (0.29.0): ovmf's profile states the UEFI
# Shell's quoting (`[payload] quote = "uefi-shell"'), so an argument with a blank reaches
# the application whole.
Expand Down Expand Up @@ -293,7 +308,7 @@ serves = ["x86_64-uefi"]
base = "none"
hosted = true

layers = { compiler-runtime = "openkal-llvm-runtime@0.21.0", "c++-abi" = "openkal-llvm-runtime@0.21.0", c-abi = { name = "openkal-musl", version = "0.30.1", default-features = false, features = ["posix", "malloc-mimalloc"] } }
layers = { compiler-runtime = "openkal-llvm-runtime@0.21.0", "c++-abi" = "openkal-llvm-runtime@0.21.0", c-abi = { name = "openkal-musl", version = "0.30.3", default-features = false, features = ["posix", "malloc-mimalloc"] } }
link = { driver = "lld", start = "efi_main", flags = ["--subsystem", "efi_application", "--gc-sections"], exe = "{name}.efi", inputs = [{ file = "board/qemu-exit.S" }], seal = [] }
runner = { cmd = ["dirun", "--payload", "{}", "--profile", "{pkg:ovmf}/dirun.toml", "--emulator", "{pkg:qemu-x86}/bin/qemu-system-x86_64", "--memory", "2048", "--"], hosts = ["linux-x86_64", "linux-aarch64", "macos-aarch64", "windows-x86_64"], requires = ["xim:dirun@0.6.0", "xim:qemu-x86@9.2.4-1", "xim:ovmf@9.2.4-4"], enabled = false }

Expand Down Expand Up @@ -332,7 +347,7 @@ serves = ["i686-dos-musl"]
base = "none"
hosted = true

layers = { compiler-runtime = "openkal-llvm-runtime@0.21.0", "c++-abi" = "openkal-llvm-runtime@0.21.0", c-abi = { name = "openkal-musl", version = "0.30.1", default-features = false, features = ["posix", "malloc-mallocng"] } }
layers = { compiler-runtime = "openkal-llvm-runtime@0.21.0", "c++-abi" = "openkal-llvm-runtime@0.21.0", c-abi = { name = "openkal-musl", version = "0.30.3", default-features = false, features = ["posix", "malloc-mallocng"] } }
link = { driver = "lld", start = "okdos_entry", flags = ["-static", "--image-base=0x1000", "-z", "norelro", "-z", "stack-size=1048576", "--gc-sections", "--eh-frame-hdr"], seal = [["okdos", "seal", "{}"]] }
runner = { cmd = ["dirun", "--payload", "{}", "--profile", "{pkg:dosbox-staging}/dirun.toml", "--"], hosts = ["linux-x86_64", "macos-aarch64", "windows-x86_64"], requires = ["xim:dirun@0.6.0", "xim:dosbox-staging@0.83.0-2"], enabled = false }

Expand Down Expand Up @@ -370,7 +385,7 @@ serves = ["riscv64-none-musl"]
base = "none"
hosted = true

layers = { "kernel-abi" = { name = "openkal-opensbi", version = "0.10.1", features = ["standalone"] }, compiler-runtime = "openkal-llvm-runtime@0.21.0", "c++-abi" = "openkal-llvm-runtime@0.21.0", c-abi = { name = "openkal-musl", version = "0.30.1", default-features = false, features = ["posix", "malloc-mallocng"] } }
layers = { "kernel-abi" = { name = "openkal-opensbi", version = "0.10.1", features = ["standalone"] }, compiler-runtime = "openkal-llvm-runtime@0.21.0", "c++-abi" = "openkal-llvm-runtime@0.21.0", c-abi = { name = "openkal-musl", version = "0.30.3", default-features = false, features = ["posix", "malloc-mallocng"] } }
runner = { cmd = ["{pkg:qemu-riscv}/bin/qemu-system-riscv64", "-machine", "virt", "-nographic", "-no-reboot", "-bios", "default", "-kernel", "{}"], hosts = ["linux-x86_64", "linux-aarch64", "macos-aarch64", "windows-x86_64"], requires = ["xim:qemu-riscv@9.2.4-1"], enabled = false }

# UNIX SYSTEM V RELEASE 4 AND ITS DESCENDANTS ON i386 (0.30.0): programs of the
Expand Down Expand Up @@ -427,7 +442,7 @@ serves = ["i686-svr4-musl"]
base = "none"
hosted = true

layers = { "kernel-abi" = { name = "openkal-svr4", version = "0.3.0", features = ["standalone"] }, compiler-runtime = "openkal-llvm-runtime@0.21.0", "c++-abi" = "openkal-llvm-runtime@0.21.0", c-abi = { name = "openkal-musl", version = "0.30.1", default-features = false, features = ["posix", "malloc-mallocng"] } }
layers = { "kernel-abi" = { name = "openkal-svr4", version = "0.3.0", features = ["standalone"] }, compiler-runtime = "openkal-llvm-runtime@0.21.0", "c++-abi" = "openkal-llvm-runtime@0.21.0", c-abi = { name = "openkal-musl", version = "0.30.3", default-features = false, features = ["posix", "malloc-mallocng"] } }
link = { driver = "lld", script = "link/svr4.ld", flags = ["-static", "-z", "norelro", "--gc-sections", "--eh-frame-hdr"] }
runner = { cmd = ["unshare", "-Ur", "{pkg:ibcs-us}/bin/ibcs-us", "{}"], hosts = ["linux-x86_64"], requires = ["xim:ibcs-us@4.3-2"], enabled = false }

Expand Down Expand Up @@ -521,14 +536,18 @@ runner = { cmd = ["unshare", "-Ur", "{pkg:ibcs-us}/bin/ibcs-us", "{}"], hosts =
# StartImage, openkal-dos and openkal-dos-tools 0.3.0 through EXEC, each a
# started program run to its end first, openkal clause 7.19), openkal-musl 0.30.1
# naming them, and openkal-windows 0.23.1 (a program without memory for its
# arguments ends with the reason). From 0.24.1 the members name
# arguments ends with the reason); 0.32.1, openkal-linux 0.27.2 (riscv64, a
# frame chain read without `process_vm_readv', the riscv64 action record as the
# translator writes it, an ended program's record read only where it was written)
# and openkal-musl 0.30.3 (`__riscv_flush_icache', `__tls_get_addr' from the
# thread pointer), with `riscv64-linux-musl' served. From 0.24.1 the members name
# one another by compatible ranges (`^0.28.0`) and this group chooses the
# versions: mcpp 2026.11.7.1 resolves within it, and a fix of one member is that
# member's release and a patch of this group, released together through one
# index change (tools/family_release.py, .github/workflows/family-release.yml).
[platform.versions]
openkal = "0.26.0"
openkal-linux = "0.27.0"
openkal-linux = "0.27.2"
openkal-macos = "0.24.1"
openkal-windows = "0.23.1"
openkal-freebsd = "0.2.0"
Expand All @@ -537,7 +556,7 @@ openkal-dos = "0.3.0"
openkal-dos-tools = "0.3.0"
openkal-svr4 = "0.3.0"
openkal-opensbi = "0.10.1"
openkal-musl = "0.30.1"
openkal-musl = "0.30.3"
openkal-llvm-runtime = "0.21.0"
openkal-ld = "0.7.3"
openkal-run = "0.7.3"
Expand Down
Loading