Skip to content

feat: openkal 0.1.0 + openkal-linux 0.1.0, std-freestanding 0.2.0, riscv-virt-rt 0.3.0 - #220

Merged
Sunrisepeak merged 3 commits into
mainfrom
feat/std-freestanding
Aug 19, 2026
Merged

feat: openkal 0.1.0 + openkal-linux 0.1.0, std-freestanding 0.2.0, riscv-virt-rt 0.3.0#220
Sunrisepeak merged 3 commits into
mainfrom
feat/std-freestanding

Conversation

@Sunrisepeak

@Sunrisepeak Sunrisepeak commented Aug 19, 2026

Copy link
Copy Markdown
Member

Four packages, in two groups.

openkal

A portable kernel application binary interface. The specification package
carries the normative declarations and no definitions; the implementation
package supplies them for Linux and is maintained as the worked example other
implementations follow.

A consuming project declares both: the first fixes the version of the contract
it is written against, the second selects an implementation. Changing
implementation is a change to one line of the manifest and to no line of the
source, which is demonstrated in the specification repository by an example
that builds one unmodified source against two implementations.

Bare metal

std-freestanding 0.2.0 and riscv-virt-rt 0.3.0 stop declaring the target's C
library. mcpp 2026.8.19.4 resolves it from the target's own row, the way it
resolves the compiler, so a bare-metal project no longer declares picolibc any
more than a hosted project declares glibc.

Both new bare-metal versions require mcpp >= 2026.8.19.4. The openkal packages
require nothing beyond a hosted toolchain.

…d library

`import std;` is one module over the whole library, so there is no subset of IT
to build without an OS — mcpp turns it off on a freestanding target and says
so. But libc++'s HEADERS are almost entirely freestanding-capable already; what
stops them is one per-target file, `__config_site`, which the toolchain ships
only for its own host triple. Synthesising that file is this package's job.

103 of libc++'s 110 headers compile for riscv64-none-elf. The other 7
(generator, hazard_pointer, rcu, spanstream, stacktrace, stdfloat,
text_encoding) fail on an x86_64 host with full libc++ and glibc too — they are
headers libc++ has not implemented, so the freestanding loss at compile time is
zero. The package's regeneration script prints that control group on every run.

Verified running under qemu: array, span, optional, atomic, string_view, and
ranges::sort with a projection.

`xim:llvm` is an install-time dependency because that is where libc++'s headers
live. Nothing is linked from it — the package includes them privately and
exports a module — but without the payload there is nothing to include, and the
failure would surface as "file not found" inside a module compile instead of as
a missing dependency.

Requires mcpp >= 2026.8.19.4: earlier versions do not put `-fno-exceptions` on
a freestanding target, and `std::optional::value()` alone then pulls in
`__cxa_throw` and three more symbols that cannot exist without an unwinder.
@Sunrisepeak
Sunrisepeak marked this pull request as draft August 19, 2026 05:01
…its C library

Both packages declared `xim:picolibc-riscv@1.8.12`, and the standard-library
subset also declared `xim:llvm`. That pinned a board package and an
implementation-neutral library alike to one C library, one architecture, one
toolchain and one version of each — none of which is a property of either.

mcpp 2026.8.19.4 resolves the target's C library from the target's own row, the
way it resolves the compiler: a hosted project never declared glibc, and a
bare-metal one no longer declares picolibc. So:

  * std-freestanding 0.2.0 declares NOTHING. It asks mcpp where the toolchain's
    headers are, and the target's C headers are already on the compile line.
  * riscv-virt-rt 0.3.0 declares only the emulator, which is the one xim
    package that really is a board fact. Its linker line is bare names now,
    because the search path is there before it says anything.

riscv-virt-rt 0.1.0 and 0.2.0 stay listed — published versions someone may have
pinned. std-freestanding 0.1.0 is replaced rather than kept: it never reached
this index, and it is wrong by construction.

Both new versions require mcpp >= 2026.8.19.4.
@Sunrisepeak Sunrisepeak changed the title feat: std-freestanding 0.1.0 — the freestanding subset of the standard library feat: std-freestanding 0.2.0 + riscv-virt-rt 0.3.0 — the target owns its C library Aug 19, 2026
openkal is a portable kernel application binary interface. The specification
package carries the normative declarations and no definitions; the
implementation package supplies the definitions for Linux and is maintained as
the worked example other implementations follow.

A consuming project declares both. The first dependency fixes the version of
the contract the project is written against; the second selects an
implementation and is ordinarily conditional on the target, so that changing
implementation is a change to one line of the manifest and to no line of the
source.

    [dependencies]
    openkal = "0.1.0"

    [target.'cfg(os = "linux")'.dependencies]
    openkal-linux = "0.1.0"

Neither descriptor declares xim dependencies. The specification package needs
no payload because it defines nothing, and the implementation uses the host C
library that mcpp already supplies for a hosted target.
@Sunrisepeak Sunrisepeak changed the title feat: std-freestanding 0.2.0 + riscv-virt-rt 0.3.0 — the target owns its C library feat: openkal 0.1.0 + openkal-linux 0.1.0, std-freestanding 0.2.0, riscv-virt-rt 0.3.0 Aug 19, 2026
@Sunrisepeak
Sunrisepeak marked this pull request as ready for review August 19, 2026 19:20
@Sunrisepeak
Sunrisepeak merged commit 88258e9 into main Aug 19, 2026
8 checks passed
@Sunrisepeak
Sunrisepeak deleted the feat/std-freestanding branch August 19, 2026 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants