diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b5542cf..6a949d3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,7 +17,7 @@ jobs: id: check-cache uses: actions/cache@main with: - key: gcc-13.2.0 + key: gcc-14.1.0-1 lookup-only: true path: | /tmp/x86_64-linux-gnu.tar.xz @@ -45,7 +45,7 @@ jobs: if: ${{ steps.check-cache.outputs.cache-hit != 'true' }} uses: actions/cache@main with: - key: gcc-13.2.0 + key: gcc-14.1.0-1 path: | /tmp/x86_64-linux-gnu.tar.xz /tmp/x86_64-linux-gnu.tar.xz.sha256 @@ -58,6 +58,7 @@ jobs: strategy: matrix: target: [ + 'ia64-unknown-linux-gnu', 'alpha-unknown-linux-gnu', 'x86_64-unknown-linux-gnu', 'i386-unknown-linux-gnu', @@ -71,7 +72,8 @@ jobs: '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 @@ -80,14 +82,13 @@ jobs: - name: Restore from cache uses: actions/cache@main with: - key: gcc-13.2.0 + key: gcc-14.1.0-1 fail-on-cache-miss: true path: | /tmp/x86_64-linux-gnu.tar.xz /tmp/x86_64-linux-gnu.tar.xz.sha256 - name: Setup toolchain run: | - ls /tmp/x86_64-linux-gnu.tar.xz tar --directory='/tmp' --extract --file='/tmp/x86_64-linux-gnu.tar.xz' mv '/tmp/obggcc' '/tmp/obggcc-toolchain' - name: Build OBGGCC with OBGGCC @@ -103,7 +104,7 @@ jobs: - name: Upload artifact uses: actions/upload-artifact@main with: - name: cross-toolchain + name: ${{ matrix.target }} if-no-files-found: error path: | /tmp/${{ matrix.target }}.tar.xz diff --git a/build.sh b/build.sh index b929257..eb667a4 100644 --- a/build.sh +++ b/build.sh @@ -4,29 +4,29 @@ set -eu declare -r obggcc_revision="$(git rev-parse --short HEAD)" -declare -r current_source_directory="${PWD}" +declare -r workdir="${PWD}" declare -r toolchain_directory='/tmp/obggcc' declare -r gmp_tarball='/tmp/gmp.tar.xz' -declare -r gmp_directory='/tmp/gmp-6.2.1' +declare -r gmp_directory='/tmp/gmp-6.3.0' declare -r mpfr_tarball='/tmp/mpfr.tar.xz' -declare -r mpfr_directory='/tmp/mpfr-4.2.0' +declare -r mpfr_directory='/tmp/mpfr-4.2.1' 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.40' +declare -r binutils_directory='/tmp/binutils-2.42' declare -r gcc_tarball='/tmp/gcc.tar.gz' -declare -r gcc_directory='/tmp/gcc-13.2.0' +declare -r gcc_directory='/tmp/gcc-14.1.0' declare -r optflags='-Os' declare -r linkflags='-Wl,-s' -declare -r max_jobs="$(($(nproc) * 8))" +declare -r max_jobs="$(($(nproc) * 17))" declare build_type="${1}" @@ -51,27 +51,29 @@ if ! (( is_native )); then fi if ! [ -f "${gmp_tarball}" ]; then - curl --connect-timeout '10' --retry '15' --retry-all-errors --fail --silent --url 'https://mirrors.kernel.org/gnu/gmp/gmp-6.2.1.tar.xz' --output "${gmp_tarball}" + wget --no-verbose 'https://ftp.gnu.org/gnu/gmp/gmp-6.3.0.tar.xz' --output-document="${gmp_tarball}" tar --directory="$(dirname "${gmp_directory}")" --extract --file="${gmp_tarball}" fi if ! [ -f "${mpfr_tarball}" ]; then - curl --connect-timeout '10' --retry '15' --retry-all-errors --fail --silent --url 'https://mirrors.kernel.org/gnu/mpfr/mpfr-4.2.0.tar.xz' --output "${mpfr_tarball}" + wget --no-verbose 'https://ftp.gnu.org/gnu/mpfr/mpfr-4.2.1.tar.xz' --output-document="${mpfr_tarball}" tar --directory="$(dirname "${mpfr_directory}")" --extract --file="${mpfr_tarball}" fi if ! [ -f "${mpc_tarball}" ]; then - curl --connect-timeout '10' --retry '15' --retry-all-errors --fail --silent --url 'https://mirrors.kernel.org/gnu/mpc/mpc-1.3.1.tar.gz' --output "${mpc_tarball}" + wget --no-verbose 'https://ftp.gnu.org/gnu/mpc/mpc-1.3.1.tar.gz' --output-document="${mpc_tarball}" tar --directory="$(dirname "${mpc_directory}")" --extract --file="${mpc_tarball}" fi if ! [ -f "${binutils_tarball}" ]; then - curl --connect-timeout '10' --retry '15' --retry-all-errors --fail --silent --url 'https://mirrors.kernel.org/gnu/binutils/binutils-2.40.tar.xz' --output "${binutils_tarball}" + wget --no-verbose 'https://ftp.gnu.org/gnu/binutils/binutils-2.42.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" fi if ! [ -f "${gcc_tarball}" ]; then - curl --connect-timeout '10' --retry '15' --retry-all-errors --fail --silent --url 'https://mirrors.kernel.org/gnu/gcc/gcc-13.2.0/gcc-13.2.0.tar.xz' --output "${gcc_tarball}" + wget --no-verbose 'https://ftp.gnu.org/gnu/gcc/gcc-14.1.0/gcc-14.1.0.tar.xz' --output-document="${gcc_tarball}" tar --directory="$(dirname "${gcc_directory}")" --extract --file="${gcc_tarball}" fi @@ -121,7 +123,7 @@ rm --force --recursive ./* --with-gmp="${toolchain_directory}" \ --enable-shared \ --enable-static \ - CFLAGS="${optflags}" \ + CFLAGS="${optflags} -DHAVE_COMPLEX_H=1" \ CXXFLAGS="${optflags}" \ LDFLAGS="${linkflags}" @@ -129,14 +131,15 @@ make all --jobs make install declare -ra targets=( - # 'alpha-unknown-linux-gnu' - # 'x86_64-unknown-linux-gnu' - # 'i386-unknown-linux-gnu' - # 'arm-unknown-linux-gnueabi' - # 'arm-unknown-linux-gnueabihf' - # 'hppa-unknown-linux-gnu' - # 'aarch64-unknown-linux-gnu' - # 'mips-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-gnueabihf' + 'hppa-unknown-linux-gnu' + 'aarch64-unknown-linux-gnu' + 'mips-unknown-linux-gnu' 'mipsel-unknown-linux-gnu' 'powerpc-unknown-linux-gnu' 's390-unknown-linux-gnu' @@ -147,7 +150,7 @@ declare -ra targets=( ) for target in "${targets[@]}"; do - source "${current_source_directory}/${target}.sh" + source "${workdir}/${target}.sh" cd "$(mktemp --directory)" @@ -201,7 +204,7 @@ for target in "${targets[@]}"; do echo -e "OUTPUT_FORMAT(${output_format})\nGROUP ( ./libpthread.so.0 ./libpthread_nonshared.a )" > './libpthread.so' if [[ "${target}" == mips*-unknown-linux-gnu ]] || [ "${target}" == 'powerpc-unknown-linux-gnu' ] || [ "${target}" == 's390-unknown-linux-gnu' ] || [ "${target}" == 'sparc-unknown-linux-gnu' ]; then - patch --directory="${toolchain_directory}/${triple}" --strip='1' --input="${current_source_directory}/patches/linux_pim.patch" + patch --directory="${toolchain_directory}/${triple}" --strip='1' --input="${workdir}/patches/linux_pim.patch" fi [ -d "${binutils_directory}/build" ] || mkdir "${binutils_directory}/build" @@ -243,7 +246,7 @@ for target in "${targets[@]}"; do --with-static-standard-libraries \ --with-bugurl='https://github.com/AmanoTeam/obggcc/issues' \ --with-gcc-major-version-only \ - --with-pkgversion="OBGGCC v0.5-${obggcc_revision}" \ + --with-pkgversion="OBGGCC v0.6-${obggcc_revision}" \ --with-sysroot="${toolchain_directory}/${triple}" \ --with-native-system-header-dir='/include' \ --enable-__cxa_atexit \ @@ -280,7 +283,7 @@ for target in "${targets[@]}"; do CFLAGS_FOR_TARGET="${optflags} ${linkflags}" \ CXXFLAGS_FOR_TARGET="${optflags} ${linkflags}" \ all \ - --jobs="$(($(nproc) * 12))" + --jobs="${max_jobs}" make install cd "${toolchain_directory}/${triple}/bin" diff --git a/ia64-unknown-linux-gnu.sh b/ia64-unknown-linux-gnu.sh new file mode 100644 index 0000000..4794189 --- /dev/null +++ b/ia64-unknown-linux-gnu.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +declare packages=( + 'http://archive.debian.org/debian/pool/main/l/linux-2.6/linux-libc-dev_2.6.26-29_ia64.deb' + 'http://archive.debian.org/debian/pool/main/g/glibc/libc6.1-dev_2.7-18lenny7_ia64.deb' + 'http://archive.debian.org/debian/pool/main/g/glibc/libc6.1_2.7-18lenny7_ia64.deb' +) + +declare extra_configure_flags='--disable-libsanitizer' + +declare triple='ia64-unknown-linux-gnu' +declare host='ia64-linux-gnu' + +declare output_format='elf64-ia64-little' +declare ld='ld-linux-ia64.so.2' + +declare debian_release_major='5' diff --git a/patches/0001-Revert-gold-Use-char16_t-char32_t-instead-of-uint16_.patch b/patches/0001-Revert-gold-Use-char16_t-char32_t-instead-of-uint16_.patch new file mode 100644 index 0000000..9a850ab --- /dev/null +++ b/patches/0001-Revert-gold-Use-char16_t-char32_t-instead-of-uint16_.patch @@ -0,0 +1,77 @@ +From c5fcba3bc2b47e1061e066deac04efbbdb53362d Mon Sep 17 00:00:00 2001 +From: Kartatz <105828205+Kartatz@users.noreply.github.com> +Date: Wed, 8 May 2024 07:04:54 +0200 +Subject: [PATCH] Revert "gold: Use char16_t, char32_t instead of uint16_t, + uint32_t as character types" + +This reverts commit 5e9091dab8858b25210a91d22fbbbfdee9c969ad. +--- +diff --git a/gold/merge.cc b/gold/merge.cc +index ca15149c767..55de3013a1b 100644 +--- a/gold/merge.cc ++++ b/gold/merge.cc +@@ -665,10 +665,10 @@ template + class Output_merge_string; + + template +-class Output_merge_string; ++class Output_merge_string; + + template +-class Output_merge_string; ++class Output_merge_string; + + #if defined(HAVE_TARGET_32_LITTLE) || defined(HAVE_TARGET_32_BIG) + template +diff --git a/gold/output.cc b/gold/output.cc +index ead67f20363..3375d322506 100644 +--- a/gold/output.cc ++++ b/gold/output.cc +@@ -29,7 +29,6 @@ + #include + #include + #include +-#include + + #ifdef HAVE_SYS_MMAN_H + #include +@@ -2707,10 +2706,10 @@ Output_section::add_merge_input_section(Relobj* object, unsigned int shndx, + pomb = new Output_merge_string(addralign); + break; + case 2: +- pomb = new Output_merge_string(addralign); ++ pomb = new Output_merge_string(addralign); + break; + case 4: +- pomb = new Output_merge_string(addralign); ++ pomb = new Output_merge_string(addralign); + break; + default: + return false; +diff --git a/gold/stringpool.cc b/gold/stringpool.cc +index d8f38cfabc1..2e4a746d1a8 100644 +--- a/gold/stringpool.cc ++++ b/gold/stringpool.cc +@@ -25,7 +25,6 @@ + #include + #include + #include +-#include + + #include "output.h" + #include "parameters.h" +@@ -528,9 +527,9 @@ template + class Stringpool_template; + + template +-class Stringpool_template; ++class Stringpool_template; + + template +-class Stringpool_template; ++class Stringpool_template; + + } // End namespace gold. +-- +2.36.6 +