From 17142e8ddd4dfb0816616c59f6edff68d7cc3db7 Mon Sep 17 00:00:00 2001 From: clabby Date: Wed, 11 Dec 2024 13:31:02 -0500 Subject: [PATCH 1/4] feat(build): `riscv64g` -> `riscv64ima` --- README.md | 2 +- bin/client/justfile | 4 ++-- build/asterisc/asterisc-repro.dockerfile | 2 +- build/asterisc/asterisc.dockerfile | 4 ++-- crates/proof-sdk/std-fpvm/src/riscv64/mod.rs | 2 +- justfile | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index adf8a1d74..422313080 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ see the [SDK section of the book](https://anton-rs.github.io/kona/sdk/intro.html **Build Pipelines** - [`cannon`](./build/cannon): Docker image for compiling to the bare-metal `mips-unknown-none` target. -- [`asterisc`](./build/asterisc): Docker image for compiling to the bare-metal `riscv64gc-unknown-none-elf` target. +- [`asterisc`](./build/asterisc): Docker image for compiling to the bare-metal `riscv64imac-unknown-none-elf` target. **Protocol** - [`mpt`](./crates/mpt): Utilities for interacting with the Merkle Patricia Trie in the client program. diff --git a/bin/client/justfile b/bin/client/justfile index 7eb03331b..d2a180ee9 100644 --- a/bin/client/justfile +++ b/bin/client/justfile @@ -14,7 +14,7 @@ run-client-asterisc block_number l1_rpc l1_beacon_rpc l2_rpc rollup_node_rpc ver OP_NODE_ADDRESS="{{rollup_node_rpc}}" HOST_BIN_PATH="./target/release/kona-host" - CLIENT_BIN_PATH="./target/riscv64gc-unknown-none-elf/release-client-lto/kona" + CLIENT_BIN_PATH="./target/riscv64imac-unknown-none-elf/release-client-lto/kona" STATE_PATH="./state.bin.gz" CLAIMED_L2_BLOCK_NUMBER={{block_number}} @@ -133,7 +133,7 @@ run-client-asterisc-offline block_number l2_claim l2_output_root l2_head l1_head #!/usr/bin/env bash HOST_BIN_PATH="./target/release/kona-host" - CLIENT_BIN_PATH="./target/riscv64gc-unknown-none-elf/release-client-lto/kona" + CLIENT_BIN_PATH="./target/riscv64imac-unknown-none-elf/release-client-lto/kona" STATE_PATH="./state.bin.gz" CLAIMED_L2_BLOCK_NUMBER={{block_number}} diff --git a/build/asterisc/asterisc-repro.dockerfile b/build/asterisc/asterisc-repro.dockerfile index 03b328562..b1b7aefa1 100644 --- a/build/asterisc/asterisc-repro.dockerfile +++ b/build/asterisc/asterisc-repro.dockerfile @@ -47,7 +47,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends git # Build kona-client on the selected tag RUN git checkout $CLIENT_TAG && \ cargo build -Zbuild-std=core,alloc --workspace --bin kona --locked --profile release-client-lto --exclude kona-host --exclude kona-derive-alloy && \ - mv ./target/riscv64gc-unknown-none-elf/release-client-lto/kona /kona-client-elf + mv ./target/riscv64imac-unknown-none-elf/release-client-lto/kona /kona-client-elf ################################################################ # Build kona-host @ `CLIENT_TAG` # diff --git a/build/asterisc/asterisc.dockerfile b/build/asterisc/asterisc.dockerfile index 5e8e4a4c5..dd2ed5b4a 100644 --- a/build/asterisc/asterisc.dockerfile +++ b/build/asterisc/asterisc.dockerfile @@ -17,7 +17,7 @@ RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ clang \ make \ cmake \ - git + git # Install Rustup and Rust RUN curl https://sh.rustup.rs -sSf | bash -s -- -y --default-toolchain ${RUST_VERSION} --component rust-src @@ -29,5 +29,5 @@ ENV CC_riscv64_unknown_none_elf=riscv64-linux-gnu-gcc \ CXX_riscv64_unknown_none_elf=riscv64-linux-gnu-g++ \ CARGO_TARGET_RISCV64_UNKNOWN_NONE_ELF_LINKER=riscv64-linux-gnu-gcc \ RUSTFLAGS="-Clink-arg=-e_start -Ctarget-feature=-c" \ - CARGO_BUILD_TARGET="riscv64gc-unknown-none-elf" \ + CARGO_BUILD_TARGET="riscv64imac-unknown-none-elf" \ RUSTUP_TOOLCHAIN=${RUST_VERSION} diff --git a/crates/proof-sdk/std-fpvm/src/riscv64/mod.rs b/crates/proof-sdk/std-fpvm/src/riscv64/mod.rs index dd28a94b7..674482491 100644 --- a/crates/proof-sdk/std-fpvm/src/riscv64/mod.rs +++ b/crates/proof-sdk/std-fpvm/src/riscv64/mod.rs @@ -1,4 +1,4 @@ -//! This module contains raw syscall bindings for the `riscv64gc` target architecture, as well as a +//! This module contains raw syscall bindings for the `riscv64imac` target architecture, as well as a //! high-level implementation of the [crate::BasicKernelInterface] trait for the kernel. pub(crate) mod io; diff --git a/justfile b/justfile index 2678f06ab..e2ca37a87 100644 --- a/justfile +++ b/justfile @@ -82,7 +82,7 @@ lint-asterisc: --platform linux/amd64 \ -v `pwd`/:/workdir \ -w="/workdir" \ - ghcr.io/anton-rs/kona/asterisc-builder:main cargo +nightly clippy -p kona-std-fpvm --all-features --target riscv64gc-unknown-linux-gnu -Zbuild-std=core,alloc -- -D warnings + ghcr.io/anton-rs/kona/asterisc-builder:main cargo +nightly clippy -p kona-std-fpvm --all-features --target riscv64imac-unknown-linux-gnu -Zbuild-std=core,alloc -- -D warnings # Lint the Rust documentation lint-docs: From 994b5c83b1dcf04f3dac641b2426dee8b38e2cde Mon Sep 17 00:00:00 2001 From: clabby Date: Thu, 2 Jan 2025 10:03:50 -0500 Subject: [PATCH 2/4] turn off `ziscr`, `zfencei`, `zicntr`, `zihpm` --- build/asterisc/asterisc.dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/asterisc/asterisc.dockerfile b/build/asterisc/asterisc.dockerfile index dd2ed5b4a..249975835 100644 --- a/build/asterisc/asterisc.dockerfile +++ b/build/asterisc/asterisc.dockerfile @@ -28,6 +28,6 @@ ENV PATH="/root/.cargo/bin:${PATH}" ENV CC_riscv64_unknown_none_elf=riscv64-linux-gnu-gcc \ CXX_riscv64_unknown_none_elf=riscv64-linux-gnu-g++ \ CARGO_TARGET_RISCV64_UNKNOWN_NONE_ELF_LINKER=riscv64-linux-gnu-gcc \ - RUSTFLAGS="-Clink-arg=-e_start -Ctarget-feature=-c" \ + RUSTFLAGS="-Clink-arg=-e_start -Ctarget-feature=-c,-zicsr,-zifencei,-zicntr,zihpm" \ CARGO_BUILD_TARGET="riscv64imac-unknown-none-elf" \ RUSTUP_TOOLCHAIN=${RUST_VERSION} From 714a808fe487f01cc890fc49663568f7c88c5d3c Mon Sep 17 00:00:00 2001 From: clabby Date: Thu, 2 Jan 2025 10:05:36 -0500 Subject: [PATCH 3/4] fmt --- crates/proof-sdk/std-fpvm/src/riscv64/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/proof-sdk/std-fpvm/src/riscv64/mod.rs b/crates/proof-sdk/std-fpvm/src/riscv64/mod.rs index 674482491..f90970ea7 100644 --- a/crates/proof-sdk/std-fpvm/src/riscv64/mod.rs +++ b/crates/proof-sdk/std-fpvm/src/riscv64/mod.rs @@ -1,5 +1,5 @@ -//! This module contains raw syscall bindings for the `riscv64imac` target architecture, as well as a -//! high-level implementation of the [crate::BasicKernelInterface] trait for the kernel. +//! This module contains raw syscall bindings for the `riscv64imac` target architecture, as well as +//! a high-level implementation of the [crate::BasicKernelInterface] trait for the kernel. pub(crate) mod io; mod syscall; From 67e9df7cb7ddc08dc05e3a923306ee57bdd942db Mon Sep 17 00:00:00 2001 From: clabby Date: Thu, 2 Jan 2025 10:13:42 -0500 Subject: [PATCH 4/4] fix --- justfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/justfile b/justfile index e2ca37a87..0fd6f8020 100644 --- a/justfile +++ b/justfile @@ -82,7 +82,7 @@ lint-asterisc: --platform linux/amd64 \ -v `pwd`/:/workdir \ -w="/workdir" \ - ghcr.io/anton-rs/kona/asterisc-builder:main cargo +nightly clippy -p kona-std-fpvm --all-features --target riscv64imac-unknown-linux-gnu -Zbuild-std=core,alloc -- -D warnings + ghcr.io/anton-rs/kona/asterisc-builder:main cargo +nightly clippy -p kona-std-fpvm --all-features --target riscv64imac-unknown-none-elf -Zbuild-std=core,alloc -- -D warnings # Lint the Rust documentation lint-docs: