summaryrefslogtreecommitdiff
path: root/util/crossgcc/patches/gcc-14.2.0_gnat.patch
diff options
context:
space:
mode:
authorElyes Haouas <ehaouas@noos.fr>2024-08-09 03:04:07 +0200
committerFelix Singer <service+coreboot-gerrit@felixsinger.de>2024-08-23 21:39:59 +0000
commitf35f18d858dae59965cc177ceaa304b2fdb551b5 (patch)
tree4fce70a45e28d83acd6abdaab2c8b080c9fb6700 /util/crossgcc/patches/gcc-14.2.0_gnat.patch
parent69618cd527012c84fb6c5863e2bb4fbf01406a9b (diff)
crossgcc: Upgrade GCC from 14.1.0 to 14.2.0
Change-Id: I6ffff766fb1fa91ad376c3e7e9aebe17c3288725 Signed-off-by: Elyes Haouas <ehaouas@noos.fr> Reviewed-on: https://review.coreboot.org/c/coreboot/+/83839 Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'util/crossgcc/patches/gcc-14.2.0_gnat.patch')
-rw-r--r--util/crossgcc/patches/gcc-14.2.0_gnat.patch108
1 files changed, 108 insertions, 0 deletions
diff --git a/util/crossgcc/patches/gcc-14.2.0_gnat.patch b/util/crossgcc/patches/gcc-14.2.0_gnat.patch
new file mode 100644
index 0000000000..2a37b155c4
--- /dev/null
+++ b/util/crossgcc/patches/gcc-14.2.0_gnat.patch
@@ -0,0 +1,108 @@
+From b1b16478729aea709e7ef81224995b6d26b38a87 Mon Sep 17 00:00:00 2001
+From: Nico Huber <nico.h@gmx.de>
+Date: Sun, 16 Jul 2023 00:30:03 +0200
+Subject: [PATCH] GNAT: Build cross compilers with host runtime
+
+When building with an older host toolchain, the shipped libgnat
+sources may not be compatible. So rely on the host runtime just
+like we do for a stage1 build.
+
+Signed-off-by: Nico Huber <nico.h@gmx.de>
+---
+ gcc/ada/gcc-interface/Make-lang.in | 16 +++++++++++++---
+ gcc/ada/init.c | 4 ++++
+ 2 files changed, 17 insertions(+), 3 deletions(-)
+
+diff --git a/gcc/ada/gcc-interface/Make-lang.in b/gcc/ada/gcc-interface/Make-lang.in
+index 9507f2f09203..cf7ec4cc1662 100644
+--- a/gcc/ada/gcc-interface/Make-lang.in
++++ b/gcc/ada/gcc-interface/Make-lang.in
+@@ -57,18 +57,21 @@ WARN_ADAFLAGS= -W -Wall
+ # checks fully active.
+
+ STAGE1=False
++HOST_RT=False
+ GNATBIND_FLAGS=
+ GNATLIB=
+
++ADAFLAGS=$(COMMON_ADAFLAGS) -gnatwns
+ ifeq ($(CROSS),)
+- ADAFLAGS=$(COMMON_ADAFLAGS) -gnatwns
+
+ ifeq ($(if $(wildcard ../stage_current),$(shell cat ../stage_current),stage1),stage1)
+ STAGE1=True
+ GNATBIND_FLAGS=-t
++ HOST_RT=True
+ endif
+ else
+- ADAFLAGS=$(COMMON_ADAFLAGS)
++ GNATBIND_FLAGS=-t
++ HOST_RT=True
+ endif
+
+ ALL_ADAFLAGS = \
+@@ -87,7 +89,7 @@ ifeq ($(strip $(filter-out hpux%,$(host_os))),)
+ STAGE1_LIBS=/usr/lib/libcl.a
+ endif
+
+-ifeq ($(STAGE1),True)
++ifeq ($(HOST_RT),True)
+ ADA_INCLUDES=$(COMMON_ADA_INCLUDES)
+ adalib=$(dir $(shell $(CC) -print-libgcc-file-name))adalib
+ GNATLIB=$(adalib)/$(if $(wildcard $(adalib)/libgnat.a),libgnat.a,libgnat.so) $(STAGE1_LIBS)
+@@ -485,6 +487,7 @@ GNAT1_C_OBJS+= \
+ ada/rtinit.o \
+ ada/seh_init.o
+
++ifeq ($(HOST_RT),False)
+ GNAT_ADA_OBJS+= \
+ ada/gcc-interface/system.o \
+ ada/libgnat/a-assert.o \
+@@ -555,6 +558,7 @@ GNAT_ADA_OBJS+= \
+ ada/libgnat/s-wchstw.o \
+ ada/libgnat/s-widuns.o
+ endif
++endif
+
+ # Object files for gnat executables
+ GNAT1_ADA_OBJS = $(GNAT_ADA_OBJS) ada/back_end.o ada/gnat1drv.o
+@@ -656,6 +660,9 @@ GNATBIND_OBJS += \
+ ada/rtfinal.o \
+ ada/rtinit.o \
+ ada/seh_init.o \
++
++ifeq ($(HOST_RT),False)
++GNATBIND_OBJS += \
+ ada/gcc-interface/system.o \
+ ada/libgnat/a-assert.o \
+ ada/libgnat/a-elchha.o \
+@@ -707,6 +714,9 @@ GNATBIND_OBJS += \
+ ada/libgnat/s-wchjis.o \
+ ada/libgnat/s-wchstw.o \
+ ada/libgnat/s-widuns.o \
++
++endif
++GNATBIND_OBJS += \
+ ada/adaint.o \
+ ada/argv.o \
+ ada/cio.o \
+diff --git a/gcc/ada/init.c b/gcc/ada/init.c
+index 5212a38490d3..5ae2efd32ef3 100644
+--- a/gcc/ada/init.c
++++ b/gcc/ada/init.c
+@@ -93,8 +93,12 @@ extern struct Exception_Data storage_error;
+ #ifdef CERT
+ #define Raise_From_Signal_Handler __gnat_raise_exception
+ #else
++#if __GNUC__ < 12
++#define Raise_From_Signal_Handler ada__exceptions__raise_from_signal_handler
++#else
+ #define Raise_From_Signal_Handler __gnat_raise_from_signal_handler
+ #endif
++#endif
+
+ extern void Raise_From_Signal_Handler (struct Exception_Data *, const void *)
+ ATTRIBUTE_NORETURN;
+--
+2.39.0
+