Skip to content

Commit

Permalink
docker: Add gfortran support (#1458)
Browse files Browse the repository at this point in the history
Add gfortran support for all docker except target of `*-none*` and
`*-andriod*`.

Close #1457
  • Loading branch information
Emilgardis authored May 1, 2024
2 parents 2de4d10 + 98942fd commit 6ab0e7c
Show file tree
Hide file tree
Showing 29 changed files with 39 additions and 10 deletions.
6 changes: 6 additions & 0 deletions .changes/1458.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"description": "add gfortran for target *-gnu*, *-musl*, *-freebsd*, *-solaris*, *-dragonfly*, *-illumos*, *-netbsd*",
"issues": [1457],
"type": "added"

}
1 change: 1 addition & 0 deletions docker/Dockerfile.aarch64-unknown-linux-gnu
Original file line number Diff line number Diff line change
Expand Up @@ -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 /
Expand Down
1 change: 1 addition & 0 deletions docker/Dockerfile.arm-unknown-linux-gnueabi
Original file line number Diff line number Diff line change
Expand Up @@ -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 /
Expand Down
1 change: 1 addition & 0 deletions docker/Dockerfile.armv5te-unknown-linux-gnueabi
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions docker/Dockerfile.armv7-unknown-linux-gnueabi
Original file line number Diff line number Diff line change
Expand Up @@ -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 /
Expand Down
1 change: 1 addition & 0 deletions docker/Dockerfile.armv7-unknown-linux-gnueabihf
Original file line number Diff line number Diff line change
Expand Up @@ -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 /
Expand Down
1 change: 1 addition & 0 deletions docker/Dockerfile.i586-unknown-linux-gnu
Original file line number Diff line number Diff line change
Expand Up @@ -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 /
Expand Down
1 change: 1 addition & 0 deletions docker/Dockerfile.i686-unknown-linux-gnu
Original file line number Diff line number Diff line change
Expand Up @@ -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 /
Expand Down
1 change: 1 addition & 0 deletions docker/Dockerfile.mips-unknown-linux-gnu
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ FROM cross-base as build

RUN apt-get install --assume-yes --no-install-recommends \
g++-mips-linux-gnu \
gfortran-mips-linux-gnu \
libc6-dev-mips-cross

COPY qemu.sh /
Expand Down
1 change: 1 addition & 0 deletions docker/Dockerfile.mips64-unknown-linux-gnuabi64
Original file line number Diff line number Diff line change
Expand Up @@ -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 /
Expand Down
1 change: 1 addition & 0 deletions docker/Dockerfile.mips64el-unknown-linux-gnuabi64
Original file line number Diff line number Diff line change
Expand Up @@ -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 /
Expand Down
1 change: 1 addition & 0 deletions docker/Dockerfile.mipsel-unknown-linux-gnu
Original file line number Diff line number Diff line change
Expand Up @@ -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 /
Expand Down
1 change: 1 addition & 0 deletions docker/Dockerfile.powerpc-unknown-linux-gnu
Original file line number Diff line number Diff line change
Expand Up @@ -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 /
Expand Down
1 change: 1 addition & 0 deletions docker/Dockerfile.powerpc64-unknown-linux-gnu
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
gfortran-powerpc64-linux-gnu \
libc6-dev-ppc64-cross

COPY deny-debian-packages.sh /
Expand Down
1 change: 1 addition & 0 deletions docker/Dockerfile.powerpc64le-unknown-linux-gnu
Original file line number Diff line number Diff line change
Expand Up @@ -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 /
Expand Down
1 change: 1 addition & 0 deletions docker/Dockerfile.riscv64gc-unknown-linux-gnu
Original file line number Diff line number Diff line change
Expand Up @@ -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 /
Expand Down
1 change: 1 addition & 0 deletions docker/Dockerfile.s390x-unknown-linux-gnu
Original file line number Diff line number Diff line change
Expand Up @@ -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 /
Expand Down
1 change: 1 addition & 0 deletions docker/Dockerfile.sparc64-unknown-linux-gnu
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
gfortran-sparc64-linux-gnu \
libc6-dev-sparc64-cross

COPY deny-debian-packages.sh /
Expand Down
1 change: 1 addition & 0 deletions docker/Dockerfile.thumbv7neon-unknown-linux-gnueabihf
Original file line number Diff line number Diff line change
Expand Up @@ -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 /
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.x86_64-pc-windows-gnu
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions docker/Dockerfile.x86_64-unknown-linux-gnu
Original file line number Diff line number Diff line change
Expand Up @@ -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 /
Expand Down
2 changes: 1 addition & 1 deletion docker/aarch64-linux-gnu-glibc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions docker/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion docker/dragonfly.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docker/freebsd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docker/illumos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion docker/musl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions docker/netbsd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ main() {
sed -i -e 's/ftp:/https:/g' ./contrib/download_prerequisites
./contrib/download_prerequisites
local patches=(
https://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/lang/gcc9/patches/patch-libstdc++-v3_config_os_bsd_netbsd_ctype__base.h
https://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/lang/gcc9/patches/patch-libstdc++-v3_config_os_bsd_netbsd_ctype__configure__char.cc
https://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/lang/gcc9/patches/patch-libstdc++-v3_config_os_bsd_netbsd_ctype__base.h
https://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/lang/gcc8/patches/patch-libgfortran_io_io.h
)

local patch
Expand Down Expand Up @@ -92,7 +93,8 @@ main() {
ln -s libutil.so.7.24 "${destdir}/lib/libutil.so.7"

pushd gcc-build
../gcc/configure \
# remove the environment variables after bumping the gcc version to 11.
target_configargs="ac_cv_func_newlocale=no ac_cv_func_freelocale=no ac_cv_func_uselocale=no" ../gcc/configure \
--disable-libada \
--disable-libcilkrt \
--disable-libcilkrts \
Expand All @@ -105,7 +107,7 @@ main() {
--disable-lto \
--disable-multilib \
--disable-nls \
--enable-languages=c,c++ \
--enable-languages=c,c++,fortran \
--target="${target}"
make "-j$(nproc)"
make install
Expand Down
2 changes: 1 addition & 1 deletion docker/solaris.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down

0 comments on commit 6ab0e7c

Please sign in to comment.