From 941b8b31fb242da7c714f5d92f6484981a6d64a7 Mon Sep 17 00:00:00 2001 From: Dirreke Date: Wed, 13 Mar 2024 23:01:41 +0800 Subject: [PATCH] docker: Add gfortran support --- docker/Dockerfile.aarch64-unknown-linux-gnu | 1 + docker/Dockerfile.arm-unknown-linux-gnueabi | 1 + docker/Dockerfile.armv5te-unknown-linux-gnueabi | 1 + docker/Dockerfile.armv7-unknown-linux-gnueabi | 1 + docker/Dockerfile.armv7-unknown-linux-gnueabihf | 1 + docker/Dockerfile.i586-unknown-linux-gnu | 1 + docker/Dockerfile.i686-unknown-linux-gnu | 1 + docker/Dockerfile.mips-unknown-linux-gnu | 1 + docker/Dockerfile.mips64-unknown-linux-gnuabi64 | 1 + docker/Dockerfile.mips64el-unknown-linux-gnuabi64 | 1 + docker/Dockerfile.mipsel-unknown-linux-gnu | 1 + docker/Dockerfile.powerpc-unknown-linux-gnu | 1 + docker/Dockerfile.powerpc64-unknown-linux-gnu | 1 + docker/Dockerfile.powerpc64le-unknown-linux-gnu | 1 + docker/Dockerfile.riscv64gc-unknown-linux-gnu | 1 + docker/Dockerfile.s390x-unknown-linux-gnu | 1 + docker/Dockerfile.sparc64-unknown-linux-gnu | 1 + docker/Dockerfile.thumbv7neon-unknown-linux-gnueabihf | 1 + docker/Dockerfile.x86_64-pc-windows-gnu | 2 +- docker/Dockerfile.x86_64-unknown-linux-gnu | 1 + docker/aarch64-linux-gnu-glibc.sh | 2 +- docker/common.sh | 2 ++ docker/dragonfly.sh | 2 +- docker/freebsd.sh | 2 +- docker/illumos.sh | 2 +- docker/musl.sh | 2 +- docker/netbsd.sh | 2 +- docker/solaris.sh | 2 +- 28 files changed, 29 insertions(+), 8 deletions(-) diff --git a/docker/Dockerfile.aarch64-unknown-linux-gnu b/docker/Dockerfile.aarch64-unknown-linux-gnu index 45daca95b..85910e398 100644 --- a/docker/Dockerfile.aarch64-unknown-linux-gnu +++ b/docker/Dockerfile.aarch64-unknown-linux-gnu @@ -14,6 +14,7 @@ FROM cross-base as build RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ g++-aarch64-linux-gnu \ + gfortran-aarch64-linux-gnu \ libc6-dev-arm64-cross COPY deny-debian-packages.sh / diff --git a/docker/Dockerfile.arm-unknown-linux-gnueabi b/docker/Dockerfile.arm-unknown-linux-gnueabi index 3a610f82c..a6341617a 100644 --- a/docker/Dockerfile.arm-unknown-linux-gnueabi +++ b/docker/Dockerfile.arm-unknown-linux-gnueabi @@ -14,6 +14,7 @@ FROM cross-base as build RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ g++-arm-linux-gnueabi \ + gfortran-arm-linux-gnueabi \ libc6-dev-armel-cross COPY deny-debian-packages.sh / diff --git a/docker/Dockerfile.armv5te-unknown-linux-gnueabi b/docker/Dockerfile.armv5te-unknown-linux-gnueabi index be6466cd6..878d9132b 100644 --- a/docker/Dockerfile.armv5te-unknown-linux-gnueabi +++ b/docker/Dockerfile.armv5te-unknown-linux-gnueabi @@ -14,6 +14,7 @@ FROM cross-base as build RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ g++-arm-linux-gnueabi \ + gfortran-arm-linux-gnueabi \ crossbuild-essential-armel \ libc6-dev-armel-cross diff --git a/docker/Dockerfile.armv7-unknown-linux-gnueabi b/docker/Dockerfile.armv7-unknown-linux-gnueabi index 26cdf722e..c1201c759 100644 --- a/docker/Dockerfile.armv7-unknown-linux-gnueabi +++ b/docker/Dockerfile.armv7-unknown-linux-gnueabi @@ -14,6 +14,7 @@ FROM cross-base as build RUN apt-get install --assume-yes --no-install-recommends \ g++-arm-linux-gnueabi \ + gfortran-arm-linux-gnueabi \ libc6-dev-armel-cross COPY qemu.sh / diff --git a/docker/Dockerfile.armv7-unknown-linux-gnueabihf b/docker/Dockerfile.armv7-unknown-linux-gnueabihf index 870ef25a1..37fac999c 100644 --- a/docker/Dockerfile.armv7-unknown-linux-gnueabihf +++ b/docker/Dockerfile.armv7-unknown-linux-gnueabihf @@ -14,6 +14,7 @@ FROM cross-base as build RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ g++-arm-linux-gnueabihf \ + gfortran-arm-linux-gnueabihf \ libc6-dev-armhf-cross COPY deny-debian-packages.sh / diff --git a/docker/Dockerfile.i586-unknown-linux-gnu b/docker/Dockerfile.i586-unknown-linux-gnu index 77f41a26a..b003d0d85 100644 --- a/docker/Dockerfile.i586-unknown-linux-gnu +++ b/docker/Dockerfile.i586-unknown-linux-gnu @@ -14,6 +14,7 @@ FROM cross-base as build RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ g++-i686-linux-gnu \ + gfortran-i686-linux-gnu \ libc6-dev-i386-cross COPY deny-debian-packages.sh / diff --git a/docker/Dockerfile.i686-unknown-linux-gnu b/docker/Dockerfile.i686-unknown-linux-gnu index b5c578356..ff634f6b6 100644 --- a/docker/Dockerfile.i686-unknown-linux-gnu +++ b/docker/Dockerfile.i686-unknown-linux-gnu @@ -14,6 +14,7 @@ FROM cross-base as build RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ g++-i686-linux-gnu \ + gfortran-i686-linux-gnu \ libc6-dev-i386-cross COPY deny-debian-packages.sh / diff --git a/docker/Dockerfile.mips-unknown-linux-gnu b/docker/Dockerfile.mips-unknown-linux-gnu index 8dabed898..1dff3d365 100644 --- a/docker/Dockerfile.mips-unknown-linux-gnu +++ b/docker/Dockerfile.mips-unknown-linux-gnu @@ -14,6 +14,7 @@ FROM cross-base as build RUN apt-get install --assume-yes --no-install-recommends \ g++-mips-linux-gnu \ + gfrotran-mips-linux-gnu \ libc6-dev-mips-cross COPY qemu.sh / diff --git a/docker/Dockerfile.mips64-unknown-linux-gnuabi64 b/docker/Dockerfile.mips64-unknown-linux-gnuabi64 index 648d7f0b8..aff54da06 100644 --- a/docker/Dockerfile.mips64-unknown-linux-gnuabi64 +++ b/docker/Dockerfile.mips64-unknown-linux-gnuabi64 @@ -14,6 +14,7 @@ FROM cross-base as build RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ g++-mips64-linux-gnuabi64 \ + gfortran-mips64-linux-gnuabi64 \ libc6-dev-mips64-cross COPY deny-debian-packages.sh / diff --git a/docker/Dockerfile.mips64el-unknown-linux-gnuabi64 b/docker/Dockerfile.mips64el-unknown-linux-gnuabi64 index 24dedf753..2e86f1a62 100644 --- a/docker/Dockerfile.mips64el-unknown-linux-gnuabi64 +++ b/docker/Dockerfile.mips64el-unknown-linux-gnuabi64 @@ -14,6 +14,7 @@ FROM cross-base as build RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ g++-mips64el-linux-gnuabi64 \ + gfortran-mips64el-linux-gnuabi64 \ libc6-dev-mips64el-cross COPY deny-debian-packages.sh / diff --git a/docker/Dockerfile.mipsel-unknown-linux-gnu b/docker/Dockerfile.mipsel-unknown-linux-gnu index 5887580d5..39672a862 100644 --- a/docker/Dockerfile.mipsel-unknown-linux-gnu +++ b/docker/Dockerfile.mipsel-unknown-linux-gnu @@ -14,6 +14,7 @@ FROM cross-base as build RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ g++-mipsel-linux-gnu \ + gfortran-mipsel-linux-gnu \ libc6-dev-mipsel-cross COPY deny-debian-packages.sh / diff --git a/docker/Dockerfile.powerpc-unknown-linux-gnu b/docker/Dockerfile.powerpc-unknown-linux-gnu index 1e65263de..e3c688c54 100644 --- a/docker/Dockerfile.powerpc-unknown-linux-gnu +++ b/docker/Dockerfile.powerpc-unknown-linux-gnu @@ -14,6 +14,7 @@ FROM cross-base as build RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ g++-powerpc-linux-gnu \ + gfortran-powerpc-linux-gnu \ libc6-dev-powerpc-cross COPY deny-debian-packages.sh / diff --git a/docker/Dockerfile.powerpc64-unknown-linux-gnu b/docker/Dockerfile.powerpc64-unknown-linux-gnu index c7b63c7f9..446ddcf3d 100644 --- a/docker/Dockerfile.powerpc64-unknown-linux-gnu +++ b/docker/Dockerfile.powerpc64-unknown-linux-gnu @@ -14,6 +14,7 @@ FROM cross-base as build RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ g++-powerpc64-linux-gnu \ + gfrotran-powerpc64-linux-gnu \ libc6-dev-ppc64-cross COPY deny-debian-packages.sh / diff --git a/docker/Dockerfile.powerpc64le-unknown-linux-gnu b/docker/Dockerfile.powerpc64le-unknown-linux-gnu index bdab4a334..728a5894d 100644 --- a/docker/Dockerfile.powerpc64le-unknown-linux-gnu +++ b/docker/Dockerfile.powerpc64le-unknown-linux-gnu @@ -14,6 +14,7 @@ FROM cross-base as build RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ g++-powerpc64le-linux-gnu \ + gfortran-powerpc64le-linux-gnu \ libc6-dev-ppc64el-cross COPY deny-debian-packages.sh / diff --git a/docker/Dockerfile.riscv64gc-unknown-linux-gnu b/docker/Dockerfile.riscv64gc-unknown-linux-gnu index 100d12b6a..8695d9134 100644 --- a/docker/Dockerfile.riscv64gc-unknown-linux-gnu +++ b/docker/Dockerfile.riscv64gc-unknown-linux-gnu @@ -14,6 +14,7 @@ FROM cross-base as build RUN apt-get update && apt-get install -y --no-install-recommends \ g++-riscv64-linux-gnu \ + gfortran-riscv64-linux-gnu \ libc6-dev-riscv64-cross COPY deny-debian-packages.sh / diff --git a/docker/Dockerfile.s390x-unknown-linux-gnu b/docker/Dockerfile.s390x-unknown-linux-gnu index f4543004e..043afd7e5 100644 --- a/docker/Dockerfile.s390x-unknown-linux-gnu +++ b/docker/Dockerfile.s390x-unknown-linux-gnu @@ -14,6 +14,7 @@ FROM cross-base as build RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ g++-s390x-linux-gnu \ + gfortran-s390x-linux-gnu \ libc6-dev-s390x-cross COPY deny-debian-packages.sh / diff --git a/docker/Dockerfile.sparc64-unknown-linux-gnu b/docker/Dockerfile.sparc64-unknown-linux-gnu index 0dc0a8297..0310e60f6 100644 --- a/docker/Dockerfile.sparc64-unknown-linux-gnu +++ b/docker/Dockerfile.sparc64-unknown-linux-gnu @@ -14,6 +14,7 @@ FROM cross-base as build RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ g++-sparc64-linux-gnu \ + g++-sparc64-linux-gfortran \ libc6-dev-sparc64-cross COPY deny-debian-packages.sh / diff --git a/docker/Dockerfile.thumbv7neon-unknown-linux-gnueabihf b/docker/Dockerfile.thumbv7neon-unknown-linux-gnueabihf index bcbc8a167..03ea06a36 100644 --- a/docker/Dockerfile.thumbv7neon-unknown-linux-gnueabihf +++ b/docker/Dockerfile.thumbv7neon-unknown-linux-gnueabihf @@ -14,6 +14,7 @@ FROM cross-base as build RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ g++-arm-linux-gnueabihf \ + gfortran-arm-linux-gnueabihf \ libc6-dev-armhf-cross COPY qemu.sh / diff --git a/docker/Dockerfile.x86_64-pc-windows-gnu b/docker/Dockerfile.x86_64-pc-windows-gnu index bfa7f0dc3..a3fa0d50a 100644 --- a/docker/Dockerfile.x86_64-pc-windows-gnu +++ b/docker/Dockerfile.x86_64-pc-windows-gnu @@ -18,7 +18,7 @@ RUN dpkg --add-architecture i386 && apt-get update && \ COPY wine.sh / RUN /wine.sh -RUN apt-get update && apt-get install --assume-yes --no-install-recommends g++-mingw-w64-x86-64 +RUN apt-get update && apt-get install --assume-yes --no-install-recommends g++-mingw-w64-x86-64 gfortran-mingw-w64-x86-64 # run-detectors are responsible for calling the correct interpreter for exe # files. For some reason it does not work inside a docker container (it works diff --git a/docker/Dockerfile.x86_64-unknown-linux-gnu b/docker/Dockerfile.x86_64-unknown-linux-gnu index 9623ef304..719b51916 100644 --- a/docker/Dockerfile.x86_64-unknown-linux-gnu +++ b/docker/Dockerfile.x86_64-unknown-linux-gnu @@ -14,6 +14,7 @@ FROM cross-base as build RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ g++-x86-64-linux-gnu \ + gfortran-x86-64-linux-gnu \ libc6-dev-amd64-cross COPY deny-debian-packages.sh / diff --git a/docker/aarch64-linux-gnu-glibc.sh b/docker/aarch64-linux-gnu-glibc.sh index a071eb565..adfe47070 100755 --- a/docker/aarch64-linux-gnu-glibc.sh +++ b/docker/aarch64-linux-gnu-glibc.sh @@ -40,7 +40,7 @@ cp_gcc_archive() { main() { set_centos_ulimit yum install -y epel-release - yum install -y gcc-aarch64-linux-gnu gcc-c++-aarch64-linux-gnu binutils-aarch64-linux-gnu binutils gcc-c++ glibc-devel + yum install -y gcc-aarch64-linux-gnu gcc-c++-aarch64-linux-gnu gfortran-c++-aarch64-linux-gnu binutils-aarch64-linux-gnu binutils gcc-c++ glibc-devel yum clean all local td diff --git a/docker/common.sh b/docker/common.sh index 24d56194d..aca4d7ab3 100755 --- a/docker/common.sh +++ b/docker/common.sh @@ -30,11 +30,13 @@ install_packages \ if_centos install_packages \ clang-devel \ gcc-c++ \ + gcc-gfortran \ glibc-devel \ pkgconfig if_ubuntu install_packages \ g++ \ + gfortran \ libc6-dev \ libclang-dev \ pkg-config diff --git a/docker/dragonfly.sh b/docker/dragonfly.sh index 75652e41e..4004ccd41 100755 --- a/docker/dragonfly.sh +++ b/docker/dragonfly.sh @@ -95,7 +95,7 @@ EOF --disable-lto \ --disable-multilib \ --disable-nls \ - --enable-languages=c,c++ \ + --enable-languages=c,c++,,fortran \ --target="${target}" make "-j${nproc}" make install diff --git a/docker/freebsd.sh b/docker/freebsd.sh index e144f4055..108d04f3b 100755 --- a/docker/freebsd.sh +++ b/docker/freebsd.sh @@ -228,7 +228,7 @@ main() { --disable-libvtv \ --disable-lto \ --disable-nls \ - --enable-languages=c,c++ \ + --enable-languages=c,c++,fortran \ --target="${target}" make "-j$(nproc)" make install diff --git a/docker/illumos.sh b/docker/illumos.sh index cf3168f63..c3662b64d 100755 --- a/docker/illumos.sh +++ b/docker/illumos.sh @@ -104,7 +104,7 @@ main() { --target="${build_target}" \ --program-prefix="${target}-" \ --with-sysroot="${sysroot_dir}" \ - --enable-languages=c,c++ \ + --enable-languages=c,c++,fortran \ --disable-libada \ --disable-libcilkrts \ --disable-libgomp \ diff --git a/docker/musl.sh b/docker/musl.sh index 61411d849..e0d4fed39 100755 --- a/docker/musl.sh +++ b/docker/musl.sh @@ -51,7 +51,7 @@ main() { LINUX_HEADERS_SITE="${linux_headers_site}" \ LINUX_VER="${linux_ver}" \ OUTPUT=/usr/local/ \ - "GCC_CONFIG += --enable-default-pie" \ + "GCC_CONFIG += --enable-default-pie --enable-languages=c,c++,fortran" \ "${@}" purge_packages diff --git a/docker/netbsd.sh b/docker/netbsd.sh index b0ce0ee1e..959f7c16a 100755 --- a/docker/netbsd.sh +++ b/docker/netbsd.sh @@ -105,7 +105,7 @@ main() { --disable-lto \ --disable-multilib \ --disable-nls \ - --enable-languages=c,c++ \ + --enable-languages=c,c++,fortran \ --target="${target}" make "-j$(nproc)" make install diff --git a/docker/solaris.sh b/docker/solaris.sh index 68796eb7b..ef1788bda 100755 --- a/docker/solaris.sh +++ b/docker/solaris.sh @@ -121,7 +121,7 @@ EOF --disable-lto \ --disable-multilib \ --disable-nls \ - --enable-languages=c,c++ \ + --enable-languages=c,c++,fortran \ --with-gnu-as \ --with-gnu-ld \ --target="${target}"