forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
130 lines (118 loc) · 3.71 KB
/
Copy pathDockerfile
File metadata and controls
130 lines (118 loc) · 3.71 KB
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
FROM docker.io/library/ubuntu:24.04
# MPFR is required by some of the mathlib tests.
RUN apt-get update && \
apt-get install -y \
git \
libmpfr-dev \
libgmp-dev \
libmpc-dev \
ninja-build \
build-essential \
gcc-9 \
g++-9 \
gcc-11 \
g++-11 \
qemu-user-static \
libc6-dev-arm64-cross \
libstdc++6-arm64-cross \
gcc-aarch64-linux-gnu \
g++-aarch64-linux-gnu \
libc6-dev-riscv64-cross \
libstdc++6-riscv64-cross \
gcc-riscv64-linux-gnu \
g++-riscv64-linux-gnu \
libc6-dev-ppc64el-cross \
libstdc++6-ppc64el-cross \
gcc-powerpc64le-linux-gnu \
g++-powerpc64le-linux-gnu \
sudo \
sccache \
wget \
lsb-release \
software-properties-common \
gnupg \
cmake \
m4 \
linux-libc-dev && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN wget https://apt.llvm.org/llvm.sh && \
chmod +x llvm.sh && \
sudo ./llvm.sh 23 && \
rm llvm.sh
# Install gmp and mpfr for cross compilation
RUN wget https://ftp.gnu.org/gnu/gmp/gmp-6.3.0.tar.xz && \
tar -xf gmp-6.3.0.tar.xz && \
cd gmp-6.3.0 && \
./configure --host=riscv64-linux-gnu --prefix=/usr/riscv64-linux-gnu && \
make -j8 && \
sudo make install && \
cd .. && \
rm -rf gmp-6.3.0 && \
rm gmp-6.3.0.tar.xz
RUN wget https://ftp.gnu.org/gnu/mpfr/mpfr-4.2.2.tar.xz && \
tar -xf mpfr-4.2.2.tar.xz && \
cd mpfr-4.2.2 && \
./configure --host=riscv64-linux-gnu --prefix=/usr/riscv64-linux-gnu \
--with-gmp=/usr/riscv64-linux-gnu && \
make -j8 && \
sudo make install && \
cd .. && \
rm -rf mpfr-4.2.2 && \
rm mpfr-4.2.2.tar.xz
RUN wget https://ftp.gnu.org/gnu/mpc/mpc-1.4.1.tar.xz && \
tar -xf mpc-1.4.1.tar.xz && \
cd mpc-1.4.1 && \
./configure --host=riscv64-linux-gnu --prefix=/usr/riscv64-linux-gnu \
--with-gmp=/usr/riscv64-linux-gnu \
--with-mpfr=/usr/riscv64-linux-gnu && \
make -j8 && \
sudo make install && \
cd .. && \
rm -rf mpc-1.4.1 && \
rm mpc-1.4.1.tar.xz
# Install gcc-7 and g++-7.
RUN wget https://ftp.gnu.org/gnu/gcc/gcc-7.5.0/gcc-7.5.0.tar.xz && \
tar -xf gcc-7.5.0.tar.xz && \
cd gcc-7.5.0 && \
./contrib/download_prerequisites && \
cd .. && \
mkdir gcc-7 && \
cd gcc-7 && \
../gcc-7.5.0/configure --prefix=/usr/local/gcc7 --enable-languages=c,c++ \
--disable-multilib --disable-libsanitizer && \
make -j8 && \
sudo make install && \
cd .. && \
rm -rf gcc-7 && \
rm -rf gcc-7.5.0 && \
rm gcc-7.5.0.tar.xz
# Install gcc-8 and g++-8.
RUN wget https://ftp.gnu.org/gnu/gcc/gcc-8.5.0/gcc-8.5.0.tar.xz && \
tar -xf gcc-8.5.0.tar.xz && \
cd gcc-8.5.0 && \
./contrib/download_prerequisites && \
cd .. && \
mkdir gcc-8 && \
cd gcc-8 && \
../gcc-8.5.0/configure --prefix=/usr/local/gcc8 --enable-languages=c,c++ \
--disable-multilib --disable-libsanitizer && \
make -j8 && \
sudo make install && \
cd .. && \
rm -rf gcc-8 && \
rm -rf gcc-8.5.0 && \
rm gcc-8.5.0.tar.xz
# Debian has a multilib setup, so we need to symlink the asm directory.
# For more information, see https://wiki.debian.org/Multiarch/LibraryPathOverview
RUN ln -sf /usr/include/$(uname -p)-linux-gnu/asm /usr/include/asm
# Create a new user to avoid test failures related to a lack of expected
# permissions issues in some tests. Set the user id to 1001 as that is the
# user id that Github Actions uses to perform the checkout action.
RUN useradd gha -u 1001 -m -s /bin/bash
# Also add the user to passwordless sudoers so that we can install software
# later on without having to rebuild the container.
RUN adduser gha sudo
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
USER gha
WORKDIR /home/gha