-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
52 lines (41 loc) · 1.21 KB
/
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
FROM alpine as builder
RUN apk --no-cache add --virtual riscv-build-dependencies \
build-base \
gawk \
texinfo \
bison \
git \
autoconf \
automake \
curl \
python3 \
mpc1-dev \
mpfr-dev \
gmp-dev \
flex \
gperf \
libtool \
patchutils \
bc \
zlib-dev \
expat-dev \
gettext-dev
RUN git clone --recursive https://github.com/riscv/riscv-gnu-toolchain
# ADD https://sourceware.org/bugzilla/attachment.cgi?id=10151&action=diff&collapsed=&headers=1&format=raw /riscv-gnu-toolchain/riscv-glibc/sunrpc/rpc/type.h.patch
#COPY type.h.patch /riscv-gnu-toolchain/riscv-glibc/sunrpc/rpc/type.h.patch
# RUN cd /riscv-gnu-toolchain/riscv-glibc/sunrpc/rpc/ && patch < type.h.patch
WORKDIR /riscv-gnu-toolchain
RUN ./configure --prefix=/opt/riscv
RUN make -j$(nproc)
FROM alpine
COPY --from=builder /opt/riscv/ /opt/riscv/
RUN apk add --no-cache --virtual riscv-runtime-dependencies \
libintl \
mpc1 \
gmp \
mpfr4
ENV PATH=$PATH:/opt/riscv/bin/
ENV C_INCLUDE_PATH=/opt/riscv/riscv64-unknown-elf/include/
ENV LD_LIBRARY_PATH=/opt/riscv/riscv64-unknown-elf/lib/
ENV CC=/opt/riscv/bin/riscv64-unknown-elf-gcc
ENV CXX=/opt/riscv/bin/riscv64-unknown-elf-g++