Skip to content

Commit 1b2ebbc

Browse files
committed
Update to GCC 15.0.1
1 parent 7803e5f commit 1b2ebbc

28 files changed

+701
-200
lines changed

.github/workflows/build.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
id: check-cache
1818
uses: actions/cache@main
1919
with:
20-
key: gcc-14.2.0
20+
key: gcc-15.0.1-1
2121
lookup-only: true
2222
path: |
2323
/tmp/x86_64-linux-gnu.tar.xz
@@ -45,7 +45,7 @@ jobs:
4545
if: ${{ steps.check-cache.outputs.cache-hit != 'true' }}
4646
uses: actions/cache@main
4747
with:
48-
key: gcc-14.2.0
48+
key: gcc-15.0.1-1
4949
path: |
5050
/tmp/x86_64-linux-gnu.tar.xz
5151
/tmp/x86_64-linux-gnu.tar.xz.sha256
@@ -82,7 +82,7 @@ jobs:
8282
- name: Restore from cache
8383
uses: actions/cache@main
8484
with:
85-
key: gcc-14.2.0
85+
key: gcc-15.0.1-1
8686
fail-on-cache-miss: true
8787
path: |
8888
/tmp/x86_64-linux-gnu.tar.xz

build.sh

+35-53
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ declare -r workdir="${PWD}"
77
declare -r revision="$(git rev-parse --short HEAD)"
88

99
declare -r toolchain_directory='/tmp/raiden'
10+
declare -r share_directory="${toolchain_directory}/usr/local/share/raiden"
1011

1112
declare -r gmp_tarball='/tmp/gmp.tar.xz'
1213
declare -r gmp_directory='/tmp/gmp-6.3.0'
@@ -18,47 +19,17 @@ declare -r mpc_tarball='/tmp/mpc.tar.gz'
1819
declare -r mpc_directory='/tmp/mpc-1.3.1'
1920

2021
declare -r binutils_tarball='/tmp/binutils.tar.xz'
21-
declare -r binutils_directory='/tmp/binutils-2.43'
22+
declare -r binutils_directory='/tmp/binutils-with-gold-2.44'
2223

23-
declare gcc_directory=''
24+
declare -r gcc_tarball='/tmp/gcc.tar.xz'
25+
declare -r gcc_directory='/tmp/gcc-master'
2426

2527
declare -r sysroot_tarball='/tmp/sysroot.tar.xz'
2628

27-
function setup_gcc_source() {
28-
29-
local gcc_version=''
30-
local gcc_url=''
31-
local gcc_tarball=''
32-
local tgt="${1}"
33-
34-
declare -r tgt
35-
36-
gcc_version='14'
37-
gcc_directory='/tmp/gcc-14.2.0'
38-
gcc_url='https://ftp.gnu.org/gnu/gcc/gcc-14.2.0/gcc-14.2.0.tar.xz'
39-
40-
gcc_tarball="/tmp/gcc-${gcc_version}.tar.xz"
41-
42-
declare -r gcc_version
43-
declare -r gcc_url
44-
declare -r gcc_tarball
45-
46-
if ! [ -f "${gcc_tarball}" ]; then
47-
wget --no-verbose "${gcc_url}" --output-document="${gcc_tarball}"
48-
tar --directory="$(dirname "${gcc_directory}")" --extract --file="${gcc_tarball}"
49-
fi
50-
51-
[ -d "${gcc_directory}/build" ] || mkdir "${gcc_directory}/build"
52-
53-
sed --in-place 's/LDBL_MANT_DIG == 113/defined(__powerpc__) || defined(__powerpc64__) || defined(__s390x__)/g' "${gcc_directory}/libgcc/dfp-bit.h"
54-
sed --in-place 's/soft-fp.h/this-does-not-exist.h/g' "${gcc_directory}/libquadmath/math/sqrtq.c"
55-
56-
}
57-
58-
declare -r optflags='-Os'
29+
declare -r optflags='-w -Os'
5930
declare -r linkflags='-Wl,-s'
6031

61-
declare -r max_jobs="$(($(nproc) * 17))"
32+
declare -r max_jobs="$(($(nproc) * 10))"
6233

6334
declare build_type="${1}"
6435

@@ -98,10 +69,24 @@ if ! [ -f "${mpc_tarball}" ]; then
9869
fi
9970

10071
if ! [ -f "${binutils_tarball}" ]; then
101-
wget --no-verbose 'https://ftp.gnu.org/gnu/binutils/binutils-2.43.tar.xz' --output-document="${binutils_tarball}"
72+
wget --no-verbose 'https://ftp.gnu.org/gnu/binutils/binutils-with-gold-2.44.tar.xz' --output-document="${binutils_tarball}"
10273
tar --directory="$(dirname "${binutils_directory}")" --extract --file="${binutils_tarball}"
10374

104-
patch --directory="${binutils_directory}" --strip='1' --input="${workdir}/patches/0001-Revert-gold-Use-char16_t-char32_t-instead-of-uint16_.patch"
75+
patch --directory="${binutils_directory}" --strip='1' --input="${workdir}/submodules/obggcc/patches/0001-Revert-gold-Use-char16_t-char32_t-instead-of-uint16_.patch"
76+
patch --directory="${binutils_directory}" --strip='1' --input="${workdir}/submodules/obggcc/patches/0001-Disable-annoying-linker-warnings.patch"
77+
fi
78+
79+
if ! [ -f "${gcc_tarball}" ]; then
80+
wget --no-verbose 'https://github.com/gcc-mirror/gcc/archive/refs/heads/master.tar.gz' --output-document="${gcc_tarball}"
81+
tar --directory="$(dirname "${gcc_directory}")" --extract --file="${gcc_tarball}"
82+
83+
patch --directory="${gcc_directory}" --strip='1' --input="${workdir}/submodules/obggcc/patches/0001-Fix-libgcc-build-on-arm.patch"
84+
patch --directory="${gcc_directory}" --strip='1' --input="${workdir}/submodules/obggcc/patches/0001-Change-the-default-language-version-for-C-compilatio.patch"
85+
patch --directory="${gcc_directory}" --strip='1' --input="${workdir}/submodules/obggcc/patches/0001-Turn-Wimplicit-int-back-into-an-warning.patch"
86+
patch --directory="${gcc_directory}" --strip='1' --input="${workdir}/submodules/obggcc/patches/0001-Turn-Wint-conversion-back-into-an-warning.patch"
87+
patch --directory="${gcc_directory}" --strip='1' --input="${workdir}/submodules/obggcc/patches/0001-Revert-GCC-change-about-turning-Wimplicit-function-d.patch"
88+
patch --directory="${gcc_directory}" --strip='1' --input="${workdir}/patches/0001-Fix-libgcc-build-on-musl.patch"
89+
patch --directory="${gcc_directory}" --strip='1' --input="${workdir}/patches/0001-Fix-libquadmath-build-on-musl.patch"
10590
fi
10691

10792
[ -d "${gmp_directory}/build" ] || mkdir "${gmp_directory}/build"
@@ -147,24 +132,21 @@ cd "${mpc_directory}/build"
147132
--enable-shared \
148133
--enable-static \
149134
${cross_compile_flags} \
150-
CFLAGS="${optflags} -fpermissive" \
135+
CFLAGS="${optflags}" \
151136
CXXFLAGS="${optflags}" \
152137
LDFLAGS="${linkflags}"
153138

154139
make all --jobs
155140
make install
156141

157142
declare -ra targets=(
158-
# 'powerpc-unknown-linux-musl'
159-
's390x-unknown-linux-musl'
143+
'arm-unknown-linux-musleabihf'
144+
'armv7l-unknown-linux-musleabihf'
160145
'powerpc64le-unknown-linux-musl'
161-
# 'mips-unknown-linux-musl'
162-
# 'mipsel-unknown-linux-musl'
146+
's390x-unknown-linux-musl'
163147
'mips64-unknown-linux-musl'
164-
'armv7l-unknown-linux-musleabihf'
165148
'x86_64-unknown-linux-musl'
166149
'aarch64-unknown-linux-musl'
167-
'arm-unknown-linux-musleabihf'
168150
'riscv64-unknown-linux-musl'
169151
'i386-unknown-linux-musl'
170152
)
@@ -210,8 +192,6 @@ for target in "${targets[@]}"; do
210192
make all --jobs
211193
make install
212194

213-
setup_gcc_source "${triplet}"
214-
215195
[ -d "${gcc_directory}/build" ] || mkdir "${gcc_directory}/build"
216196

217197
cd "${gcc_directory}/build"
@@ -226,7 +206,7 @@ for target in "${targets[@]}"; do
226206
--with-mpc="${toolchain_directory}" \
227207
--with-mpfr="${toolchain_directory}" \
228208
--with-bugurl='https://github.com/AmanoTeam/Raiden/issues' \
229-
--with-pkgversion="Raiden v0.6-${revision}" \
209+
--with-pkgversion="Raiden v0.7-${revision}" \
230210
--with-sysroot="${toolchain_directory}/${triplet}" \
231211
--with-gcc-major-version-only \
232212
--with-native-system-header-dir='/include' \
@@ -241,14 +221,15 @@ for target in "${targets[@]}"; do
241221
--enable-link-serialization='1' \
242222
--enable-linker-build-id \
243223
--enable-lto \
244-
--enable-plugin \
245224
--enable-shared \
246225
--enable-threads='posix' \
247226
--enable-ld \
248227
--enable-gold \
249228
--enable-languages='c,c++' \
250-
--disable-gnu-unique-object \
229+
--disable-plugin \
251230
--disable-libsanitizer \
231+
--disable-fixincludes \
232+
--disable-gnu-unique-object \
252233
--disable-symvers \
253234
--disable-sjlj-exceptions \
254235
--disable-target-libiberty \
@@ -264,7 +245,7 @@ for target in "${targets[@]}"; do
264245
libat_cv_have_ifunc=no \
265246
CFLAGS="${optflags}" \
266247
CXXFLAGS="${optflags}" \
267-
LDFLAGS="-Wl,-rpath-link,${OBGGCC_TOOLCHAIN}/${CROSS_COMPILE_TRIPLET}/lib ${linkflags}"
248+
LDFLAGS="${linkflags}"
268249

