Skip to content

Commit f7a21e1

Browse files
authored
feat(build): Adjust RV target - riscv64g -> riscv64ima (#868)
* feat(build): `riscv64g` -> `riscv64ima` * turn off `ziscr`, `zfencei`, `zicntr`, `zihpm` * fmt * fix
1 parent 9770068 commit f7a21e1

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ see the [SDK section of the book](https://anton-rs.github.io/kona/sdk/intro.html
5353
**Build Pipelines**
5454

5555
- [`cannon`](./build/cannon): Docker image for compiling to the bare-metal `mips-unknown-none` target.
56-
- [`asterisc`](./build/asterisc): Docker image for compiling to the bare-metal `riscv64gc-unknown-none-elf` target.
56+
- [`asterisc`](./build/asterisc): Docker image for compiling to the bare-metal `riscv64imac-unknown-none-elf` target.
5757

5858
**Protocol**
5959
- [`mpt`](./crates/mpt): Utilities for interacting with the Merkle Patricia Trie in the client program.

bin/client/justfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ run-client-asterisc block_number l1_rpc l1_beacon_rpc l2_rpc rollup_node_rpc ver
1414
OP_NODE_ADDRESS="{{rollup_node_rpc}}"
1515

1616
HOST_BIN_PATH="./target/release/kona-host"
17-
CLIENT_BIN_PATH="./target/riscv64gc-unknown-none-elf/release-client-lto/kona"
17+
CLIENT_BIN_PATH="./target/riscv64imac-unknown-none-elf/release-client-lto/kona"
1818
STATE_PATH="./state.bin.gz"
1919

2020
CLAIMED_L2_BLOCK_NUMBER={{block_number}}
@@ -140,7 +140,7 @@ run-client-asterisc-offline block_number l2_claim l2_output_root l2_head l1_head
140140
#!/usr/bin/env bash
141141

142142
HOST_BIN_PATH="./target/release/kona-host"
143-
CLIENT_BIN_PATH="./target/riscv64gc-unknown-none-elf/release-client-lto/kona"
143+
CLIENT_BIN_PATH="./target/riscv64imac-unknown-none-elf/release-client-lto/kona"
144144
STATE_PATH="./state.bin.gz"
145145

146146
CLAIMED_L2_BLOCK_NUMBER={{block_number}}

build/asterisc/asterisc-repro.dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends git
4747
# Build kona-client on the selected tag
4848
RUN git checkout $CLIENT_TAG && \
4949
cargo build -Zbuild-std=core,alloc --workspace --bin kona --locked --profile release-client-lto --exclude kona-host --exclude kona-derive-alloy && \
50-
mv ./target/riscv64gc-unknown-none-elf/release-client-lto/kona /kona-client-elf
50+
mv ./target/riscv64imac-unknown-none-elf/release-client-lto/kona /kona-client-elf
5151

5252
################################################################
5353
# Build kona-host @ `CLIENT_TAG` #

build/asterisc/asterisc.dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ RUN apt-get update && apt-get install --assume-yes --no-install-recommends \
1717
clang \
1818
make \
1919
cmake \
20-
git
20+
git
2121

2222
# Install Rustup and Rust
2323
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y --default-toolchain ${RUST_VERSION} --component rust-src
@@ -28,6 +28,6 @@ ENV PATH="/root/.cargo/bin:${PATH}"
2828
ENV CC_riscv64_unknown_none_elf=riscv64-linux-gnu-gcc \
2929
CXX_riscv64_unknown_none_elf=riscv64-linux-gnu-g++ \
3030
CARGO_TARGET_RISCV64_UNKNOWN_NONE_ELF_LINKER=riscv64-linux-gnu-gcc \
31-
RUSTFLAGS="-Clink-arg=-e_start -Ctarget-feature=-c" \
32-
CARGO_BUILD_TARGET="riscv64gc-unknown-none-elf" \
31+
RUSTFLAGS="-Clink-arg=-e_start -Ctarget-feature=-c,-zicsr,-zifencei,-zicntr,zihpm" \
32+
CARGO_BUILD_TARGET="riscv64imac-unknown-none-elf" \
3333
RUSTUP_TOOLCHAIN=${RUST_VERSION}
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
//! This module contains raw syscall bindings for the `riscv64gc` target architecture, as well as a
2-
//! high-level implementation of the [crate::BasicKernelInterface] trait for the kernel.
1+
//! This module contains raw syscall bindings for the `riscv64imac` target architecture, as well as
2+
//! a high-level implementation of the [crate::BasicKernelInterface] trait for the kernel.
33
44
pub(crate) mod io;
55
mod syscall;

justfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ lint-asterisc:
8282
--platform linux/amd64 \
8383
-v `pwd`/:/workdir \
8484
-w="/workdir" \
85-
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
85+
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
8686

8787
# Lint the Rust documentation
8888
lint-docs:

0 commit comments

Comments
 (0)