-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
74 lines (68 loc) · 1.69 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
FROM ubuntu:latest
WORKDIR /src
RUN apt-get update \
&& apt-get install -y \
build-essential \
autoconf \
python3 \
uuid-dev \
iasl \
git \
gcc \
bison \
flex \
texinfo \
libgmp-dev \
libmpfr-dev \
libmpc-dev \
python3-distutils \
gcc-arm-linux-gnueabi \
gcc-aarch64-linux-gnu \
gcc-riscv64-unknown-elf \
&& apt-get clean \
&& ln -sf /usr/bin/python3 /usr/bin/python
# Build and install nasm 2.16.01 manually
RUN git clone https://github.com/netwide-assembler/nasm.git \
--branch nasm-2.16.01 \
--depth 1 \
&& cd nasm \
&& ./autogen.sh \
&& ./configure \
&& make \
&& make install || true \
&& cd .. \
&& rm -rf nasm
# Manually build and install binutils 2.42 for loongson (loongarch64)
RUN git clone https://sourceware.org/git/binutils-gdb.git \
--branch=binutils-2_42 \
--depth 1 \
&& mkdir -p binutils-gdb/build \
&& cd binutils-gdb/build \
&& ../configure \
--target=loongarch64-linux-gnu \
--with-sysroot \
--disable-nls \
--disable-werror \
&& make -j$(nproc) \
&& make install \
&& cd ../../ \
&& rm -rf binutils-gdb
# Manually build and install a latest gcc for loongson (loongarch64)
# FIXME: Specify commit hash for consistency
RUN git clone git://gcc.gnu.org/git/gcc.git \
--branch=master \
--depth 1 \
&& mkdir -p gcc/build \
&& cd gcc/build \
&& ../configure \
--target=loongarch64-linux-gnu \
--disable-nls \
--enable-languages=c \
--without-headers \
&& make all-gcc -j$(nproc) \
&& make install-gcc \
&& cd ../../ \
&& rm -rf gcc
RUN mkdir -p ~/.ssh \
&& touch ~/.ssh/known_hosts \
&& ssh-keyscan github.com >> ~/.ssh/known_hosts