[BUG] Dynamic kernel build cannot resolve allocation shim symbols with Rust 1.97.1 #19

Open
opened 2026-09-12 13:41:30 +02:00 by erikinkinen · 0 comments
Owner

Summary

The originally reported dynamic kernel image builder fails with Rust 1.97.1 because its allocation
shim discovery requires a symbol that the selected target-none liballoc no longer
references. A development image cannot reach package or disk-image completion.
This is a host build compatibility report; no guest failure is claimed.

A reviewed correction makes the legacy panic-policy function optional only when
it is absent from the selected unresolved symbol set. The actual Rust 1.97.1
target-none kernel fixture now passes with that correction. Published-checkpoint CI now passes development and release image construction
and canonical boots. Its actual compiler version is not printed, so complete
Rust 1.97.1 image attribution remains pending; this issue stays open.

Reproduction

Use original Integration e2b1cf5995 with installed
Rust 1.97.1, its x86_64-unknown-none sysroot, and explicit LLVM nm 22.1.8.
The following read-only symbol inspection is sufficient to show the missing input
to scripts/build-dynlink-kernel-artifact.py's build_runtime_shim function:

target_libdir="$(RUSTUP_TOOLCHAIN=1.97.1 rustc --print target-libdir --target x86_64-unknown-none)"
llvm-nm -u "$target_libdir"/liballoc-*.rlib | rg 'rust_.*alloc'

In one retained original-source build, scripts/build-all.sh with an explicit
components selection for kernel fec1113a259c3cfff7d2dd942409b7f3f9df5e64,
release kernel profile, runtime services and original runtime.dev.toml reached
this failure after compiling the bootloader and generating shared objects.
Dependencies were original immutable Git sources; no path patches or replacement
commits were used.

Expected and actual behavior

Expected: a supported selected toolchain either produces the declared runtime
shim correctly or is rejected with a precise unsupported-toolchain diagnostic.

Actual: the kernel job reports
kernel: failed to discover target-none Rust allocation shim symbols and
dynamic artifact build failed: kernel; the complete build stage exits 1.
No package or disk-image stage is started. The builder requires nonempty
no_alloc, should_panic and error_handler symbol groups at lines 775–786, but the
selected liballoc has no allocation-error-handler-should-panic reference.

Correction behavior: the no-alloc marker and terminal error handler remain
mandatory singleton functions. The legacy should-panic accessor is admitted
only zero or one time, and all admitted functions must share one complete
compiler namespace. The recognizer accepts the observed v0 function identifiers
and their exact lengths; unsupported data forms, future variants, malformed
prefixes/suffixes and ambiguous relevant symbols fail before assembly.
Repeated references to the same symbol are one identity. An unsupported legacy
accessor cannot be mistaken for optional absence.

The existing no-alloc ret, legacy accessor xor %eax, %eax; ret, and terminal
cli; 1:; hlt; jmp 1b instructions and ordering are preserved. Only an absent
accessor's complete declarations and body are omitted. This adds no allocator,
allocation/deallocation implementation, allocation-success behavior, capability
authority or runtime service.

Environment and identity

  • Integration builder: e2b1cf5995.

  • Kernel: fec1113a259c3cfff7d2dd942409b7f3f9df5e64; original unrelated catalog
    revisions, including the separate linked Integration runtime, were retained.

  • Compiler: Rust 1.97.1, commit 8bab26f4f68e0e26f0bb7960be334d5b520ea452,
    LLVM 22.1.6; symbol inspection: llvm-nm 22.1.8, exit 0.

  • Target: x86_64-unknown-none. liballoc-803a2bae416eb7d8.rlib SHA-256:
    9ed458fa604ebe8b9cae608e589335c3ca2dbf422ddb0ba20b659fc4569bbfa5.

  • Host development build with two Cargo jobs, release kernel/runtime configuration,
    45-minute hard and five-minute output-stall bounds; no VM was run.

  • No production signing key or runtime capability change was involved.

  • No last-known-working complete image/toolchain is established by this report.

  • Correction checkpoint: e67e4d3ad9596b435bdc44fd5ee716210cddb601. The host validation
    used the reviewed correction over original Integration
    2604971484facb4910d8f030818dc01f83e57816, selected Rust 1.97.1 and its original
    target-none support. The selected C memory companion remained original
    lib-cstd 8270170c221260c444d923865461231e6ce622b2.

Evidence and prior checks

The retained liballoc nm result contains these relevant references:

_RNvCs9wFQrvczXsK_7___rustc26___rust_alloc_error_handler
_RNvCs9wFQrvczXsK_7___rustc35___rust_no_alloc_shim_is_unstable_v2

The distinct should-panic group is empty. The actual kernel build failure and
successful symbol inspection are retained with source, executable, sysroot,
command, output and process status receipts. Earlier preparation failures were
retained separately and are not counted as a successful image build.

