Skip to content

Commit

Permalink
fixup! refactor!: rollup-http-server based on libcmt
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmikhalevich committed Mar 28, 2024
1 parent f76e284 commit 78bc8d3
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions rollup-http/rollup-http-server/build-with-toolchain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,17 @@ RISCV_ARCH="${RISCV_ARCH:-rv64gc}"
RISCV_ABI="${RISCV_ABI:-lp64d}"
CONTAINER_BASE="${CONTAINER_BASE:-/opt/cartesi/tools}"

docker run --rm -e USER=`id -u -n` -e GROUP=`id -g -n` -e UID=`id -u` -e GID=`id -g` -v `pwd`/../:$CONTAINER_BASE \
--env CC=riscv64-cartesi-linux-gnu-gcc --env CXX=riscv64-cartesi-linux-gnu-g++ --env CFLAGS="-march=$RISCV_ARCH -mabi=$RISCV_ABI" \
CMD="make -C sys-utils/libcmt install; cd $CONTAINER_BASE/rollup-http/rollup-http-server; cargo build --target riscv64gc-unknown-linux-gnu --release"

cargo clean

docker run --rm -e USER=`id -u -n` -e GROUP=`id -g -n` -e UID=`id -u` -e GID=`id -g` -v `pwd`/../../:$CONTAINER_BASE \
--env CC=riscv64-cartesi-linux-gnu-gcc \
--env CXX=riscv64-cartesi-linux-gnu-g++ \
--env TOOLCHAIN_PREFIX=riscv64-cartesi-linux-gnu- \
--env CFLAGS="-march=$RISCV_ARCH -mabi=$RISCV_ABI" \
--env CARGO_TARGET_RISCV64GC_UNKNOWN_LINUX_GNU_LINKER=riscv64-cartesi-linux-gnu-gcc \
-w $CONTAINER_BASE/rollup-http-server $TOOLCHAIN_IMAGE:$TOOLCHAIN_TAG \
cargo build --target riscv64gc-unknown-linux-gnu --release
--env TARGET_PREFIX=$CONTAINER_BASE/libcmt \
--env CPATH=$CONTAINER_BASE/libcmt/include \
--env RUSTFLAGS="-L $CONTAINER_BASE/libcmt/lib" \
-w $CONTAINER_BASE $TOOLCHAIN_IMAGE:$TOOLCHAIN_TAG /bin/sh -c "$CMD"

0 comments on commit 78bc8d3

Please sign in to comment.