forked from libriscv/libriscv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
34 lines (26 loc) · 929 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
FROM ubuntu:latest
RUN apt update && apt install -y \
cmake git \
clang-18 \
tcc libtcc-dev \
g++-13-riscv64-linux-gnu
ENV CXX=clang++-18
COPY lib /app/lib
COPY emulator/build.sh /app/emulator/build.sh
COPY emulator/CMakeLists.txt /app/emulator/CMakeLists.txt
COPY emulator/src /app/emulator/src
COPY binaries/measure_mips/fib.c /app/emulator/fib.c
# Fast emulation (with TCC JIT compilation)
WORKDIR /app/emulator
RUN ./build.sh -x --tcc && cp .build/rvlinux /app/rvlinux && cp .build/libtcc1.a /app/libtcc1.a
# Fastest emulator (with binary translation)
WORKDIR /app/emulator
RUN ./build.sh -x --bintr && cp .build/rvlinux /app/rvlinux-fast
# Clean up
RUN rm -rf /app/emulator/.build
# Example program
WORKDIR /app
RUN riscv64-linux-gnu-gcc-13 -march=rv32g -mabi=ilp32d -static -O2 -nostdlib -ffreestanding emulator/fib.c -o fib
# Provdide a path to your cli apps executable
WORKDIR /app
ENTRYPOINT [ "./rvlinux" ]