feat: std-freestanding 0.2.0 + riscv-virt-rt 0.3.0 — the target owns its C library - #220
Draft
Sunrisepeak wants to merge 2 commits into
Draft
feat: std-freestanding 0.2.0 + riscv-virt-rt 0.3.0 — the target owns its C library#220Sunrisepeak wants to merge 2 commits into
Sunrisepeak wants to merge 2 commits into
Conversation
…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
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Both packages declared
xim:picolibc-riscv@1.8.12, and the standard-librarysubset also declared
xim:llvm. That pinned a board package and animplementation-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:
headers are, and the target's C headers are already on the compile line.
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.