[FEATURE] Implement the C runtime and libc required by the admitted toolchain #1
Open
opened 2026-09-12 07:56:26 +02:00 by erikinkinen
·
8 comments
No Branch/Tag specified
main
feature/offline-workspace-source-catalog
feature/remaining-memory-string-family
feature/initialized-thread-main-c418114
feature/initialized-thread-main-f90e6ad
feature/initialized-thread-runtime-68fd72b
feature/locale-byte-comparisons-9a95378
feature/cargo-cleanup-evidence-5905f80
feature/closed-runtime-custody-39c62c7
feature/closed-runtime-custody-b001946
feature/runtime-dependency-routing-c8778a1
feature/bounded-strings-current-main-8df9df7
feature/bounded-string-span-reconciled-26bd172
feature/initialized-thread-images
feature/bounded-string-copy-concatenation
feature/string-set-queries-reconciled-8cace44
feature/bounded-writers-reconciled-2000b5c
feature/thread-image-rustdoc-213525a
feature/qualify-105-9842dc5
feature/terminal-symbol-coverage-merge-ready-a3d1e0dd
feature/native-c-owner-cohort-merge-ready-762b46b0
feature/thematic-runtime-command-owner-merge-ready-3db6ea3d
feature/physical-terminal-modem-reception-merge-ready-b8355361
feature/physical-terminal-line-configuration-merge-ready-a455e079
feature/terminal-timed-break-merge-ready-c8651d49
feature/terminal-software-flow-merge-ready-dba77fad
feature/terminal-drain-deferred-settings-merge-ready-4ba8a472
feature/terminal-queue-flush-merge-ready-566a529c
feature/namespaced-terminal-attributes-merge-ready-79e125e8
feature/native-producer-cleanup-receipts
feature/caller-owned-termios-speeds-merge-ready-408f60a7
feature/terminal-identification-window-controls-merge-ready-5007e5e4
feature/explicit-c-clock-sleep-merge-ready-defebcf2
feature/checked-c-time-arithmetic-merge-ready-8bec6563
feature/caller-owned-multibyte-conversion-merge-ready-9c424681
feature/mediated-c-pipe-creation-merge-ready-09240feb
feature/mediated-poll-select-merge-ready-f4908182
feature/native-command-lifetime-closure-merge-ready-0de5d405
feature/mediated-directory-iteration-merge-ready-5df7b52c
feature/mediated-process-directory-reports-merge-ready-46c5a51e
feature/freestanding-string-call-controls-merge-ready-751731dd
feature/cxx-end-copy-refusal-diagnostics-merge-ready-5422af14
feature/counted-c-file-timestamps-merge-ready-8fd5fbde
feature/mediated-c-file-interfaces-merge-ready-88a608ef
feature/generated-cargo-evidence-retirement-merge-ready-c63ca132
feature/generated-cargo-evidence-retirement-merge-ready-079bc00b
feature/checked-runtime-helper-closure-merge-ready-1b16f95d
feature/checked-runtime-helper-closure-merge-ready-0caf969f
feature/process-root-descriptor-adapters-merge-ready-15e72138
feature/mutable-process-environment-merge-ready-bf3fd43c
feature/caller-owned-string-tokenization-merge-ready-26200b2a
feature/caller-owned-string-tokenization-merge-ready-15850f6b
feature/heap-owned-string-duplication-merge-ready-50d7996c
feature/native-process-startup-exit-merge-ready-95249cec
feature/heap-owned-string-duplication-merge-ready-1239c6a6
feature/native-process-startup-exit-merge-ready-06cd4f4d
feature/native-process-startup-exit-merge-ready-2055caa2
feature/shared-process-heap-merge-ready-3f6b2353
feature/shared-process-heap-merge-ready-66e7ead8
feature/shared-process-heap-merge-ready-d9c56e70
feature/cxx-memory-string-headers-merge-ready-e25a9efa
feature/destination-end-byte-copy-merge-ready-a535f50a
feature/destination-end-string-copies-merge-ready-72ecd27a
feature/destination-end-string-copies-merge-ready-8b7dc2a1
feature/fixed-locale-character-operations-merge-ready-06dd1a8b
feature/fixed-locale-integer-conversions-merge-ready-a939433f
feature/fixed-c-error-catalog-merge-ready-8519ed2d
feature/constant-storage-substring-search-merge-ready-e5e99498
feature/terminal-symbol-coverage
feature/native-c-pure-owner-cohort
feature/canonical-native-owner-cohort-merge-ready-132c7116
feature/native-runtime-source-profile-merge-ready-46258a04
feature/canonical-native-owner-cohort
feature/native-runtime-source-profile
feature/generic-caller-native-owner-merge-ready-6cdd34c8
feature/native-memory-intrinsics
feature/current-locale-multibyte
feature/native-c-owner-cohort
feature/freestanding-string-call-controls
feature/fixed-locale-character-operations
feature/fixed-c-error-catalog
feature/dependency-review-policy-merge-ready-bdfcfbd3
feature/runtime-preparation-diagnostics-merge-ready-3c35f2d9
fix/runtime-preparation-diagnostics-merge-ready-3c35f2d9
feature/source-closure-entry-diagnostics-merge-ready-3f309b84
fix/source-closure-entry-diagnostics-merge-ready-3f309b84
feature/generic-caller-native-owner-merge-ready-e90c0113
perf/generic-caller-native-owner-merge-ready-e90c0113
feature/standard-multibyte-headers-merge-ready-d4324a13
feature/native-process-owner-cohort-merge-ready-31cd92b2
feature/terminal-speed-alias-controls-merge-ready-8c4601e0
feature/cxx-header-callback-controls-merge-ready-e7cfcc9e
feature/explicit-c-sort-search-merge-ready-b7495bce
feature/native-runtime-scope-contract-merge-ready-0b8dcc3b
feature/native-c-owner-compiler-cohort
feature/owned-directory-streams
feature/bounded-string-span-queries
feature/counted-c-file-timestamps
feature/mediated-c-file-interfaces
feature/generated-cargo-evidence-retirement
feature/explicit-c-clock-sleep
feature/terminal-identification-window-controls
feature/mediated-c-pipe-creation
feature/mediated-poll-select
feature/mediated-process-directory-reports
feature/compatibility-runtime-packaging
feature/thread-image-alignment
fix/ci-owned-helper-exclusion
feature/locale-byte-string-comparisons
feature/runtime-custody-hold-diagnostics
fix/workspace-companion-link-ownership
perf/generic-caller-native-owner
feature/raw-live-scope-freshness
fix/runtime-preparation-diagnostics
fix/source-closure-entry-diagnostics
fix/retained-rust-probe-dependencies
fix/deliberate-crash-core-policy
fix/startup-source-contract
fix/wide-string-link-rejection
feature/native-c-owner-input-cohort
feature/standard-multibyte-headers
fix/runtime-toolchain-compatibility
fix/retained-runtime-probe-dependencies
fix/ci-workspace-source-exclusions
build/native-c-owner-compiler-cohort
feature/process-thread-locales
feature/owned-thread-runtime-state
feature/cxx-memory-string-headers
feature/dependency-review-policy
feature/destination-end-byte-copy
feature/destination-end-string-copies
feature/explicit-c-sort-search
feature/constant-storage-substring-search
feature/fixed-locale-integer-conversions
feature/native-runtime-scope-contract
feature/fixture-rustdoc-boundaries
feature/freestanding-length-probe
feature/string-span-probe-framing
feature/native-producer-receipt-contract
feature/freestanding-c-memory
feature/readonly-byte-string-queries
feature/native-process-owner-cohort
feature/terminal-speed-alias-controls
feature/physical-terminal-modem-reception
feature/posix-runtime-formatting
feature/thematic-runtime-command-owner
feature/physical-terminal-line-configuration
feature/terminal-timed-break
feature/terminal-drain-deferred-settings
feature/terminal-queue-flush
feature/terminal-software-flow
feature/caller-owned-termios-speeds
feature/namespaced-terminal-attributes
feature/checked-c-time-arithmetic
feature/caller-owned-multibyte-conversion
feature/native-command-lifetime-closure
feature/cxx-header-callback-controls
feature/mediated-directory-iteration
feature/cxx-end-copy-refusal-diagnostics
feature/checked-runtime-helper-closure
feature/process-root-descriptor-adapters
feature/caller-owned-string-tokenization
feature/heap-owned-string-duplication
feature/mutable-process-environment
feature/native-process-startup-exit
feature/shared-process-heap
feature/ordinary-startup-owner-cohort
feature/owned-c-runtime-ci-graph
feature/ci-source-acquisition
feature/posix-compat
No results found.
Labels
Clear labels
alpha-1
EriX Alpha 1 release acceptance
bug
Something is not working
ci
docs
duplicate
This issue or pull request already exists
enhancement
New feature
help wanted
Need some help
invalid
Something is wrong
performance
Measured performance profiling, bottleneck analysis, and regression budgets.
phase-6
Phase 6: POSIX compatibility, full EriX self-hosting, and its required audits and validation.
question
More information is needed
refactor
Code cleanup, removal of obsolete paths, and structural improvements preserving behavior.
security
wontfix
This won't be fixed
No labels
alpha-1
bug
ci
docs
duplicate
enhancement
help wanted
invalid
performance
phase-6
question
refactor
security
wontfix
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Dependencies
No dependencies set
Reference
erix/lib-cstd#1
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem and motivation
Compilers and build tools running inside EriX need a C runtime with real startup,
allocation, per-thread errors, stdio and POSIX behavior.
Proposed behavior and scope
Provide libc artifacts, headers, startup objects and the interfaces required by
the selected toolchain. The current byte/string contract covers nineteen
operations, including substring search.
Native memory, initialized-thread support and the
explicit error catalog
have separate source and link contracts. The catalog describes all 40 local/scalar assigned
EriX errors and supports complete copies into caller-owned storage. The separate integer conversion companion
provides four explicit fixed C-locale LP64 calls with full-width limits, exact
end pointers and error-only original thread errno writes. Remaining interfaces
must follow the admitted workload inventory.
The separate character and sorting companions supply fixed C-locale ASCII calls
and allocation-free
qsort/bsearchwith conventional and prefixed C names.Their callback and relocation contracts are documented in the matching manual.
Authority, security and reliability
Initialize from validated launch input and use the caller's Posixd route for
mediated operations. Document pointer ownership, overflow, thread state and
fork/exec cleanup. Preserve original owners through partial failure and teardown.
Keep suspected vulnerabilities in the SECURITY.md reporting channel.
Apply security, reliability and performance in that order.
Acceptance criteria
symbol versions and the supported C ABI.
runtime state without ambient discovery.
failure atomicity, zeroing and threaded behavior.
copies; complete original ABI/guard/link checks and coherent source,
Integration and manual/API adoption.
and workload mappings, preserving interruption and partial I/O.
streams with their lifetime and return contracts.
behavior through required VM and warning-free CI gates.
partial I/O, flush, locking, locale, numeric bounds and varargs.
and math interfaces.
explicit unsupported behavior rather than success-returning stubs.
allocation, stdio, files, threads, signals and process lifecycle.
documentation and actual guest workloads.
Require formatting, strict Clippy, unit/doctests and warning-denied builds for
affected Rust configurations, plus relevant VM regressions. Keep meaningful
rustdoc and
missing_docsenforcement in every crate, update component/manual/APIdocuments, and keep authored code below 1,000 physical lines.
Alternatives and tradeoffs
Implement the required semantics directly. Stubs would hide missing behavior;
unsupported extensions need an explicit decision and tool configuration or port.
Tracking and rollout
Libc review,
ABI,
Posixd,
Kernel,
manual review,
Integration review,
phase completion.
Both full EriX guest build generations and the external Rust/LLVM rebuild inside
EriX remain required.
The local catalog includes ERANGE=40; existing compatibility 1.25, NBF1 and NJR1 packets retain assignments 1–39. Catalog lookup does not emit those packets or supply native error mapping.
[FEATURE] [P10] Implement the C runtime and libc required by the admitted toolchainto [FEATURE] Implement the C runtime and libc required by the admitted toolchainerikinkinen referenced this issue from erix/kernel2026-10-04 13:21:28 +02:00
erikinkinen referenced this issue from erix/integration2026-10-04 13:21:29 +02:00
erikinkinen referenced this issue from erix/launchd2026-10-04 15:16:41 +02:00
erikinkinen referenced this issue from erix/lib-ipc2026-10-04 15:16:45 +02:00
erikinkinen referenced this issue from erix/lib-stdio2026-10-04 15:16:47 +02:00
erikinkinen referenced this issue from erix/loaderd2026-10-04 15:16:49 +02:00
erikinkinen referenced this issue from erix/posixd2026-10-04 15:16:51 +02:00
erikinkinen referenced this issue from erix/procd2026-10-04 15:16:52 +02:00
erikinkinen referenced this issue from erix/timed2026-10-04 15:16:54 +02:00
erikinkinen referenced this issue from erix/ttyd2026-10-04 15:16:54 +02:00
erikinkinen referenced this issue from erix/vfsd2026-10-04 15:16:54 +02:00
erikinkinen referenced this issue from erix/lib-capabi2026-10-11 10:21:45 +02:00
erikinkinen referenced this issue from erix/exsh2026-10-11 13:41:44 +02:00
erikinkinen referenced this issue from erix/bootloader2026-10-11 22:30:51 +02:00
erikinkinen referenced this issue from erix/dynlinkd2026-10-11 22:30:52 +02:00
erikinkinen referenced this issue from erix/lib-dynlink2026-10-11 22:30:53 +02:00
erikinkinen referenced this issue from erix/lib-elf2026-10-11 22:30:54 +02:00
erikinkinen referenced this issue from erix/rootd2026-10-11 22:30:55 +02:00
erikinkinen referenced this issue from erix/blockd2026-10-11 23:35:13 +02:00
erikinkinen referenced this issue from erix/coreutils2026-10-11 23:35:14 +02:00
erikinkinen referenced this issue from erix/crashd2026-10-11 23:35:14 +02:00
erikinkinen referenced this issue from erix/deviced2026-10-11 23:35:14 +02:00
erikinkinen referenced this issue from erix/drv-acpi2026-10-11 23:35:16 +02:00
erikinkinen referenced this issue from erix/drv-i80422026-10-11 23:35:16 +02:00
erikinkinen referenced this issue from erix/drv-ps2-keyboard2026-10-11 23:35:17 +02:00
erikinkinen referenced this issue from erix/drv-ps2-mouse2026-10-11 23:35:17 +02:00
erikinkinen referenced this issue from erix/drv-rtc-cmos2026-10-11 23:35:18 +02:00
erikinkinen referenced this issue from erix/drv-serial2026-10-11 23:35:18 +02:00
erikinkinen referenced this issue from erix/drv-virtio-block2026-10-11 23:35:19 +02:00
erikinkinen referenced this issue from erix/e2fsd2026-10-11 23:35:19 +02:00
erikinkinen referenced this issue from erix/extop2026-10-11 23:35:20 +02:00
erikinkinen referenced this issue from erix/fatd2026-10-11 23:35:20 +02:00
erikinkinen referenced this issue from erix/fbcond2026-10-11 23:35:21 +02:00
erikinkinen referenced this issue from erix/hotplugd2026-10-11 23:35:21 +02:00
erikinkinen referenced this issue from erix/inputd2026-10-11 23:35:22 +02:00
erikinkinen referenced this issue from erix/irqd2026-10-11 23:35:23 +02:00
erikinkinen referenced this issue from erix/keyd2026-10-11 23:35:36 +02:00
erikinkinen referenced this issue from erix/lib-block2026-10-11 23:35:37 +02:00
erikinkinen referenced this issue from erix/lib-bootstrap2026-10-11 23:35:38 +02:00
erikinkinen referenced this issue from erix/lib-driver2026-10-11 23:35:39 +02:00
erikinkinen referenced this issue from erix/lib-input2026-10-11 23:35:39 +02:00
erikinkinen referenced this issue from erix/lib-interrupt2026-10-11 23:35:40 +02:00
erikinkinen referenced this issue from erix/lib-log2026-10-11 23:35:42 +02:00
erikinkinen referenced this issue from erix/lib-posixabi2026-10-11 23:35:43 +02:00
erikinkinen referenced this issue from erix/lib-service2026-10-11 23:35:43 +02:00
erikinkinen referenced this issue from erix/lib-time2026-10-11 23:35:44 +02:00
erikinkinen referenced this issue from erix/lib-tty2026-10-11 23:35:45 +02:00
erikinkinen referenced this issue from erix/lib-vfs2026-10-11 23:35:45 +02:00
erikinkinen referenced this issue from erix/logd2026-10-11 23:35:46 +02:00
erikinkinen referenced this issue from erix/memd2026-10-11 23:35:46 +02:00
erikinkinen referenced this issue from erix/named2026-10-11 23:35:47 +02:00
erikinkinen referenced this issue from erix/pagerd2026-10-11 23:35:47 +02:00
erikinkinen referenced this issue from erix/powerboxd2026-10-11 23:35:48 +02:00
erikinkinen referenced this issue from erix/probed2026-10-11 23:35:49 +02:00
erikinkinen referenced this issue from erix/ramfsd2026-10-11 23:35:50 +02:00
erikinkinen referenced this issue from erix/seriald2026-10-11 23:35:51 +02:00
erikinkinen referenced this issue from erix/vspaced2026-10-11 23:35:52 +02:00
The signed substring implementation adds
strstrto the nineteen byte/string operations. It preserves the first match using constant local storage and leaves input permissions, lifetime and errno unchanged. The manual/API and Integration selection now match the complete body/alias cohort. Full libc, actual compatibility workloads and guest builds remain open. Native CI admission remains tracked in Integration #113.The error catalog implementation is signed and pushed. It provides fixed C-locale descriptions and canonical names for all 39 assigned EriX errors, plus complete copies into caller-owned buffers. Unknown signed values and short buffers write nothing; these calls neither consult locale nor change errno. The error companion is separate, and compatibility packaging includes its original immutable data.
Integration and manual/API adoption are underway. Conventional error interfaces, further errno assignments, native mappings and mediated diagnostics remain open. The current CI run still stops at the runner prerequisite before assembly; it does not establish component acceptance.
The fixed C-locale catalog is implemented for all 39 assigned errors, with immutable message/name lookups and whole caller-buffer copies. Integration and the manual now cover the three exported operations. Thread error adapters, locale interfaces and complete native workloads remain open.
I propose adding four explicitly fixed-C-locale integer conversions:
erix_c_strtol,erix_c_strtoul,erix_c_strtollanderix_c_strtoull. The Rust declarations will use the same original x86_64LP64/System V bodies. Signed results cover the complete i64 range; unsigned
results cover the complete u64 range. Long and long long share their signed or
unsigned implementation because both are 64 bits on this target.
The grammar follows the C/POSIX locale in
POSIX.1-2024 strtol/strtoll
and
strtoul/strtoull:
the six ASCII whitespace bytes, an optional sign, base zero or bases 2 through
36, and case-insensitive digits. Base zero selects decimal, octal or
hexadecimal. A hexadecimal prefix is consumed only when followed by a
hexadecimal digit. There is no binary-prefix extension. Parsing stops at the
first byte outside the selected digits; overflow still consumes the complete
digit sequence. No input length ceiling, allocation or repeated prefix scan is
introduced.
Successful conversion preserves errno. No conversion returns zero, restores
the original input pointer through a nonnull end pointer and preserves errno;
this chooses the standard's optional no-conversion error behavior explicitly.
An invalid base returns zero and sets the original thread's EINVAL without
reading the input or touching the end pointer. Signed overflow returns the
appropriate limit; unsigned magnitude overflow returns UINT64_MAX. Both set
the assigned local ERANGE40. A representable unsigned magnitude with a minus
sign is negated modulo 2^64. For a valid base, the end pointer reports the complete converted prefix,
including after overflow.
Callers supply readable input, optional writable end-pointer storage and an
already admitted original EriX thread image whenever errno is accessed. End-pointer
storage must be exclusive and disjoint from the input and original thread image;
a returned raw cursor grants no write permission or longer input lifetime. The
invalid-base path requires no input or end-pointer storage because neither is
accessed. The
conversion acquires no mapping, endpoint or storage authority, retains no
pointer, and uses the existing initialized-thread errno accessor with no host
or global fallback. Input bytes, derived pointers, thread state and companion
code keep their existing ownership and lifetime obligations. Local ERANGE40
does not enlarge the older compatibility or thread-result packet domains.
A separate conversion companion will select both original parser and thread
roles explicitly. Compatibility packaging will include those same bodies;
memory-only, thread-only and catalog-only products stay unchanged. Source,
receipt and consumer contracts will distinguish this component. Conventional
strto*names and current/explicit-locale interfaces remain separate untillocale ownership is defined. This slice does not provide stdio, floating-point
conversion or full libc.
Independent literal Rust and freestanding C controls will cover every base,
integer limits, signs, prefix edges, end pointers, long inputs, guarded and
read-only storage, original thread errno isolation and call-state preservation.
Source-role, object, archive, alias, relocation and negative-link controls will
cover the complete producer/consumer graph. Documentation and the manual will
describe the same contracts. Host results will remain distinct from native
EriX execution and the required guest builds.
The fixed catalog now includes ERANGE=40 and its original message, name and complete caller-buffer copy. Earlier entries retain their bytes and unknown inputs still return without access. Integration and manual adoption are continuing; existing packet vocabularies and native mappings remain separate.
b15c0452 adds four explicit fixed C-locale integer conversions over one shared signed/unsigned parser. Base and prefix handling, full-width bounds, overflow endpoints and error-only original thread errno are implemented. The companion selects conversion and thread sources explicitly; compatibility keeps its existing receipt fields. The related GNU archive defect is closed. Integration consumers and generated manual/API references are being updated. Conventional aliases, locale ownership, floating conversion and stdio remain open.
The four explicit fixed C-locale LP64 conversions are published in Cstd b15c0452, with matching Integration source selection and manual/API pages. Bases, full-width bounds, overflow and digit endpoints use one parser. Success and no-conversion leave errno unchanged; errors write only the already admitted original thread errno. Locale, floating conversions, stdio and complete libc remain open.
Signed 7e42dbc7 adds allocation-free
qsortandbsearch, with conventional and prefixed C entry points. The caller supplies the array and comparator; the runtime acquires no allocator, locale, thread or service state. The callback and bytewise relocation contracts are documented. Matching manual/API work is underway in Docs PR4.