Skip to content

Commit

Permalink
Update to GCC 14.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Kartatz committed Aug 14, 2024
1 parent b9c569a commit 397987a
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 18 deletions.
89 changes: 79 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
id: check-cache
uses: actions/cache@main
with:
key: gcc-14.1.0-1
key: gcc-14.2.0
lookup-only: true
path: |
/tmp/x86_64-linux-gnu.tar.xz
Expand Down Expand Up @@ -45,7 +45,7 @@ jobs:
if: ${{ steps.check-cache.outputs.cache-hit != 'true' }}
uses: actions/cache@main
with:
key: gcc-14.1.0-1
key: gcc-14.2.0
path: |
/tmp/x86_64-linux-gnu.tar.xz
/tmp/x86_64-linux-gnu.tar.xz.sha256
Expand All @@ -54,32 +54,101 @@ jobs:
name: 'Cross build'
needs: native-build
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
target: [
# 'alpha-unknown-linux-gnu',
'ia64-unknown-linux-gnu',
'alpha-unknown-linux-gnu',
'x86_64-unknown-linux-gnu',
'i386-unknown-linux-gnu',
# 'arm-unknown-linux-gnueabi',
'arm-unknown-linux-gnueabi',
'arm-unknown-linux-gnueabihf',
# 'hppa-unknown-linux-gnu',
'hppa-unknown-linux-gnu',
'aarch64-unknown-linux-gnu',
# 'mips-unknown-linux-gnu',
# 'mipsel-unknown-linux-gnu',
'mips-unknown-linux-gnu',
'mipsel-unknown-linux-gnu',
'powerpc-unknown-linux-gnu',
# 's390-unknown-linux-gnu',
's390-unknown-linux-gnu',
's390x-unknown-linux-gnu',
'sparc-unknown-linux-gnu',
'powerpc64le-unknown-linux-gnu'
'powerpc64le-unknown-linux-gnu',
'mips64el-unknown-linux-gnuabi64'
]
steps:
- uses: actions/checkout@main
with:
submodules: true
- name: Free up some space
run: |
sudo apt purge --allow-remove-essential --auto-remove \
'*apache2*' \
'*docker*' \
'*dotnet*' \
'*firefox*' \
'*google*' \
'*gstreamer*' \
'*jdk*' \
'*nginx*' \
'*php*' \
'*ruby*' \
'*wayland*' \
'auto*' \
'azure-cli' \
'bind9*' \
'clang*' \
'container*' \
'fonts*' \
'gcc-9' \
'gcc-10' \
'gcc-11' \
'gcc-12' \
'gh' \
'glib*' \
'libmono*' \
'lld*' \
'llvm*' \
'mercurial*' \
'mysql*' \
'postgresql*' \
'powershell' \
'vim*' \
'x11*' \
'xdg*' > '/dev/null'
sudo apt purge --allow-remove-essential --auto-remove \
'linux-*' \
'apt' > '/dev/null'
sudo rm --recursive --force \
"${HOME}/.cargo" \
"${HOME}/.rustup" \
"${HOME}/linuxbrew" \
'/etc/apt' \
'/etc/cni/net.d' \
'/etc/docker' \
'/etc/mono' \
'/etc/mysql' \
'/lib/tmpfiles.d' \
'/opt/'* \
'/opt/az' \
'/usr/lib/heroku' \
'/usr/lib/mono' \
'/usr/libexec/docker' \
'/usr/local/lib/android' \
'/usr/local/lib/android' \
'/usr/local/share/man' \
'/usr/local/share/vcpkg' \
'/usr/share/fonts' \
'/usr/share/icons' \
'/usr/share/java' \
'/usr/share/php' \
'/usr/share/swift' \
'/var/lib/apache2' \
'/var/lib/gems' \
'/var/log'
- name: Restore from cache
uses: actions/cache@main
with:
key: gcc-14.1.0-1
key: gcc-14.2.0
fail-on-cache-miss: true
path: |
/tmp/x86_64-linux-gnu.tar.xz
Expand Down
12 changes: 5 additions & 7 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ declare -r mpc_tarball='/tmp/mpc.tar.gz'
declare -r mpc_directory='/tmp/mpc-1.3.1'

declare -r binutils_tarball='/tmp/binutils.tar.xz'
declare -r binutils_directory='/tmp/binutils-2.42'
declare -r binutils_directory='/tmp/binutils-2.43'

declare -r lld_tarball='/tmp/lld.tar.xz'

Expand All @@ -35,8 +35,8 @@ function setup_gcc_source() {

if [ "${tgt}" = 'hppa' ] || [ "${tgt}" = 'alpha' ] || [ "${tgt}" = 'amd64' ] || [ "${tgt}" = 'i386' ]; then
gcc_version='14'
gcc_directory='/tmp/gcc-14.1.0'
gcc_url='https://ftp.gnu.org/gnu/gcc/gcc-14.1.0/gcc-14.1.0.tar.xz'
gcc_directory='/tmp/gcc-14.2.0'
gcc_url='https://ftp.gnu.org/gnu/gcc/gcc-14.2.0/gcc-14.2.0.tar.xz'
else
gcc_version='11'
gcc_directory='/tmp/gcc-11.2.0'
Expand Down Expand Up @@ -117,7 +117,7 @@ if ! [ -f "${mpc_tarball}" ]; then
fi

if ! [ -f "${binutils_tarball}" ]; then
wget --no-verbose 'https://ftp.gnu.org/gnu/binutils/binutils-2.42.tar.xz' --output-document="${binutils_tarball}"
wget --no-verbose 'https://ftp.gnu.org/gnu/binutils/binutils-2.43.tar.xz' --output-document="${binutils_tarball}"
tar --directory="$(dirname "${binutils_directory}")" --extract --file="${binutils_tarball}"

patch --directory="${binutils_directory}" --strip='1' --input="${workdir}/patches/0001-Revert-gold-Use-char16_t-char32_t-instead-of-uint16_.patch"
Expand Down Expand Up @@ -190,8 +190,6 @@ rm --force --recursive ./*
make all --silent --jobs
make install

sed -i 's/#include <stdint.h>/#include <stdint.h>\n#include <stdio.h>/g' "${toolchain_directory}/include/mpc.h"

[ -d "${binutils_directory}/build" ] || mkdir "${binutils_directory}/build"

declare -r targets=(
Expand Down Expand Up @@ -336,7 +334,7 @@ for target in "${targets[@]}"; do
--with-mpfr="${toolchain_directory}" \
--with-bugurl='https://github.com/AmanoTeam/Atar/issues' \
--with-gcc-major-version-only \
--with-pkgversion="Atar v0.4-${revision}" \
--with-pkgversion="Atar v0.5-${revision}" \
--with-sysroot="${toolchain_directory}/${triplet}" \
--with-native-system-header-dir='/include' \
--enable-__cxa_atexit \
Expand Down

0 comments on commit 397987a

Please sign in to comment.