269250
LD_LIBRARY_PATH="${toolchain_directory}/lib" PATH="${PATH}:${toolchain_directory}/bin" make \
270251
CFLAGS_FOR_TARGET="${optflags} ${linkflags}" \
@@ -279,10 +260,11 @@ for target in "${targets[@]}"; do
279260
ln --symbolic "../../bin/${triplet}-${name}" "${name}"
280261
done
281262

282-
rm --recursive "${toolchain_directory}/share"
283-
rm --recursive "${toolchain_directory}/lib/gcc/${triplet}/"*"/include-fixed"
284-
285263
patchelf --add-rpath '$ORIGIN/../../../../lib' "${toolchain_directory}/libexec/gcc/${triplet}/"*"/cc1"
286264
patchelf --add-rpath '$ORIGIN/../../../../lib' "${toolchain_directory}/libexec/gcc/${triplet}/"*"/cc1plus"
287265
patchelf --add-rpath '$ORIGIN/../../../../lib' "${toolchain_directory}/libexec/gcc/${triplet}/"*"/lto1"
288266
done
267+
268+
mkdir --parent "${share_directory}"
269+
270+
cp --recursive "${workdir}/tools/dev/"* "${share_directory}"

build_all.sh

-39
This file was deleted.

mips-unknown-linux-musl.sh

-9
This file was deleted.

mipsel-unknown-linux-musl.sh

-9
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
From 8935150cb28bc218249ea11f17093d0f1a9c1311 Mon Sep 17 00:00:00 2001
2+
From: Kartatz <[email protected]>
3+
Date: Fri, 14 Feb 2025 02:05:07 +0100
4+
Subject: [PATCH] Fix libgcc build on musl
5+
6+
---
7+
libgcc/dfp-bit.h | 2 +-
8+
1 file changed, 1 insertion(+), 1 deletion(-)
9+
10+
diff --git a/libgcc/dfp-bit.h b/libgcc/dfp-bit.h
11+
index 0468ea1..cbc271b 100644
12+
--- a/libgcc/dfp-bit.h
13+
+++ b/libgcc/dfp-bit.h
14+
@@ -288,7 +288,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
15+
#elif LDBL_MANT_DIG == 113
16+
#define BFP_FMT "%.36Le"
17+
#else
18+
-#error "unknown long double size, cannot define BFP_FMT"
19+
+#define BFP_FMT "%Le"
20+
#endif /* LDBL_MANT_DIG */
21+
#define STR_TO_BFP strtold
22+
#define BFP_VIA_TYPE long double
23+
--
24+
2.36.6
25+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
From f3a476cf1da06c99aa1dff09c4e8829a9b9db33c Mon Sep 17 00:00:00 2001
2+
From: Kartatz <[email protected]>
3+
Date: Fri, 14 Feb 2025 02:15:49 +0100
4+
Subject: [PATCH] Fix libquadmath build on musl
5+
6+
---
7+
libquadmath/math/sqrtq.c | 4 ++--
8+
1 file changed, 2 insertions(+), 2 deletions(-)
9+
10+
diff --git a/libquadmath/math/sqrtq.c b/libquadmath/math/sqrtq.c
11+
index a58998a..37e6392 100644
12+
--- a/libquadmath/math/sqrtq.c
13+
+++ b/libquadmath/math/sqrtq.c
14+
@@ -1,7 +1,7 @@
15+
#include "quadmath-imp.h"
16+
#include <math.h>
17+
#include <float.h>
18+
-#if __has_include("../../libgcc/soft-fp/soft-fp.h") \
19+
+#if __has_include("../../libgcc/soft-fp/this-does-not-exist.h") \
20+
&& __has_include("../../libgcc/soft-fp/quad.h") \
21+
&& defined(FE_TONEAREST) \
22+
&& defined(FE_UPWARD) \
23+
@@ -12,7 +12,7 @@
24+
#if defined(_ARCH_PPC) && !defined(__LONG_DOUBLE_IEEE128__)
25+
#define TFtype __float128
26+
#endif
27+
-#include "../../libgcc/soft-fp/soft-fp.h"
28+
+#include "../../libgcc/soft-fp/this-does-not-exist.h"
29+
#include "../../libgcc/soft-fp/quad.h"
30+
#endif
31+
32+
--
33+
2.36.6
34+

0 commit comments

Comments
 (0)