-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
100 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Package: gcc-12-ubuntu-UBUNTUVERSION | ||
Version: VERSION | ||
Architecture: amd64 | ||
Maintainer: xyb <[email protected]> | ||
Description: Gcc VERSION build for ubuntu UBUNTUVERSION | ||
Depends: binutils, libc6-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
ARG UbuntuVersion=20.04 | ||
|
||
FROM ubuntu:$UbuntuVersion | ||
|
||
ARG Gcc12Version=12.1.0 | ||
|
||
# Download gcc source code | ||
RUN apt update && apt install -y wget build-essential file flex libz-dev libzstd-dev | ||
RUN wget https://gcc.gnu.org/pub/gcc/releases/gcc-$Gcc12Version/gcc-$Gcc12Version.tar.gz | ||
RUN tar xf gcc-$Gcc12Version.tar.gz | ||
RUN cd /gcc-$Gcc12Version && ./contrib/download_prerequisites | ||
|
||
# Build x86_64-gcc-12 | ||
RUN mkdir /x86_64-gcc-12 | ||
WORKDIR /x86_64-gcc-12 | ||
RUN /gcc-$Gcc12Version/configure \ | ||
--enable-languages=c,c++ \ | ||
--prefix=/usr \ | ||
--with-gcc-major-version-only \ | ||
--program-suffix=-12 \ | ||
--enable-shared \ | ||
--enable-linker-build-id \ | ||
--libexecdir=/usr/lib \ | ||
--without-included-gettext \ | ||
--enable-threads=posix \ | ||
--libdir=/usr/lib \ | ||
--disable-nls \ | ||
--enable-clocale=gnu \ | ||
--enable-libstdcxx-debug \ | ||
--enable-libstdcxx-time=yes \ | ||
--with-default-libstdcxx-abi=new \ | ||
--enable-gnu-unique-object \ | ||
--disable-vtable-verify \ | ||
--enable-plugin \ | ||
--enable-default-pie \ | ||
--with-system-zlib \ | ||
--enable-libphobos-checking=release \ | ||
--with-target-system-zlib=auto \ | ||
--disable-werror \ | ||
--enable-cet \ | ||
--with-abi=m64 \ | ||
--disable-multilib \ | ||
--with-tune=generic \ | ||
--without-cuda-driver \ | ||
--enable-checking=release \ | ||
--build=x86_64-linux-gnu \ | ||
--host=x86_64-linux-gnu \ | ||
--target=x86_64-linux-gnu | ||
RUN make -j`nproc` | ||
|
||
ARG BuildVersion=1 | ||
ARG UbuntuVersion=20.04 | ||
|
||
RUN make install-strip DESTDIR=/gcc-$Gcc12Version-$BuildVersion-ubuntu-$UbuntuVersion | ||
RUN mkdir -p /gcc-$Gcc12Version-$BuildVersion-ubuntu-$UbuntuVersion/usr/share/gdb/auto-load/usr/lib64 && \ | ||
mv /gcc-$Gcc12Version-$BuildVersion-ubuntu-$UbuntuVersion/usr/lib64/libstdc++.so.6.0.30-gdb.py /gcc-$Gcc12Version-$BuildVersion-ubuntu-$UbuntuVersion/usr/share/gdb/auto-load/usr/lib64/libstdc++.so.6.0.30-gdb.py | ||
|
||
# Generate deb | ||
WORKDIR / | ||
COPY DEBIAN/control.m4 / | ||
RUN mkdir /gcc-$Gcc12Version-$BuildVersion-ubuntu-$UbuntuVersion/DEBIAN | ||
RUN m4 -P -DUBUNTUVERSION=$UbuntuVersion -DVERSION=$Gcc12Version-$BuildVersion control.m4 > /gcc-$Gcc12Version-$BuildVersion-ubuntu-$UbuntuVersion/DEBIAN/control | ||
RUN dpkg-deb --build --root-owner-group /gcc-$Gcc12Version-$BuildVersion-ubuntu-$UbuntuVersion |