Skip to content

Commit

Permalink
Split advanced workflow into separate steps
Browse files Browse the repository at this point in the history
  • Loading branch information
Blackhex committed Nov 14, 2023
1 parent a071180 commit 12fe07d
Show file tree
Hide file tree
Showing 11 changed files with 391 additions and 325 deletions.
34 changes: 34 additions & 0 deletions .github/scripts/build-binutils.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash

BINUTILS_VERSION=${BINUTILS_VERSION:-binutils-master}

TARGET=${TARGET:-aarch64-w64-mingw32}
BUILD_PATH=${BUILD_PATH:-$PWD/build-$TARGET}
BUILD_MAKE_OPTIONS=-j$(nproc)
INSTALL_PATH=${INSTALL_PATH:-~/cross}

export PATH=$INSTALL_PATH/bin:$PATH

set -e # exit on error
set -x # echo on

mkdir -p $BUILD_PATH/binutils
cd $BUILD_PATH/binutils

echo "::group::Configure binutils"
../../code/$BINUTILS_VERSION/configure \
--prefix=$INSTALL_PATH \
--target=$TARGET
echo "::endgroup::"

cd $BUILD_PATH/binutils

echo "::group::Build binutils"
make $BUILD_MAKE_OPTIONS
echo "::endgroup::"

echo "::group::Install binutils"
make install
echo "::endgroup::"

echo 'Success!'
33 changes: 33 additions & 0 deletions .github/scripts/build-gcc-libs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

TARGET=${TARGET:-aarch64-w64-mingw32}
BUILD_PATH=${BUILD_PATH:-$PWD/build-$TARGET}
BUILD_MAKE_OPTIONS=-j$(nproc)

export PATH=$INSTALL_PATH/bin:$PATH

cd $BUILD_PATH/gcc

echo "::group::Build libstdc++"
make $BUILD_MAKE_OPTIONS all-target-libstdc++-v3
echo "::endgroup::"

echo "::group::Install libstdc++"
make install-target-libstdc++-v3
echo "::endgroup::"

echo "::group::Build libgfortran"
make $BUILD_MAKE_OPTIONS all-target-libgfortran
echo "::endgroup::"

echo "::group::Install libgfortran"
make install-target-libgfortran
echo "::endgroup::"

echo "::group::Build remaining GCC libraries"
make $BUILD_MAKE_OPTIONS all
echo "::endgroup::"

echo "::group::Install remaining GCC libraries"
make install
echo "::endgroup::"
64 changes: 64 additions & 0 deletions .github/scripts/build-gcc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#!/bin/bash

GCC_VERSION=${GCC_VERSION:-gcc-master}

TARGET=${TARGET:-aarch64-w64-mingw32}
BUILD_PATH=${BUILD_PATH:-$PWD/build-$TARGET}
BUILD_MAKE_OPTIONS=-j$(nproc)
INSTALL_PATH=${INSTALL_PATH:-~/cross}

export PATH=$INSTALL_PATH/bin:$PATH

set -e # exit on error
set -x # echo on

mkdir -p $BUILD_PATH/gcc

cd $BUILD_PATH/gcc

echo "::group::Configure GCC"
# REMOVED --libexecdir=/opt/lib
# REMOVED --with-{gmp,mpfr,mpc,isl}=/usr
../../code/$GCC_VERSION/configure \
--prefix=$INSTALL_PATH \
--target=$TARGET \
--enable-languages=c,lto,c++,fortran \
--enable-shared \
--enable-static \
--enable-threads=win32 \
--enable-graphite \
--enable-fully-dynamic-string \
--enable-libstdcxx-filesystem-ts=yes \
--enable-libstdcxx-time=yes \
--enable-cloog-backend=isl \
--enable-version-specific-runtime-libs \
--enable-lto \
--enable-libgomp \
--enable-checking=release \
--disable-multilib \
--disable-shared \
--disable-rpath \
--disable-win32-registry \
--disable-werror \
--disable-symvers \
--disable-libstdcxx-pch \
--disable-libstdcxx-debug \
--disable-isl-version-check \
--disable-bootstrap \
--with-libiconv \
--with-system-zlib \
--with-gnu-as \
--with-gnu-ld
echo "::endgroup::"

cd $BUILD_PATH/gcc

echo "::group::Build GCC"
make $BUILD_MAKE_OPTIONS all-gcc
echo "::endgroup::"

echo "::group::Install GCC"
make install-gcc
echo "::endgroup::"

echo 'Success!'
17 changes: 17 additions & 0 deletions .github/scripts/build-libgcc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

