Remove std from libziskos.a#1
Merged
marcinbugaj merged 5 commits intoMay 12, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
libziskos.ais a C static archive. As astaticlibcrate, the Rust toolchain bundles all transitive object files into it — including those from any dependency that pulls instd. Before this change,zkvm-interfacecaused 16+ std CGU object files to be included, because its bindgen-generated bindings referenced::std::os::raw::c_int.Changes
zkvm-interface: Adding.use_core()to the bindgen builder switches the generated C types from::std::os::rawto::core::ffi, after which the crate compiles withoutstdand#![no_std]can be added.zisk-definitions: Contains onlyconstdeclarations with no std usage;#![no_std]is added trivially.ziskos— panic handler: Makingzkvm-interfaceno_stdremoved the last dependency that implicitly linked the Zisk customstd, which had been providing the#[panic_handler]lang item that the compiler requires for everyno_stdstatic library. A panic handler is added toziskosinside the existing zkvm-gated module. It writes the panic message to UART then callscore::intrinsics::abort(), which the Zisk LLVM backend lowers to the RISC-Vunimpinstruction — matching theabort_internal()implementation in the Zisk standard library. This handler serves both consumers ofziskos: Rust crate dependents (via the rlib) and C programs linking the archive (whererust_begin_unwindmust be resolvable from within the archive itself).CI check
A step is added to the
test-x86_64job that buildsziskosfor the zkvm target and inspectslibziskos.awithar t. Since Rust embeds the crate name in codegen unit filenames, any bundledstdobject file is immediately identifiable by name. The check fails the build and prints the offending filenames if any are found.