1
+ ARG UbuntuVersion=20.04
2
+
3
+ FROM ubuntu:$UbuntuVersion
4
+
5
+ ARG UbuntuVersion=20.04
6
+ ARG Gcc11Version=11.2.0
7
+ ARG BuildVersion=1
8
+
9
+ # Download gcc source code
10
+ RUN apt update && apt install -y wget build-essential flex libz-dev libzstd-dev
11
+ RUN wget https://gcc.gnu.org/pub/gcc/releases/gcc-$Gcc11Version/gcc-$Gcc11Version.tar.gz
12
+ RUN tar xf gcc-$Gcc11Version.tar.gz
13
+ RUN cd /gcc-$Gcc11Version && ./contrib/download_prerequisites
14
+
15
+ # Build x86_64-gcc-11
16
+ RUN mkdir /x86_64-gcc-11
17
+ WORKDIR /x86_64-gcc-11
18
+ RUN /gcc-$Gcc11Version/configure \
19
+ --enable-languages=c,c++ \
20
+ --prefix=/usr \
21
+ --with-gcc-major-version-only \
22
+ --program-suffix=-11 \
23
+ --enable-shared \
24
+ --enable-linker-build-id \
25
+ --libexecdir=/usr/lib \
26
+ --without-included-gettext \
27
+ --enable-threads=posix \
28
+ --libdir=/usr/lib \
29
+ --disable-nls \
30
+ --enable-bootstrap \
31
+ --enable-clocale=gnu \
32
+ --enable-libstdcxx-debug \
33
+ --enable-libstdcxx-time=yes \
34
+ --with-default-libstdcxx-abi=new \
35
+ --enable-gnu-unique-object \
36
+ --disable-libquadmath \
37
+ --disable-libquadmath-support \
38
+ --enable-plugin \
39
+ --enable-default-pie \
40
+ --with-system-zlib \
41
+ --enable-libphobos-checking=release \
42
+ --with-target-system-zlib=auto \
43
+ --disable-multilib \
44
+ --enable-fix-cortex-a53-843419 \
45
+ --disable-werror \
46
+ --enable-checking=release \
47
+ --build=aarch64-linux-gnu \
48
+ --host=aarch64-linux-gnu \
49
+ --target=aarch64-linux-gnu \
50
+ --with-build-config=bootstrap-lto-lean \
51
+ --enable-link-serialization=2
52
+
53
+ RUN make -j`nproc`
54
+ RUN make install-strip DESTDIR=/gcc-$Gcc11Version-$BuildVersion-ubuntu-$UbuntuVersion-arm64
55
+ RUN mkdir -p /gcc-$Gcc11Version-$BuildVersion-ubuntu-$UbuntuVersion-arm64/usr/share/gdb/auto-load/usr/lib64 && \
56
+ mv /gcc-$Gcc11Version-$BuildVersion-ubuntu-$UbuntuVersion-arm64/usr/lib64/libstdc++.so.6.0.29-gdb.py /gcc-$Gcc11Version-$BuildVersion-ubuntu-$UbuntuVersion-arm64/usr/share/gdb/auto-load/usr/lib64/libstdc++.so.6.0.29-gdb.py
57
+
58
+ # Generate deb
59
+ WORKDIR /
60
+ COPY DEBIAN/control.m4 /
61
+ RUN mkdir /gcc-$Gcc11Version-$BuildVersion-ubuntu-$UbuntuVersion-arm64/DEBIAN
62
+ RUN m4 -P -DUBUNTUVERSION=$UbuntuVersion -DVERSION=$Gcc11Version-$BuildVersion control.m4 > /gcc-$Gcc11Version-$BuildVersion-ubuntu-$UbuntuVersion-arm64/DEBIAN/control
63
+ RUN dpkg-deb --build --root-owner-group /gcc-$Gcc11Version-$BuildVersion-ubuntu-$UbuntuVersion-arm64
0 commit comments