TARGET=${TARGET:-aarch64-w64-mingw32}
BUILD_PATH=${BUILD_PATH:-$PWD/build-$TARGET}
BUILD_MAKE_OPTIONS=-j$(nproc)

export PATH=$INSTALL_PATH/bin:$PATH

cd $BUILD_PATH/gcc

echo "::group::Build libgcc"
make $BUILD_MAKE_OPTIONS all-target-libgcc
echo "::endgroup::"

echo "::group::Install libgcc"
make install-target-libgcc
echo "::endgroup::"
42 changes: 42 additions & 0 deletions .github/scripts/build-mingw-crt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/bash

MINGW_VERSION=${MINGW_VERSION:-mingw-w64-master}

TARGET=${TARGET:-aarch64-w64-mingw32}
BUILD_PATH=${BUILD_PATH:-$PWD/build-$TARGET}
BUILD_MAKE_OPTIONS=-j$(nproc)
INSTALL_PATH=${INSTALL_PATH:-~/cross}

export PATH=$INSTALL_PATH/bin:$PATH

set -e # exit on error
set -x # echo on

mkdir -p $BUILD_PATH/mingw
cd $BUILD_PATH/mingw

echo "::group::Configure MinGW CRT"
../../code/$MINGW_VERSION/mingw-w64-crt/configure \
--prefix=$INSTALL_PATH/$TARGET \
--build=x86_64-linux-gnu \
--host=$TARGET \
--with-sysroot=$INSTALL_PATH \
--enable-libarm64 \
--disable-lib32 \
--disable-lib64 \
--disable-libarm32 \
--disable-shared \
--with-default-msvcrt=msvcrt
echo "::endgroup::"

cd $BUILD_PATH/mingw

echo "::group::Build MinGW headers"
make $BUILD_MAKE_OPTIONS
echo "::endgroup::"

echo "::group::Install MinGW headers"
make install
echo "::endgroup::"

echo 'Success!'
38 changes: 38 additions & 0 deletions .github/scripts/build-mingw-headers.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash

MINGW_VERSION=${MINGW_VERSION:-mingw-w64-master}

TARGET=${TARGET:-aarch64-w64-mingw32}
BUILD_PATH=${BUILD_PATH:-$PWD/build-$TARGET}
BUILD_MAKE_OPTIONS=-j$(nproc)
INSTALL_PATH=${INSTALL_PATH:-~/cross}

export PATH=$INSTALL_PATH/bin:$PATH

set -e # exit on error
set -x # echo on

mkdir -p $BUILD_PATH/mingw-headers
cd $BUILD_PATH/mingw-headers

echo "::group::Configure MinGW headers"
../../code/$MINGW_VERSION/mingw-w64-headers/configure \
--prefix=$INSTALL_PATH/$TARGET \
--host=$TARGET \
--with-default-msvcrt=msvcrt
echo "::endgroup::"

cd $BUILD_PATH/mingw-headers

echo "::group::Build MinGW headers"
make $BUILD_MAKE_OPTIONS
echo "::endgroup::"

echo "::group::Install MinGW headers"
make install
echo "::endgroup::"

# Symlink for gcc
ln -sf $INSTALL_PATH/$TARGET $INSTALL_PATH/mingw

echo 'Success!'
39 changes: 39 additions & 0 deletions .github/scripts/build-mingw.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash

MINGW_VERSION=${MINGW_VERSION:-mingw-w64-master}

TARGET=${TARGET:-aarch64-w64-mingw32}
BUILD_PATH=${BUILD_PATH:-$PWD/build-$TARGET}
BUILD_MAKE_OPTIONS=-j$(nproc)
INSTALL_PATH=${INSTALL_PATH:-~/cross}

export PATH=$INSTALL_PATH/bin:$PATH

set -e # exit on error
set -x # echo on

cd $BUILD_PATH/mingw

echo "::group::Configure MinGW libraries"
../../code/$MINGW_VERSION/configure \
--prefix=$INSTALL_PATH/$TARGET \
--host=$TARGET \
--enable-libarm64 \
--disable-lib32 \
--disable-lib64 \
--disable-libarm32 \
--disable-shared \
--with-libraries=libmangle,pseh,winpthreads \
--with-default-msvcrt=msvcrt

echo "::endgroup::"

cd $BUILD_PATH/mingw

echo "::group::Build MinGW"
make $BUILD_MAKE_OPTIONS
echo "::endgroup::"

echo "::group::Install MinGW"
make install
echo "::endgroup::"
Loading

0 comments on commit 12fe07d

Please sign in to comment.