Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(build): Adjust RV target - riscv64g -> riscv64ima #868

Merged
merged 4 commits into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions bin/client/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down Expand Up @@ -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}}
Expand Down
2 changes: 1 addition & 1 deletion build/asterisc/asterisc-repro.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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` #
Expand Down
6 changes: 3 additions & 3 deletions build/asterisc/asterisc.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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" \
CARGO_BUILD_TARGET="riscv64gc-unknown-none-elf" \
RUSTFLAGS="-Clink-arg=-e_start -Ctarget-feature=-c,-zicsr,-zifencei,-zicntr,zihpm" \
CARGO_BUILD_TARGET="riscv64imac-unknown-none-elf" \
RUSTUP_TOOLCHAIN=${RUST_VERSION}
4 changes: 2 additions & 2 deletions crates/proof-sdk/std-fpvm/src/riscv64/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! This module contains raw syscall bindings for the `riscv64gc` 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;
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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-none-elf -Zbuild-std=core,alloc -- -D warnings

# Lint the Rust documentation
lint-docs:
Expand Down
Loading