1 From b1b16478729aea709e7ef81224995b6d26b38a87 Mon Sep 17 00:00:00 2001
2 From: Nico Huber <nico.h@gmx.de>
3 Date: Sun, 16 Jul 2023 00:30:03 +0200
4 Subject: [PATCH] GNAT: Build cross compilers with host runtime
6 When building with an older host toolchain, the shipped libgnat
7 sources may not be compatible. So rely on the host runtime just
8 like we do for a stage1 build.
10 Signed-off-by: Nico Huber <nico.h@gmx.de>
12 gcc/ada/gcc-interface/Make-lang.in | 16 +++++++++++++---
13 gcc/ada/init.c | 4 ++++
14 2 files changed, 17 insertions(+), 3 deletions(-)
16 diff --git a/gcc/ada/gcc-interface/Make-lang.in b/gcc/ada/gcc-interface/Make-lang.in
17 index 9507f2f09203..cf7ec4cc1662 100644
18 --- a/gcc/ada/gcc-interface/Make-lang.in
19 +++ b/gcc/ada/gcc-interface/Make-lang.in
20 @@ -57,18 +57,21 @@ WARN_ADAFLAGS= -W -Wall
21 # checks fully active.
28 +ADAFLAGS=$(COMMON_ADAFLAGS) -gnatwns
30 - ADAFLAGS=$(COMMON_ADAFLAGS) -gnatwns
32 ifeq ($(if $(wildcard ../stage_current),$(shell cat ../stage_current),stage1),stage1)
38 - ADAFLAGS=$(COMMON_ADAFLAGS)
44 @@ -87,7 +89,7 @@ ifeq ($(strip $(filter-out hpux%,$(host_os))),)
45 STAGE1_LIBS=/usr/lib/libcl.a
48 -ifeq ($(STAGE1),True)
49 +ifeq ($(HOST_RT),True)
50 ADA_INCLUDES=$(COMMON_ADA_INCLUDES)
51 adalib=$(dir $(shell $(CC) -print-libgcc-file-name))adalib
52 GNATLIB=$(adalib)/$(if $(wildcard $(adalib)/libgnat.a),libgnat.a,libgnat.so) $(STAGE1_LIBS)
53 @@ -485,6 +487,7 @@ GNAT1_C_OBJS+= \
57 +ifeq ($(HOST_RT),False)
59 ada/gcc-interface/system.o \
60 ada/libgnat/a-assert.o \
61 @@ -555,6 +558,7 @@ GNAT_ADA_OBJS+= \
62 ada/libgnat/s-wchstw.o \
63 ada/libgnat/s-widuns.o
67 # Object files for gnat executables
68 GNAT1_ADA_OBJS = $(GNAT_ADA_OBJS) ada/back_end.o ada/gnat1drv.o
69 @@ -656,6 +660,9 @@ GNATBIND_OBJS += \
74 +ifeq ($(HOST_RT),False)
76 ada/gcc-interface/system.o \
77 ada/libgnat/a-assert.o \
78 ada/libgnat/a-elchha.o \
79 @@ -707,6 +714,9 @@ GNATBIND_OBJS += \
80 ada/libgnat/s-wchjis.o \
81 ada/libgnat/s-wchstw.o \
82 ada/libgnat/s-widuns.o \
89 diff --git a/gcc/ada/init.c b/gcc/ada/init.c
90 index 5212a38490d3..5ae2efd32ef3 100644
93 @@ -93,8 +93,12 @@ extern struct Exception_Data storage_error;
95 #define Raise_From_Signal_Handler __gnat_raise_exception
98 +#define Raise_From_Signal_Handler ada__exceptions__raise_from_signal_handler
100 #define Raise_From_Signal_Handler __gnat_raise_from_signal_handler
104 extern void Raise_From_Signal_Handler (struct Exception_Data *, const void *)