A read-only inspection of installed Rust 1.93.0, compiler commit
254b59607d4417e9dffbc307138ae5c86280fe4c, finds all three groups, including
_RNvCshXwFllX56pT_7___rustc42___rust_alloc_error_handler_should_panic_v2.
Its liballoc-734a345130e07632.rlib SHA-256 is
dcb05b43fdb159df01de7f35c6bdf2cb03f9403e54f91fc114007ff9706c6061.
That symbol compatibility check is not complete build or runtime acceptance.
Cargo capability-query diagnostics are retained separately from artifact
compilation/link warnings according to their exact arguments and purpose.

The correction's nine literal allocator-contract tests and one retained legacy
instruction test pass. Their independently written cases cover the old
three-function and new two-function sets, missing required roles, duplicate
roles, mixed namespaces, unsupported related names and exact emitted instruction
arrays. These host tests do not execute the privileged terminal stub.

The actual selected Rust 1.97.1 kernel artifact fixture also passes: exit 0 in
6.174104 seconds, with no owner failure or cleanup error. It compiles the
authored kernel and five independent dependency artifacts, validates their
manifest/ELF metadata and requires each of the five distinct implementation
exports to remain undefined and relocated in the kernel. The inherited test's
legacy Rust name-prefix assumption was replaced by this direct artifact
identity relation without changing compiler flags or runtime source. Existing
metadata, DT_NEEDED and bundled-dependency rejection checks remain. The
service-local and artifact-metadata fixtures subsequently passed as well.

The original discovery failure, the later inherited name-prefix assertion
failure and intervening fixture/setup failures remain separate retained
evidence. The earlier source comparison established that original 2604971
discovery and its extracted helper were equivalent before this correction.
No new whole image was built and no guest was run for this bounded validation.

At the exact correction checkpoint, CI 1587 passes all nine allocator-contract cases, all 486 catalog scenarios, actual development and release kernel/image generation, a byte-identical development rebuild and both canonical image boots. Both images pass their 65-artifact metadata audits. The complete source-correlated logs are retained. This establishes product-image progress at the published source, beyond the earlier local kernel fixture.

The workflow selects rust:latest and does not print the actual rustc version or compiler hash. These results therefore do not establish a complete Rust 1.97.1 product image. The workflow later fails the independent release serial native-time gate in #43, after the build and boot gates passed. That runtime observation neither reverses the completed build gates nor proves overall workflow acceptance.

Tracking

Owning component: Integration dynamic kernel image builder; component audit #11,
profiler work #3 and build-scope work #1. The current work is tracked in
PR #12.

The local Rust 1.97.1 kernel result and published-checkpoint full-image CI gates support the correction within their recorded scopes. Keep this issue open until a complete product-image result is tied to the originally affected Rust 1.97.1 compiler identity. The later native-time failure has its own issue; an older-toolchain image comparison remains separate evidence.

