Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Bernd Kuhls <bernd@kuhls.net>
To: buildroot@buildroot.org
Cc: Zoltan Gyarmati <mr.zoltan.gyarmati@gmail.com>,
	Tudor Holton <buildroot@tudorholton.com>,
	Fabrice Fontaine <fontaine.fabrice@gmail.com>,
	Angelo Compagnucci <angelo.compagnucci@gmail.com>,
	Olivier Schonken <olivier.schonken@gmail.com>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	Romain Naour <romain.naour@gmail.com>,
	Giulio Benetti <giulio.benetti@benettiengineering.com>
Subject: [Buildroot] [PATCH v4 18/21] package/gcc: add version 16.1.0
Date: Fri,  1 May 2026 17:27:54 +0200	[thread overview]
Message-ID: <20260501152758.2610763-19-bernd@kuhls.net> (raw)
In-Reply-To: <20260501152758.2610763-1-bernd@kuhls.net>

Added libatomic to HOST_GCC_INITIAL_EXCLUDES to fix linking error with
libc:

output/host/lib/gcc/x86_64-buildroot-linux-gnu/16.0.1/../../../../x86_64-buildroot-linux-gnu/bin/ld:
 cannot find -latomic_asneeded: No such file or directory

caused by upstream commit
https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=e63cf4b130b86dd7dde1bf499d3d40faca10ea2e
which added libatomic/ to $bootstrap_target_libs.

For details see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81358

Copied patches 0001 & 0003 from package/gcc/15.2.0/
Patch 0002 was applied upstream:
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=7894c00982c570d684fe5b82d8fb3aafc34d6986

Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
 .checkpackageignore                           |  1 +
 ...le-split-stack-for-non-thread-builds.patch | 26 +++++++++
 ...-config-microblaze-fix-ira-for-GCC15.patch | 56 +++++++++++++++++++
 package/gcc/Config.in.host                    |  9 +++
 package/gcc/gcc-initial/gcc-initial.mk        |  2 +-
 package/gcc/gcc.hash                          |  2 +
 6 files changed, 95 insertions(+), 1 deletion(-)
 create mode 100644 package/gcc/16.1.0/0001-disable-split-stack-for-non-thread-builds.patch
 create mode 100644 package/gcc/16.1.0/0002-gcc-config-microblaze-fix-ira-for-GCC15.patch

diff --git a/.checkpackageignore b/.checkpackageignore
index 6147aae299..f53d4c931d 100644
--- a/.checkpackageignore
+++ b/.checkpackageignore
@@ -358,6 +358,7 @@ package/fxload/0001-fix-static-build.patch lib_patch.Upstream
 package/gcc/13.4.0/0001-disable-split-stack-for-non-thread-builds.patch lib_patch.Upstream
 package/gcc/14.3.0/0001-disable-split-stack-for-non-thread-builds.patch lib_patch.Upstream
 package/gcc/15.2.0/0001-disable-split-stack-for-non-thread-builds.patch lib_patch.Upstream
+package/gcc/16.1.0/0001-disable-split-stack-for-non-thread-builds.patch lib_patch.Upstream
 package/gcc/8.4.0/0001-xtensa-fix-PR-target-91880.patch lib_patch.Upstream
 package/gcc/8.4.0/0002-Revert-re-PR-target-92095-internal-error-with-O1-mcp.patch lib_patch.Upstream
 package/gcc/8.4.0/0003-libsanitizer-Remove-cyclades-from-libsanitizer.patch lib_patch.Upstream
diff --git a/package/gcc/16.1.0/0001-disable-split-stack-for-non-thread-builds.patch b/package/gcc/16.1.0/0001-disable-split-stack-for-non-thread-builds.patch
new file mode 100644
index 0000000000..c3b600cfb8
--- /dev/null
+++ b/package/gcc/16.1.0/0001-disable-split-stack-for-non-thread-builds.patch
@@ -0,0 +1,26 @@
+From 7d5f59e035341430e20f47420535d0e987516e55 Mon Sep 17 00:00:00 2001
+From: Waldemar Brodkorb <wbx@openadk.org>
+Date: Mon, 25 Jul 2022 00:29:55 +0200
+Subject: [PATCH] disable split-stack for non-thread builds
+
+Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
+[Romain: convert to git format]
+Signed-off-by: Romain Naour <romain.naour@smile.fr>
+---
+ libgcc/config/t-stack | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/libgcc/config/t-stack b/libgcc/config/t-stack
+index cc0366b4cd8..f3f97e86d60 100644
+--- a/libgcc/config/t-stack
++++ b/libgcc/config/t-stack
+@@ -1,4 +1,6 @@
+ # Makefile fragment to provide generic support for -fsplit-stack.
+ # This should be used in config.host for any host which supports
+ # -fsplit-stack.
++ifeq ($(enable_threads),yes)
+ LIB2ADD_ST += $(srcdir)/generic-morestack.c $(srcdir)/generic-morestack-thread.c
++endif
+-- 
+2.50.1
+
diff --git a/package/gcc/16.1.0/0002-gcc-config-microblaze-fix-ira-for-GCC15.patch b/package/gcc/16.1.0/0002-gcc-config-microblaze-fix-ira-for-GCC15.patch
new file mode 100644
index 0000000000..663aab7218
--- /dev/null
+++ b/package/gcc/16.1.0/0002-gcc-config-microblaze-fix-ira-for-GCC15.patch
@@ -0,0 +1,56 @@
+From d2fdbd8c4abe67eea86877dfb3b3b9d8508c165f Mon Sep 17 00:00:00 2001
+From: Romain Naour <romain.naour@gmail.com>
+Date: Wed, 6 Aug 2025 22:32:30 +0200
+Subject: [PATCH] gcc/config/microblaze: fix ira for GCC15
+
+Add new hooks for callee-save on microblaze defined by [1] and
+return 1 to restore the old behavior prior to the commit [3].
+
+Tested with qemu_microblazeel_mmu_defconfig and used to generate
+Microblaze toolchains for the Bootlin toolchains 2025.08-1 [4][5].
+
+Upstream: suggested in the bug report: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121432#c10
+
+[1] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=b191e8bdecf881d11c1544c441e38f4c18392a15
+[2] https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/config/i386/i386.cc;h=3128973ba79cccfc6761f451dcb716b9558cc4da;hb=d3ff498c478acefce35de04402f99171b4f64a1a#l20606
+[3] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=3b9b8d6cfdf59337f4b7ce10ce92a98044b2657b
+[4] https://lore.kernel.org/buildroot/87sehzndtp.fsf@dell.be.48ers.dk/T/#mce7decd0b3f6a41008d5de577538a8525c91b374
+[5] https://toolchains.bootlin.com/
+
+Signed-off-by: Romain Naour <romain.naour@gmail.com>
+---
+ gcc/config/microblaze/microblaze.cc | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
+
+diff --git a/gcc/config/microblaze/microblaze.cc b/gcc/config/microblaze/microblaze.cc
+index 78b9428ef3b..84ea7e8d55a 100644
+--- a/gcc/config/microblaze/microblaze.cc
++++ b/gcc/config/microblaze/microblaze.cc
+@@ -3228,6 +3228,14 @@ microblaze_secondary_reload (bool in_p ATTRIBUTE_UNUSED, rtx x ATTRIBUTE_UNUSED,
+   return NO_REGS;
+ }
+ 
++/* Implement TARGET_CALLEE_SAVE_COST.  */
++static int
++microblaze_callee_save_cost (spill_cost_type, unsigned int hard_regno, machine_mode,
++		       unsigned int, int mem_cost, const HARD_REG_SET &, bool)
++{
++  return 1;
++}
++
+ static void
+ microblaze_globalize_label (FILE * stream, const char *name)
+ {
+@@ -4066,6 +4074,9 @@ microblaze_starting_frame_offset (void)
+ #undef TARGET_SECONDARY_RELOAD
+ #define TARGET_SECONDARY_RELOAD		microblaze_secondary_reload
+ 
++#undef TARGET_CALLEE_SAVE_COST
++#define TARGET_CALLEE_SAVE_COST microblaze_callee_save_cost
++
+ #undef  TARGET_ASM_OUTPUT_MI_THUNK
+ #define TARGET_ASM_OUTPUT_MI_THUNK      microblaze_asm_output_mi_thunk
+ 
+-- 
+2.50.1
+
diff --git a/package/gcc/Config.in.host b/package/gcc/Config.in.host
index 21581487df..b9dd37471f 100644
--- a/package/gcc/Config.in.host
+++ b/package/gcc/Config.in.host
@@ -46,6 +46,14 @@ config BR2_GCC_VERSION_15_X
 	depends on !BR2_POWERPC_CPU_HAS_SPE
 	select BR2_TOOLCHAIN_GCC_AT_LEAST_15
 
+config BR2_GCC_VERSION_16_X
+	bool "gcc 16.x"
+	depends on !BR2_ARCH_NEEDS_GCC_AT_LEAST_17
+	# powerpc spe support has been deprecated since gcc 8.x.
+	# https://gcc.gnu.org/ml/gcc/2018-04/msg00102.html
+	depends on !BR2_POWERPC_CPU_HAS_SPE
+	select BR2_TOOLCHAIN_GCC_AT_LEAST_16
+
 endchoice
 
 config BR2_GCC_SUPPORTS_DLANG
@@ -71,6 +79,7 @@ config BR2_GCC_VERSION
 	default "13.4.0"    if BR2_GCC_VERSION_13_X
 	default "14.3.0"    if BR2_GCC_VERSION_14_X
 	default "15.2.0"    if BR2_GCC_VERSION_15_X
+	default "16.1.0"    if BR2_GCC_VERSION_16_X
 	default "arc-2024.12-release" if BR2_GCC_VERSION_ARC
 
 config BR2_EXTRA_GCC_CONFIG_OPTIONS
diff --git a/package/gcc/gcc-initial/gcc-initial.mk b/package/gcc/gcc-initial/gcc-initial.mk
index 1f8b76a942..18d5cef0f8 100644
--- a/package/gcc/gcc-initial/gcc-initial.mk
+++ b/package/gcc/gcc-initial/gcc-initial.mk
@@ -17,7 +17,7 @@ HOST_GCC_INITIAL_DL_SUBDIR = gcc
 
 HOST_GCC_INITIAL_DEPENDENCIES = $(HOST_GCC_COMMON_DEPENDENCIES)
 
-HOST_GCC_INITIAL_EXCLUDES = $(HOST_GCC_EXCLUDES)
+HOST_GCC_INITIAL_EXCLUDES = $(HOST_GCC_EXCLUDES) libatomic
 
 ifneq ($(ARCH_XTENSA_OVERLAY_FILE),)
 HOST_GCC_INITIAL_POST_EXTRACT_HOOKS += HOST_GCC_XTENSA_OVERLAY_EXTRACT
diff --git a/package/gcc/gcc.hash b/package/gcc/gcc.hash
index deb7c40fa3..da6aa6e879 100644
--- a/package/gcc/gcc.hash
+++ b/package/gcc/gcc.hash
@@ -6,6 +6,8 @@ sha512  9b4b83ecf51ef355b868608b8d257b2fa435c06d2719cb86657a7c2c2a0828ff4ce04e9b
 sha512  cb4e3259640721bbd275c723fe4df53d12f9b1673afb3db274c22c6aa457865dccf2d6ea20b4fd4c591f6152e6d4b87516c402015900f06ce9d43af66d3b7a93  gcc-14.3.0.tar.xz
 # From https://gcc.gnu.org/pub/gcc/releases/gcc-15.2.0/sha512.sum
 sha512  89047a2e07bd9da265b507b516ed3635adb17491c7f4f67cf090f0bd5b3fc7f2ee6e4cc4008beef7ca884b6b71dffe2bb652b21f01a702e17b468cca2d10b2de  gcc-15.2.0.tar.xz
+# From https://gcc.gnu.org/pub/gcc/releases/gcc-16.1.0/sha512.sum
+sha512  b3454958891ab47e1e5b6cb9396c0ad3b04f32fe2a7bf1153a143f21013fdb6b295ca94c98964698a688e4c1d7555ffd8ffbc20187507cce6b1c32cbcc09897a  gcc-16.1.0.tar.xz
 
 # Locally calculated (fetched from Github)
 sha512  7f08ae335d9112be65e92c3744c095d8fa265994b8282274948f99fe37409531e627e6dadfb77b138a82fa09d012c56d8c075b482a5a5186814a57f9db63c29e  gcc-arc-2024.12-release.tar.gz
-- 
2.47.3

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  parent reply	other threads:[~2026-05-01 15:32 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-01 15:27 [Buildroot] [PATCH v4 00/21] package/gcc: add version 16.1.0 Bernd Kuhls
2026-05-01 15:27 ` [Buildroot] [PATCH v4 01/21] package/autoconf: bump version to 2.73 Bernd Kuhls
2026-05-01 15:27 ` [Buildroot] [PATCH v4 02/21] package/autoconf-archive: bump version to 2024.10.16 Bernd Kuhls
2026-05-01 15:27 ` [Buildroot] [PATCH v4 03/21] package/redis-plus-plus: disable -Werror Bernd Kuhls
2026-05-01 15:27 ` [Buildroot] [PATCH v4 04/21] package/dump1090: " Bernd Kuhls
2026-05-01 15:27 ` [Buildroot] [PATCH v4 05/21] package/qt5/qt5webkit: Fix build with gcc 16.x Bernd Kuhls
2026-05-01 15:27 ` [Buildroot] [PATCH v4 06/21] package/grantlee: " Bernd Kuhls
2026-05-01 15:27 ` [Buildroot] [PATCH v4 07/21] package/cups-filters: add upstream patch to fix CVE-2025-64524 Bernd Kuhls
2026-05-04 14:55   ` Thomas Perale via buildroot
2026-05-01 15:27 ` [Buildroot] [PATCH v4 08/21] package/qpdf: bump to version 12.3.2 Bernd Kuhls
2026-05-01 15:27 ` [Buildroot] [PATCH v4 09/21] package/cups-filters: fix build against qpdf 12 Bernd Kuhls
2026-05-01 15:27 ` [Buildroot] [PATCH v4 10/21] package/cups-filters: needs autoreconf to fix build with gcc 16.x Bernd Kuhls
2026-05-01 15:27 ` [Buildroot] [PATCH v4 11/21] package/openjdk{-bin}: bump versions to latest 17.x and 21.x series Bernd Kuhls
2026-05-01 15:27 ` [Buildroot] [PATCH v4 12/21] package/openjdk{-bin}: add OpenJDK25 and configure it as latest Bernd Kuhls
2026-05-01 15:27 ` [Buildroot] [PATCH v4 13/21] package/snappy: enable rtti Bernd Kuhls
2026-05-01 15:27 ` [Buildroot] [PATCH v4 14/21] package/rocksdb: bump version to 11.0.4 Bernd Kuhls
2026-05-01 15:27 ` [Buildroot] [PATCH v4 15/21] toolchain/Config.in: add BR2_TOOLCHAIN_GCC_AT_LEAST_16 blind option Bernd Kuhls
2026-05-01 15:27 ` [Buildroot] [PATCH v4 16/21] arch/Config.in: introduce BR2_ARCH_NEEDS_GCC_AT_LEAST_17 Bernd Kuhls
2026-05-01 15:27 ` [Buildroot] [PATCH v4 17/21] toolchain/toolchain-external/toolchain-external-custom: add gcc 16 version selection Bernd Kuhls
2026-05-01 15:27 ` Bernd Kuhls [this message]
2026-05-01 15:27 ` [Buildroot] [PATCH v4 19/21] package/gcc: switch to GCC 15.x as the default Bernd Kuhls
2026-05-01 15:27 ` [Buildroot] [PATCH v4 20/21] support/config-fragments/autobuild/br-arm-internal-glibc: update to bleeding edge components Bernd Kuhls
2026-05-01 15:27 ` [Buildroot] [PATCH v4 21/21] package/gcc: drop support for GCC 13.x Bernd Kuhls

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260501152758.2610763-19-bernd@kuhls.net \
    --to=bernd@kuhls.net \
    --cc=angelo.compagnucci@gmail.com \
    --cc=buildroot@buildroot.org \
    --cc=buildroot@tudorholton.com \
    --cc=fontaine.fabrice@gmail.com \
    --cc=giulio.benetti@benettiengineering.com \
    --cc=mr.zoltan.gyarmati@gmail.com \
    --cc=olivier.schonken@gmail.com \
    --cc=romain.naour@gmail.com \
    --cc=thomas.petazzoni@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox