Commit cbb1a07
the c-abi probe measures the target it verifies, and a capability is answered where the answer exists (2026.9.20.1)
Four changes, one subject: information about a capability becomes available
at three times, each being the earliest at which it exists (openkal SPEC 0.14
§6.2), and this engine had been answering two of those questions at the wrong
one.
## The probe measured the build host
The c-abi verification probe selected no target on every freestanding build.
`Toolchain::crossTargetFlag` is set for hosted targets only --- its own
comment states the reason --- and a freestanding target's `--target` travels
with the ISA flags that must accompany it, in `mcpp.freestanding.linkline`,
which the probe never asked. `cenv::realise` adds none either. The command
line was therefore `-D__unix__ -fno-short-wchar -ffreestanding -x c++ -E -dM
-`, and clang answered for the machine it was running on.
On a Linux host that machine satisfies `__unix__` defined, `_WIN32`
undefined, 32-bit `wchar_t`, so the check passed for the wrong reason. On a
Windows host it reported `_WIN32` defined and a 16-bit `wchar_t`, and
2026.9.18.3 read those two as a `--target=` substitution failing to strip
host predefines. Clang's predefines follow the target: `--target=
riscv64-none-elf` on a Linux host reports `__riscv`, no `__linux__`, and
`__SIZEOF_WCHAR_T__` 4. Had that flag been on the command line it would have
answered 4 rather than 2; 2 is the evidence that it was absent.
The probe now receives the freestanding compile prefix. `hostStripMacros` is
removed, and its removal is the point rather than a tidy-up: it deleted the
one piece of evidence that said the probe was measuring the wrong machine.
`cenv_probe::assemble_argv` holds the invariant --- every piece is
legitimately empty in some configuration, so none of them could carry it at
the call site --- and refuses a freestanding argv that selects no target
while accepting a native hosted one, where the host IS the target and the
absence is the decision rather than its omission.
The three `hostStripMacros` tests are replaced. They pinned whether `-U`
reached the command line, which is the mechanism; what matters is whether the
probe measures the right machine, which is the property. The five new
`CenvProbeArgv` tests reach it with no cross toolchain at all.
## builtins: the conclusion stands, the mechanism beside it did not
`cenv.cppm` said clang's bundled `intrin.h` / `mm_malloc.h` were already
closed by `-nostdlibinc`. That flag removes the standard system include
directories and leaves clang's own resource directory in place, which is
what `-nobuiltininc` removes; with it present `intrin.h:12:15` still
reproduces, character for character the diagnostic mcpp-index recorded for
fmtlib.fmt. What closes both is the Cygwin-flavoured realisation:
`mm_malloc.h:42` selects `__mingw_aligned_malloc` on `__MINGW32__` and falls
to `posix_memalign` without it. No Windows loop-idiom builtin to disable, as
before.
## A capability is enumerated by the consumer, at resolution
openkal SPEC 0.14 §3.3 withdrew `hosted`, the one name it had given to a set
of interfaces, because a name describing a class of environment is falsified
by an environment nobody had in mind --- and that one was falsified inside
its own ecosystem within a release. Enumeration by the consumer replaced it.
mcpp now carries that enumeration for the `kernel-abi` layer:
`provides-interfaces` on the package that supplies it, `requires-interfaces`
on anyone.
The engine learns no member of either set. The only operation is a set
difference, so a specification may add an interface without a release of
mcpp, and a misspelling produces a refusal naming the string rather than a
silently disabled check. A graph whose provider states nothing keeps
building: a package that states nothing is not a package that provides
nothing.
## [c-abi.absent]: enumerate the exception, not the rule
POSIX has about twelve hundred names and enumerating them is the mistake
§3.3 records withdrawing. The exceptions are enumerable --- openkal-musl's
README lists six, in prose that nothing executes and that was contradicted
once already. `form` is required and closed: `link` is the shape openkal's
own model requires of an implementation (§6.1 calls a run-time report of
unsupportedness a defect), and the other two are departures from it, named so
that a departure is something that can be counted. mcpp reads the list back
when a link names a `link`-shaped entry.
## presents is frozen
docs/22 now states that `presents` answers which environment-identity macros
source sees and answers nothing about capability, and that its value set does
not grow --- for the reason openkal gives for closing its core set.
Design: .agents/docs/2026-09-20-openkal-c-environment-ecosystem-design.md
Review: .agents/docs/2026-09-20-issue-674-design-review.md
Co-authored-by: Claude Code <noreply@anthropic.com>1 parent 361874d commit cbb1a07
23 files changed
Lines changed: 3334 additions & 251 deletions
File tree
- .agents/docs
- docs
- zh
- modules
- manifest/src
- versioning/src
- src
- build
- toolchain
- tests
- e2e
- unit
Lines changed: 359 additions & 0 deletions
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
Large diffs are not rendered by default.
Lines changed: 842 additions & 0 deletions
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
8 | 116 | | |
9 | 117 | | |
10 | 118 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
0 commit comments