## Summary The originally reported dynamic kernel image builder fails with Rust 1.97.1 because its allocation shim discovery requires a symbol that the selected target-none liballoc no longer references. A development image cannot reach package or disk-image completion. This is a host build compatibility report; no guest failure is claimed. A reviewed correction makes the legacy panic-policy function optional only when it is absent from the selected unresolved symbol set. The actual Rust 1.97.1 target-none kernel fixture now passes with that correction. Published-checkpoint CI now passes development and release image construction and canonical boots. Its actual compiler version is not printed, so complete Rust 1.97.1 image attribution remains pending; this issue stays open. ## Reproduction Use original Integration e2b1cf5995bcf6334839cda9a013e90fa97787d5 with installed Rust 1.97.1, its x86_64-unknown-none sysroot, and explicit LLVM nm 22.1.8. The following read-only symbol inspection is sufficient to show the missing input to scripts/build-dynlink-kernel-artifact.py's build_runtime_shim function: ```bash target_libdir="$(RUSTUP_TOOLCHAIN=1.97.1 rustc --print target-libdir --target x86_64-unknown-none)" llvm-nm -u "$target_libdir"/liballoc-*.rlib | rg 'rust_.*alloc' ``` In one retained original-source build, scripts/build-all.sh with an explicit components selection for kernel fec1113a259c3cfff7d2dd942409b7f3f9df5e64, release kernel profile, runtime services and original runtime.dev.toml reached this failure after compiling the bootloader and generating shared objects. Dependencies were original immutable Git sources; no path patches or replacement commits were used. ## Expected and actual behavior Expected: a supported selected toolchain either produces the declared runtime shim correctly or is rejected with a precise unsupported-toolchain diagnostic. Actual: the kernel job reports `kernel: failed to discover target-none Rust allocation shim symbols` and `dynamic artifact build failed: kernel`; the complete build stage exits 1. No package or disk-image stage is started. The builder requires nonempty no_alloc, should_panic and error_handler symbol groups at lines 775–786, but the selected liballoc has no allocation-error-handler-should-panic reference. Correction behavior: the no-alloc marker and terminal error handler remain mandatory singleton functions. The legacy should-panic accessor is admitted only zero or one time, and all admitted functions must share one complete compiler namespace. The recognizer accepts the observed v0 function identifiers and their exact lengths; unsupported data forms, future variants, malformed prefixes/suffixes and ambiguous relevant symbols fail before assembly. Repeated references to the same symbol are one identity. An unsupported legacy accessor cannot be mistaken for optional absence. The existing no-alloc `ret`, legacy accessor `xor %eax, %eax; ret`, and terminal `cli; 1:; hlt; jmp 1b` instructions and ordering are preserved. Only an absent accessor's complete declarations and body are omitted. This adds no allocator, allocation/deallocation implementation, allocation-success behavior, capability authority or runtime service. ## Environment and identity - Integration builder: e2b1cf5995bcf6334839cda9a013e90fa97787d5. - Kernel: fec1113a259c3cfff7d2dd942409b7f3f9df5e64; original unrelated catalog revisions, including the separate linked Integration runtime, were retained. - Compiler: Rust 1.97.1, commit 8bab26f4f68e0e26f0bb7960be334d5b520ea452, LLVM 22.1.6; symbol inspection: llvm-nm 22.1.8, exit 0. - Target: x86_64-unknown-none. liballoc-803a2bae416eb7d8.rlib SHA-256: 9ed458fa604ebe8b9cae608e589335c3ca2dbf422ddb0ba20b659fc4569bbfa5. - Host development build with two Cargo jobs, release kernel/runtime configuration, 45-minute hard and five-minute output-stall bounds; no VM was run. - No production signing key or runtime capability change was involved. - No last-known-working complete image/toolchain is established by this report. - Correction checkpoint: `e67e4d3ad9596b435bdc44fd5ee716210cddb601`. The host validation used the reviewed correction over original Integration `2604971484facb4910d8f030818dc01f83e57816`, selected Rust 1.97.1 and its original target-none support. The selected C memory companion remained original lib-cstd `8270170c221260c444d923865461231e6ce622b2`. ## Evidence and prior checks The retained liballoc nm result contains these relevant references: ```text _RNvCs9wFQrvczXsK_7___rustc26___rust_alloc_error_handler _RNvCs9wFQrvczXsK_7___rustc35___rust_no_alloc_shim_is_unstable_v2 ``` The distinct should-panic group is empty. The actual kernel build failure and successful symbol inspection are retained with source, executable, sysroot, command, output and process status receipts. Earlier preparation failures were retained separately and are not counted as a successful image build. A read-only inspection of installed Rust 1.93.0, compiler commit 254b59607d4417e9dffbc307138ae5c86280fe4c, finds all three groups, including `_RNvCshXwFllX56pT_7___rustc42___rust_alloc_error_handler_should_panic_v2`. Its liballoc-734a345130e07632.rlib SHA-256 is `dcb05b43fdb159df01de7f35c6bdf2cb03f9403e54f91fc114007ff9706c6061`. That symbol compatibility check is not complete build or runtime acceptance. Cargo capability-query diagnostics are retained separately from artifact compilation/link warnings according to their exact arguments and purpose. The correction's nine literal allocator-contract tests and one retained legacy instruction test pass. Their independently written cases cover the old three-function and new two-function sets, missing required roles, duplicate roles, mixed namespaces, unsupported related names and exact emitted instruction arrays. These host tests do not execute the privileged terminal stub. The actual selected Rust 1.97.1 kernel artifact fixture also passes: exit 0 in 6.174104 seconds, with no owner failure or cleanup error. It compiles the authored kernel and five independent dependency artifacts, validates their manifest/ELF metadata and requires each of the five distinct implementation exports to remain undefined and relocated in the kernel. The inherited test's legacy Rust name-prefix assumption was replaced by this direct artifact identity relation without changing compiler flags or runtime source. Existing metadata, DT_NEEDED and bundled-dependency rejection checks remain. The service-local and artifact-metadata fixtures subsequently passed as well. The original discovery failure, the later inherited name-prefix assertion failure and intervening fixture/setup failures remain separate retained evidence. The earlier source comparison established that original 2604971 discovery and its extracted helper were equivalent before this correction. No new whole image was built and no guest was run for this bounded validation. At the exact correction checkpoint, [CI 1587](https://git.erikinkinen.fi/erix/integration/actions/runs/1587) passes all nine allocator-contract cases, all 486 catalog scenarios, actual development and release kernel/image generation, a byte-identical development rebuild and both canonical image boots. Both images pass their 65-artifact metadata audits. The complete source-correlated logs are retained. This establishes product-image progress at the published source, beyond the earlier local kernel fixture. The workflow selects rust:latest and does not print the actual rustc version or compiler hash. These results therefore do not establish a complete Rust 1.97.1 product image. The workflow later fails the independent release serial native-time gate in [#43](https://git.erikinkinen.fi/erix/integration/issues/43), after the build and boot gates passed. That runtime observation neither reverses the completed build gates nor proves overall workflow acceptance. ## Tracking Owning component: Integration dynamic kernel image builder; component audit #11, profiler work #3 and build-scope work #1. The current work is tracked in [PR #12](https://git.erikinkinen.fi/erix/integration/pulls/12). The local Rust 1.97.1 kernel result and published-checkpoint full-image CI gates support the correction within their recorded scopes. Keep this issue open until a complete product-image result is tied to the originally affected Rust 1.97.1 compiler identity. The later native-time failure has its own issue; an older-toolchain image comparison remains separate evidence.
Sign in to join this conversation.
No milestone
No project
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/integration#19
No description provided.