From b904503691b8e0e737f1a92627b062896a24e02e Mon Sep 17 00:00:00 2001 From: Bananymous Date: Mon, 25 Aug 2025 19:03:43 +0300 Subject: [PATCH] ports: Update GCC 15.1.0->15.2.0 --- ports/gcc/build.sh | 16 ++- ports/gcc/patches/gcc-15.1.0.patch | 1 - ports/gcc/patches/gcc-15.2.0.patch | 1 + toolchain/gcc-15.1.0.patch | 219 ----------------------------- 4 files changed, 14 insertions(+), 223 deletions(-) delete mode 120000 ports/gcc/patches/gcc-15.1.0.patch create mode 120000 ports/gcc/patches/gcc-15.2.0.patch delete mode 100644 toolchain/gcc-15.1.0.patch diff --git a/ports/gcc/build.sh b/ports/gcc/build.sh index 6da9e15a..b6d85f62 100755 --- a/ports/gcc/build.sh +++ b/ports/gcc/build.sh @@ -1,10 +1,9 @@ #!/bin/bash ../install.sh NAME='gcc' -VERSION='15.1.0' -DOWNLOAD_URL="https://ftp.gnu.org/gnu/gcc/gcc-$VERSION/gcc-$VERSION.tar.gz#51b9919ea69c980d7a381db95d4be27edf73b21254eb13d752a08003b4d013b1" +VERSION='15.2.0' +DOWNLOAD_URL="https://ftp.gnu.org/gnu/gcc/gcc-$VERSION/gcc-$VERSION.tar.xz#438fd996826b0c82485a29da03a72d71d6e3541a83ec702df4271f6fe025d24e" DEPENDENCIES=('binutils' 'gmp' 'mpfr' 'mpc') -MAKE_BUILD_TARGETS=('all-gcc' 'all-target-libgcc' 'all-target-libstdc++-v3') MAKE_INSTALL_TARGETS=('install-strip-gcc' 'install-strip-target-libgcc' 'install-strip-target-libstdc++-v3') CONFIGURE_OPTIONS=( "--target=$BANAN_TOOLCHAIN_TRIPLE" @@ -18,6 +17,17 @@ CONFIGURE_OPTIONS=( '--enable-languages=c,c++' ) +build() { + xcflags="" + if [ $BANAN_ARCH = "x86_64" ]; then + xcflags="-mcmodel=large -mno-red-zone" + fi + + make -j$(nproc) all-gcc || exit 1 + make -j$(nproc) all-target-libgcc CFLAGS_FOR_TARGET="$xcflags" || exit 1 + make -j$(nproc) all-target-libstdc++-v3 || exit 1 +} + post_install() { # remove libtool files rm -f $BANAN_SYSROOT/usr/lib/libstdc++.la diff --git a/ports/gcc/patches/gcc-15.1.0.patch b/ports/gcc/patches/gcc-15.1.0.patch deleted file mode 120000 index 65780abe..00000000 --- a/ports/gcc/patches/gcc-15.1.0.patch +++ /dev/null @@ -1 +0,0 @@ -../../../toolchain/gcc-15.1.0.patch \ No newline at end of file diff --git a/ports/gcc/patches/gcc-15.2.0.patch b/ports/gcc/patches/gcc-15.2.0.patch new file mode 120000 index 00000000..4661f0c0 --- /dev/null +++ b/ports/gcc/patches/gcc-15.2.0.patch @@ -0,0 +1 @@ +../../../toolchain/gcc-15.2.0.patch \ No newline at end of file diff --git a/toolchain/gcc-15.1.0.patch b/toolchain/gcc-15.1.0.patch deleted file mode 100644 index c98e0c10..00000000 --- a/toolchain/gcc-15.1.0.patch +++ /dev/null @@ -1,219 +0,0 @@ -diff -ruN gcc-15.1.0/config.sub gcc-15.1.0-banan_os/config.sub ---- gcc-15.1.0/config.sub 2025-04-25 11:17:59.000000000 +0300 -+++ gcc-15.1.0-banan_os/config.sub 2025-06-19 11:29:44.368548733 +0300 -@@ -1749,7 +1749,7 @@ - | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ - | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ - | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \ -- | fiwix* ) -+ | fiwix* | banan_os* ) - ;; - # This one is extra strict with allowed versions - sco3.2v2 | sco3.2v[4-9]* | sco5v6*) -diff -ruN gcc-15.1.0/fixincludes/mkfixinc.sh gcc-15.1.0-banan_os/fixincludes/mkfixinc.sh ---- gcc-15.1.0/fixincludes/mkfixinc.sh 2025-04-25 11:17:59.000000000 +0300 -+++ gcc-15.1.0-banan_os/fixincludes/mkfixinc.sh 2025-06-19 11:30:13.427343038 +0300 -@@ -11,6 +11,7 @@ - - # Check for special fix rules for particular targets - case $machine in -+ *-*-banan_os* | \ - i?86-*-cygwin* | \ - *-mingw32* | \ - powerpc-*-eabisim* | \ -diff -ruN gcc-15.1.0/gcc/config/banan_os.h gcc-15.1.0-banan_os/gcc/config/banan_os.h ---- gcc-15.1.0/gcc/config/banan_os.h 1970-01-01 02:00:00.000000000 +0200 -+++ gcc-15.1.0-banan_os/gcc/config/banan_os.h 2025-06-19 11:30:53.316059523 +0300 -@@ -0,0 +1,35 @@ -+/* Useful if you wish to make target-specific GCC changes. */ -+#undef TARGET_BANAN_OS -+#define TARGET_BANAN_OS 1 -+ -+/* Default arguments you want when running your -+ *-banan_os-gcc toolchain */ -+#undef LIB_SPEC -+#define LIB_SPEC "-lc" /* link against C standard library */ -+ -+/* Files that are linked before user code. -+ The %s tells GCC to look for these files in the library directory. */ -+#undef STARTFILE_SPEC -+#define STARTFILE_SPEC "%{!shared:crt0.o%s} crti.o%s %{shared|static-pie|!no-pie:crtbeginS.o%s; :crtbegin.o%s}" -+ -+/* Files that are linked after user code. */ -+#undef ENDFILE_SPEC -+#define ENDFILE_SPEC "%{shared|static-pie|!no-pie:crtendS.o%s; :crtend.o%s} crtn.o%s" -+ -+#undef LINK_SPEC -+#define LINK_SPEC "%{shared:-shared} %{static:-static} %{!shared: %{!static: %{rdynamic:-export-dynamic}}}" -+ -+/* We don't have separate math library so don't link it. */ -+#undef MATH_LIBRARY -+#define MATH_LIBRARY "" -+ -+/* Additional predefined macros. */ -+#undef TARGET_OS_CPP_BUILTINS -+#define TARGET_OS_CPP_BUILTINS() \ -+ do { \ -+ builtin_define ("__banan_os__"); \ -+ builtin_define ("__unix__"); \ -+ builtin_assert ("system=banan_os"); \ -+ builtin_assert ("system=unix"); \ -+ builtin_assert ("system=posix"); \ -+ } while(0); -diff -ruN gcc-15.1.0/gcc/config/banan_os.opt gcc-15.1.0-banan_os/gcc/config/banan_os.opt ---- gcc-15.1.0/gcc/config/banan_os.opt 1970-01-01 02:00:00.000000000 +0200 -+++ gcc-15.1.0-banan_os/gcc/config/banan_os.opt 2025-06-19 11:31:29.325802503 +0300 -@@ -0,0 +1,32 @@ -+; banan_os options. -+ -+; Copyright (C) 2025 Oskari Alaranta -+; -+; This file is part of GCC. -+; -+; GCC is free software; you can redistribute it and/or modify it under -+; the terms of the GNU General Public License as published by the Free -+; Software Foundation; either version 3, or (at your option) any later -+; version. -+; -+; GCC is distributed in the hope that it will be useful, but WITHOUT ANY -+; WARRANTY; without even the implied warranty of MERCHANTABILITY or -+; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+; for more details. -+; -+; You should have received a copy of the GNU General Public License -+; along with GCC; see the file COPYING3. If not see -+; . -+ -+; See the GCC internals manual (options.texi) for a description of -+; this file's format. -+ -+; Please try to keep this file in ASCII collating order. -+ -+posix -+Driver -+ -+pthread -+Driver -+ -+; This comment is to ensure we retain the blank line above. -diff -ruN gcc-15.1.0/gcc/config/banan_os.opt.urls gcc-15.1.0-banan_os/gcc/config/banan_os.opt.urls ---- gcc-15.1.0/gcc/config/banan_os.opt.urls 1970-01-01 02:00:00.000000000 +0200 -+++ gcc-15.1.0-banan_os/gcc/config/banan_os.opt.urls 2025-06-19 11:31:29.325802503 +0300 -@@ -0,0 +1 @@ -+; Not sure what to put here but this works -diff -ruN gcc-15.1.0/gcc/config.gcc gcc-15.1.0-banan_os/gcc/config.gcc ---- gcc-15.1.0/gcc/config.gcc 2025-04-25 11:18:00.000000000 +0300 -+++ gcc-15.1.0-banan_os/gcc/config.gcc 2025-06-19 11:32:50.391220522 +0300 -@@ -723,6 +723,14 @@ - - # Common parts for widely ported systems. - case ${target} in -+*-*-banan_os*) -+ gas=yes -+ gnu_ld=yes -+ default_use_cxa_atexit=yes -+ extra_options="${extra_options} banan_os.opt" -+ use_gcc_stdint=provide -+ tmake_file="t-slibgcc" -+ ;; - *-*-darwin*) - tmake_file="t-darwin " - tm_file="${tm_file} darwin.h" -@@ -1972,6 +1980,12 @@ - tm_file="${tm_file} i386/unix.h i386/att.h elfos.h newlib-stdint.h i386/i386elf.h i386/x86-64.h i386/rdos.h i386/rdos64.h" - tmake_file="i386/t-i386elf t-svr4" - ;; -+i[34567]86-*-banan_os*) -+ tm_file="${tm_file} i386/unix.h i386/att.h elfos.h glibc-stdint.h i386/i386elf.h banan_os.h" -+ ;; -+x86_64-*-banan_os*) -+ tm_file="${tm_file} i386/unix.h i386/att.h elfos.h glibc-stdint.h i386/i386elf.h i386/x86-64.h banan_os.h" -+ ;; - i[34567]86-*-dragonfly*) - tm_file="${tm_file} i386/unix.h i386/att.h elfos.h dragonfly.h dragonfly-stdint.h i386/dragonfly.h" - tmake_file="${tmake_file} i386/t-crtstuff" -diff -ruN gcc-15.1.0/libgcc/config/t-slibgcc gcc-15.1.0-banan_os/libgcc/config/t-slibgcc ---- gcc-15.1.0/libgcc/config/t-slibgcc 2025-04-25 11:18:04.000000000 +0300 -+++ gcc-15.1.0-banan_os/libgcc/config/t-slibgcc 2025-06-19 11:34:04.674683603 +0300 -@@ -26,7 +26,6 @@ - SHLIB_OBJS = @shlib_objs@ - SHLIB_DIR = @multilib_dir@ - SHLIB_SLIBDIR_QUAL = @shlib_slibdir_qual@ --SHLIB_LC = -lc - SHLIB_MAKE_SOLINK = $(LN_S) $(SHLIB_SONAME) $(SHLIB_DIR)/$(SHLIB_SOLINK) - SHLIB_INSTALL_SOLINK = $(LN_S) $(SHLIB_SONAME) \ - $(DESTDIR)$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK) -diff -ruN gcc-15.1.0/libgcc/config.host gcc-15.1.0-banan_os/libgcc/config.host ---- gcc-15.1.0/libgcc/config.host 2025-04-25 11:18:04.000000000 +0300 -+++ gcc-15.1.0-banan_os/libgcc/config.host 2025-06-19 11:33:42.354845264 +0300 -@@ -627,6 +627,14 @@ - fixed_point=no - fi - ;; -+i[34567]86-*-banan_os*) -+ extra_parts="$extra_parts crti.o crtbegin.o crtbeginS.o crtend.o crtendS.o crtn.o" -+ tmake_file="$tmake_file i386/t-crtstuff t-crtstuff-pic t-libgcc-pic t-slibgcc" -+ ;; -+x86_64-*-banan_os*) -+ extra_parts="$extra_parts crti.o crtbegin.o crtbeginS.o crtend.o crtendS.o crtn.o" -+ tmake_file="$tmake_file i386/t-crtstuff t-crtstuff-pic t-libgcc-pic t-slibgcc" -+ ;; - bfin*-elf*) - tmake_file="bfin/t-bfin bfin/t-crtlibid bfin/t-crtstuff t-libgcc-pic t-fdpbit" - extra_parts="$extra_parts crtbeginS.o crtendS.o crti.o crtn.o crtlibid.o" -diff -ruN gcc-15.1.0/libstdc++-v3/acinclude.m4 gcc-15.1.0-banan_os/libstdc++-v3/acinclude.m4 ---- gcc-15.1.0/libstdc++-v3/acinclude.m4 2025-04-25 11:18:05.000000000 +0300 -+++ gcc-15.1.0-banan_os/libstdc++-v3/acinclude.m4 2025-06-19 11:34:58.939289470 +0300 -@@ -1792,7 +1792,7 @@ - ac_has_nanosleep=yes - ac_has_sched_yield=yes - ;; -- freebsd*|netbsd*|dragonfly*|rtems*) -+ freebsd*|netbsd*|dragonfly*|rtems*|banan_os*) - ac_has_clock_monotonic=yes - ac_has_clock_realtime=yes - ac_has_nanosleep=yes -diff -ruN gcc-15.1.0/libstdc++-v3/configure gcc-15.1.0-banan_os/libstdc++-v3/configure ---- gcc-15.1.0/libstdc++-v3/configure 2025-04-25 11:18:05.000000000 +0300 -+++ gcc-15.1.0-banan_os/libstdc++-v3/configure 2025-06-19 11:37:41.265102481 +0300 -@@ -15789,8 +15789,8 @@ if test "$enable_shared" = yes; then - glibcxx_compiler_shared_flag="-D_GLIBCXX_SHARED" - - else -- glibcxx_lt_pic_flag= -- glibcxx_compiler_pic_flag= -+ glibcxx_lt_pic_flag="-prefer-pic" -+ glibcxx_compiler_pic_flag="$lt_prog_compiler_pic_CXX" - glibcxx_compiler_shared_flag= - fi - -@@ -21377,7 +21377,7 @@ - ac_has_nanosleep=yes - ac_has_sched_yield=yes - ;; -- freebsd*|netbsd*|dragonfly*|rtems*) -+ freebsd*|netbsd*|dragonfly*|rtems*|banan_os*) - ac_has_clock_monotonic=yes - ac_has_clock_realtime=yes - ac_has_nanosleep=yes -@@ -28654,7 +28654,7 @@ - # This is a freestanding configuration; there is nothing to do here. - ;; - -- avr*-*-*) -+ avr*-*-* | *banan_os*) - $as_echo "#define HAVE_ACOSF 1" >>confdefs.h - - $as_echo "#define HAVE_ASINF 1" >>confdefs.h -diff -ruN gcc-15.1.0/libstdc++-v3/crossconfig.m4 gcc-15.1.0-banan_os/libstdc++-v3/crossconfig.m4 ---- gcc-15.1.0/libstdc++-v3/crossconfig.m4 2025-04-25 11:18:05.000000000 +0300 -+++ gcc-15.1.0-banan_os/libstdc++-v3/crossconfig.m4 2025-06-19 11:36:53.954449540 +0300 -@@ -9,7 +9,7 @@ - # This is a freestanding configuration; there is nothing to do here. - ;; - -- avr*-*-*) -+ avr*-*-* | *banan_os*) - AC_DEFINE(HAVE_ACOSF) - AC_DEFINE(HAVE_ASINF) - AC_DEFINE(HAVE_ATAN2F)