Skip to content

Instantly share code, notes, and snippets.

@BeMg
Last active December 4, 2020 11:18
Show Gist options
  • Select an option

  • Save BeMg/2c5084ade7e55a072a95a1b080fd675d to your computer and use it in GitHub Desktop.

Select an option

Save BeMg/2c5084ade7e55a072a95a1b080fd675d to your computer and use it in GitHub Desktop.
build own riscv64-unknown-elf-gcc and spike environment
FROM ubuntu:18.04
MAINTAINER BeMg
RUN apt-get update && apt-get install -y git autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev libusb-1.0-0-dev gawk \
build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev device-tree-compiler pkg-config libexpat-dev && mkdir risc-v
ENV RISCV /risc-v
RUN git clone --recursive https://github.com/riscv/riscv-gnu-toolchain && \
cd riscv-gnu-toolchain && ./configure --prefix=$RISCV && make -j4 && \
rm -rf riscv-binutils && git clone https://gitlab.pllab.org/piyouchen/riscv-binutils.git riscv-binutils && \
cd riscv-binutils && ./configure --prefix=$RISCV --target=riscv64-unknown-elf && make -j4 && make install -j4 && cd
RUN git clone https://github.com/riscv/riscv-tools.git
RUN cd riscv-tools && git submodule update --init riscv-pk && git submodule update --init riscv-fesvr && rm -rf riscv-isa-sim && git clone https://gitlab.pllab.org/piyouchen/riscv-isa-sim.git && \
./build-spike-pk.sh && echo "export PATH=$PATH:/risc-v/bin" >> ~/.bashrc
FROM ubuntu:18.04
MAINTAINER BeMg
RUN apt-get update && apt-get install -y git autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev libusb-1.0-0-dev gawk \
build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev device-tree-compiler pkg-config libexpat-dev && mkdir risc-v
ENV RISCV /risc-v
RUN git clone --recursive https://github.com/riscv/riscv-gnu-toolchain && \
cd riscv-gnu-toolchain && ./configure --prefix=$RISCV && make -j4 && \
rm -rf riscv-binutils && git clone --branch test git@github.com:BeMg/riscv-bintuils.git riscv-binutils && \
cd riscv-binutils && ./configure --prefix=$RISCV --target=riscv64-unknown-elf && make -j4 && make install -j4 && cd
RUN git clone https://github.com/riscv/riscv-tools.git
RUN cd riscv-tools && git submodule update --init riscv-pk && git submodule update --init riscv-fesvr && rm -rf riscv-isa-sim && git clone git@github.com:BeMg/riscv-isa-sim.git && \
./build-spike-pk.sh && echo "export PATH=$PATH:/risc-v/bin" >> ~/.bashrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment