EriX C runtime and POSIX libc adapters using explicitly granted compatibility-service authority.
  • Python 45.6%
  • Rust 24.6%
  • C 19.8%
  • Assembly 10%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Erik Inkinen 63dcb72dc6
All checks were successful
CI / memory (push) Successful in 47s
CI / thread (push) Successful in 25s
CI / markdown (push) Successful in 2s
Merge lib-cstd #27 into main
2026-11-21 08:23:30 +02:00
.github ci: Carry the reviewed process owner in runtime packaging 2026-11-13 02:34:55 +02:00
docs docs: Repair Markdown paragraph wrapping 2026-11-07 14:35:46 +02:00
include/erix/cstd feat: Provide explicit original initialized-thread primitives 2026-10-30 19:58:15 +02:00
runtime feat: Provide explicit original initialized-thread primitives 2026-10-30 19:58:15 +02:00
scripts ci: Reconcile initialized-thread support with embedded memory providers 2026-11-21 08:15:24 +02:00
src ci: Reconcile initialized-thread support with embedded memory providers 2026-11-21 08:15:24 +02:00
tests build: Enforce rustdoc lint in the thread image fixture 2026-11-21 05:59:10 +02:00
.editorconfig Initial commit 2026-09-12 07:49:11 +02:00
.gitignore Initial commit 2026-09-12 07:49:11 +02:00
.markdownlint-cli2.yaml Initial commit 2026-09-12 07:49:11 +02:00
ARCHITECTURE.md ci: Reconcile initialized-thread support with embedded memory providers 2026-11-21 08:15:24 +02:00
Cargo.toml feat: Embed canonical native memory intrinsics 2026-11-14 03:00:29 +02:00
CODE_OF_CONDUCT.md Initial commit 2026-09-12 07:49:11 +02:00
CONTRIBUTING.md Initial commit 2026-09-12 07:49:11 +02:00
LICENSE Initial commit 2026-09-12 07:49:11 +02:00
README.md ci: Reconcile initialized-thread support with embedded memory providers 2026-11-21 08:15:24 +02:00
ROADMAP.md ci: Reconcile initialized-thread support with embedded memory providers 2026-11-21 08:15:24 +02:00
rustfmt.toml Initial commit 2026-09-12 07:49:11 +02:00
SECURITY.md Initial commit 2026-09-12 07:49:11 +02:00

EriX C Byte and String Runtime

See the original initialized-thread runtime contract for explicit original thread images, C accessors, producer selection and lifetime obligations.

lib-cstd provides freestanding byte-memory and string operations for EriX: memcpy, memmove, memset, memcmp, strlen, strcmp, strncmp, memchr, strchr, strrchr, strcpy, strncpy, strcat, strncat, strspn, strcspn, strpbrk and strnlen. A dependency-free no_std Rust interface and partial C headers use one explicitly selected assembler companion.

See ARCHITECTURE for pointer and link contracts, ROADMAP for validation and integration status, and the design issue for scope.

Purpose of This Repository

The canonical x86_64 SysV ELF bodies are memory, string queries and string writers, together with byte-set queries. Rust declarations use namespaced symbols; the selected object policy can also provide conventional C aliases. Link exactly one companion object. A Cargo rlib alone contains declarations, and omitting the companion must fail to link a call.

The partial C interfaces are memory.h and string.h. They do not provide complete standard complete libc headers, startup, allocation or POSIX service routing. Separate initialized-thread declarations and partial errno headers require the explicit thread companion and an admitted original EriX thread image. Callers own valid memory ranges. String queries read initialized bytes, with NUL/count termination and returned-pointer obligations documented in each Rust declaration. String writers require nonoverlapping ranges and caller-owned capacity; strncpy pads to its count, while strncat appends one NUL without padding. Neither count validates the destination size. strnlen reads through the first NUL or its maximum count; a full bounded array need not contain a terminator. The returned length grants no memory access. The byte-set queries permit read-only overlap and exclude NUL from membership. Each uses 32 bytes of ordinary stack scratch, with no red-zone dependence, shared state or added CPU feature. Returned pointers retain source permissions.

To build a core-only object for host Rust tests, explicitly select the original Integration process owner from commit d68a95870076c3435b1a5ab36440d0941b5ab45e and installed LLVM tools. The output parent must exist and the selected output directory must be fresh:

ERIX_PROCESS_OWNER=/absolute/pinned/integration/scripts/cargo_source_metadata.py
mkdir -p out
python3 -IB scripts/build-c-runtime.py \
  --source "$PWD" --output "$PWD/out/core" --policy core \
  --target x86_64-unknown-none --assembler /usr/bin/llvm-mc \
  --archiver /usr/bin/llvm-ar --process-owner "$ERIX_PROCESS_OWNER" \
  --hard-seconds 60 --stall-seconds 30 --log-bytes 4194304 \
  --input-bytes 536870912
CARGO_ENCODED_RUSTFLAGS="$(printf '%s\037%s' '-Dwarnings' \
  "-Clink-arg=$PWD/out/core/erix-c-memory.o")" cargo test --offline

Use --policy public for a conventional C or mixed C/Rust final link, and --policy hidden for native shared-object ownership. The validation driver accepts explicit compiler, sysroot, header-resource and inspection-tool paths and exercises the complete host/freestanding matrix. Its --help describes the finite command budgets. No tool is discovered by the producer, and its child environment is scoped.

Clean-Room Policy

All implementation and fixtures are original EriX work. The four memory bodies retain the preceding Integration instructions; the validation driver extracts that exact historical literal without executing its generator. The string queries and writers are original scalar implementations derived from their contracts. No third-party implementation or host libc supplies an acceptance function.

License

All EriX-authored source is licensed under the ISC License.

Development Model

Security, reliability and performance are prioritized in that order. Keep unsafe pointer obligations explicit, deny missing Rust documentation and retain failure evidence. Tests execute the selected object and independent byte oracles; failed, missing or warningful evidence is not acceptance.

Governance Principles

Use the canonical contribution and security policies. Component documentation specializes the shared meta formats; shared governance files stay unchanged.

Policy Boundaries

This repository owns the byte/string implementation and its explicit link contract. Integration owns native image assembly and later selected-source migration. Neither numeric pointers nor a successful host test grant guest memory authority or establish a self-hosted build.

Native Rust consumers can enable memory-intrinsics to link the four canonical memory primitives through the rlib. Select one memory provider at the final link. String calls still need their companion; accessed ranges remain the caller's responsibility. See Architecture for the boundary.

Contact

Development takes place in the EriX organization. Use the design issue for reviewable scope and the repository security policy for sensitive findings.