@@ -24,7 +24,8 @@ RUN apt-get update && apt-get build-dep -y clang llvm && apt-get install -y --no
24
24
# Needed for apt-key to work:
25
25
dirmngr \
26
26
gpg-agent \
27
- g++-9-arm-linux-gnueabi
27
+ g++-9-arm-linux-gnueabi \
28
+ g++-11-riscv64-linux-gnu
28
29
29
30
RUN apt-key adv --batch --yes --keyserver keyserver.ubuntu.com --recv-keys 74DA7924C5513486
30
31
RUN add-apt-repository -y 'deb https://apt.dilos.org/dilos dilos2 main'
@@ -73,6 +74,10 @@ RUN env \
73
74
CC=arm-linux-gnueabi-gcc-9 CFLAGS="-march=armv7-a" \
74
75
CXX=arm-linux-gnueabi-g++-9 CXXFLAGS="-march=armv7-a" \
75
76
bash musl.sh armv7 && \
77
+ env \
78
+ CC=riscv64-linux-gnu-gcc-11 \
79
+ CXX=riscv64-linux-gnu-g++-11 \
80
+ bash musl.sh riscv64gc && \
76
81
rm -rf /build/*
77
82
78
83
WORKDIR /tmp
@@ -125,14 +130,19 @@ ENV TARGETS=$TARGETS,x86_64-unknown-none
125
130
ENV TARGETS=$TARGETS,aarch64-unknown-uefi
126
131
ENV TARGETS=$TARGETS,i686-unknown-uefi
127
132
ENV TARGETS=$TARGETS,x86_64-unknown-uefi
133
+ ENV TARGETS=$TARGETS,riscv64gc-unknown-linux-musl
128
134
129
135
# As per https://bugs.launchpad.net/ubuntu/+source/gcc-defaults/+bug/1300211
130
136
# we need asm in the search path for gcc-9 (for gnux32) but not in the search path of the
131
137
# cross compilers.
132
138
# Luckily one of the folders is /usr/local/include so symlink /usr/include/x86_64-linux-gnu/asm there
133
139
RUN ln -s /usr/include/x86_64-linux-gnu/asm /usr/local/include/asm
134
140
141
+ # musl-gcc can't find libgcc_s.so.1 since it doesn't use the standard search paths.
142
+ RUN ln -s /usr/riscv64-linux-gnu/lib/libgcc_s.so.1 /usr/lib/gcc-cross/riscv64-linux-gnu/11/
143
+
135
144
ENV RUST_CONFIGURE_ARGS --enable-extended --enable-lld --enable-llvm-bitcode-linker --disable-docs \
136
- --musl-root-armv7=/musl-armv7
145
+ --musl-root-armv7=/musl-armv7 \
146
+ --musl-root-riscv64gc=/musl-riscv64gc
137
147
138
148
ENV SCRIPT python3 ../x.py dist --host='' --target $TARGETS
0 commit comments