Link canonical native memory intrinsics #115

Manually merged
erikinkinen merged 1 commit from feature/native-memory-intrinsics into main 2026-11-14 18:39:30 +01:00
Owner

Add the opt-in memory-intrinsics feature so native Rust consumers can link the canonical memory implementation through the crate. It supplies memcpy, memset, memmove and memcmp from the existing assembly, with the same instructions and caller-owned range, aliasing and lifetime requirements.

The final link selects one memory provider. String operations continue to use their separate companion. The Cargo matrix checks both choices and the actual embedded object, including missing/duplicate-provider refusals.

Needed by the native consumer in Exsh #132.

  • Embed the canonical memory bodies and four C aliases without adding runtime services.
  • Exercise supported default/feature builds, original oracles and actual Cargo object checks.
  • Complete public CI for this commit.
Add the opt-in `memory-intrinsics` feature so native Rust consumers can link the canonical memory implementation through the crate. It supplies `memcpy`, `memset`, `memmove` and `memcmp` from the existing assembly, with the same instructions and caller-owned range, aliasing and lifetime requirements. The final link selects one memory provider. String operations continue to use their separate companion. The Cargo matrix checks both choices and the actual embedded object, including missing/duplicate-provider refusals. Needed by the native consumer in [Exsh #132](https://git.erikinkinen.fi/erix/exsh/pulls/132). - [x] Embed the canonical memory bodies and four C aliases without adding runtime services. - [x] Exercise supported default/feature builds, original oracles and actual Cargo object checks. - [x] Complete public CI for this commit.
feat: Embed canonical native memory intrinsics
All checks were successful
CI / memory (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / markdown (push) Successful in 2s
CI / memory (push) Successful in 38s
7c560312f6
Allow a native Rust consumer to select only the existing scalar memory bodies and four C ABI aliases in its actual rlib. Reuse the canonical assembly files without changing the algorithms, direction flag, pointer contracts or export scope. Keep the external companion path as the default, and select a string-only companion for embedded-memory Rust tests so each link has exactly one memory provider.
erikinkinen added this to the Alpha 1 milestone 2026-11-14 02:03:08 +01:00
erikinkinen changed title from WIP: Link canonical native memory intrinsics to Link canonical native memory intrinsics 2026-11-14 03:44:54 +01:00
Author
Owner

The opt-in linkage feature is complete and WIP has been removed. It retains the canonical instruction bodies and exports only the four memory aliases; Exsh’s actual native link also selects that same Cargo-produced object. This does not establish Exsh’s remaining source/type or guest acceptance.

The opt-in linkage feature is complete and WIP has been removed. It retains the canonical instruction bodies and exports only the four memory aliases; Exsh’s actual native link also selects that same Cargo-produced object. This does not establish Exsh’s remaining source/type or guest acceptance.
erikinkinen manually merged commit 6450b0e35b into main 2026-11-14 18:39:30 +01:00
Sign in to join this conversation.
No description provided.