Nico Huber has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/76489?usp=email )
Change subject: [WIP]buildgcc: Ignore GCC's GNAT runtime library ......................................................................
[WIP]buildgcc: Ignore GCC's GNAT runtime library
The way we build our GCC cross compilers is not officially supported. Normally one would perform a complete bootstrap when the host's major GCC version differs. Especially building the Ada runtime library is fragile when the bootstrapping procedure is skipped. However, we ship our own runtime library within coreboot anyway.
If we treat the build of cross compilers a little more like a first- stage build of GCC, and link everything against the host's runtime, we can avoid most incompatibilities of the host GCC and the new code base.
Change-Id: I2eb409eccab3376b25849569e44837419c73080f Signed-off-by: Nico Huber nico.h@gmx.de --- M util/crossgcc/patches/gcc-13.1.0_gnat.patch 1 file changed, 195 insertions(+), 187 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/89/76489/1
diff --git a/util/crossgcc/patches/gcc-13.1.0_gnat.patch b/util/crossgcc/patches/gcc-13.1.0_gnat.patch index af5d96f..9c7f3c6 100644 --- a/util/crossgcc/patches/gcc-13.1.0_gnat.patch +++ b/util/crossgcc/patches/gcc-13.1.0_gnat.patch @@ -1,192 +1,200 @@ - - Add -gnatwn to avoid warnings becoming errors: The Ada compiler is very - particular about its warnings and so building newer versions with older - compilers doesn't always work flawlessly. - - Remove the "Ghost" aspect specification. gcc12 and earlier don't - particularly like it in those places and it isn't strictly necessary. ---- gcc-6.1.0/gcc/ada/gcc-interface/Make-lang.in.bak 2015-08-24 16:23:25.004493665 +0200 -+++ gcc-6.1.0/gcc/ada/gcc-interface/Make-lang.in 2015-08-24 17:53:52.496636113 +0200 -@@ -45,7 +45,7 @@ - - +diff -urp gcc-13.1.0.bak/gcc/ada/gcc-interface/Make-lang.in gcc-13.1.0/gcc/ada/gcc-interface/Make-lang.in +--- gcc-13.1.0.bak/gcc/ada/gcc-interface/Make-lang.in 2023-04-26 07:09:39.000000000 +0000 ++++ gcc-13.1.0/gcc/ada/gcc-interface/Make-lang.in 2023-07-15 15:25:10.812724319 +0000 +@@ -43,7 +43,7 @@ RMDIR = rm -rf + + # Extra flags to pass to recursive makes. -COMMON_ADAFLAGS= -gnatpg -+COMMON_ADAFLAGS= -gnatpg -gnatwn ++ADAFLAGS= -gnatpg -gnatwns ifeq ($(TREECHECKING),) CHECKING_ADAFLAGS= else ---- gcc-13.1.0/gcc/ada/libgnat/s-valuti.ads~ 2023-07-15 11:26:17.868734706 +0200 -+++ gcc-13.1.0/gcc/ada/libgnat/s-valuti.ads 2023-07-15 11:26:21.364769836 +0200 -@@ -379,118 +379,118 @@ - -- multiple times as generic formal for a given Uns type. - generic - type Uns is mod <>; -- type P_Uns_Option is private with Ghost; -+ type P_Uns_Option is private ; - with function P_Wrap_Option (Value : Uns) return P_Uns_Option -- with Ghost; -+ ; - with function P_Hexa_To_Unsigned_Ghost (X : Character) return Uns -- with Ghost; -+ ; - with function P_Scan_Overflows_Ghost - (Digit : Uns; - Base : Uns; - Acc : Uns) return Boolean -- with Ghost; -+ ; - with function P_Is_Raw_Unsigned_Format_Ghost - (Str : String) return Boolean -- with Ghost; -+ ; - with function P_Scan_Split_No_Overflow_Ghost - (Str : String; - From, To : Integer) - return Boolean -- with Ghost; -+ ; - with function P_Raw_Unsigned_No_Overflow_Ghost - (Str : String; - From, To : Integer) - return Boolean -- with Ghost; -+ ; - - with function P_Exponent_Unsigned_Ghost - (Value : Uns; - Exp : Natural; - Base : Uns := 10) return P_Uns_Option -- with Ghost; -+ ; - with procedure P_Lemma_Exponent_Unsigned_Ghost_Base - (Value : Uns; - Exp : Natural; - Base : Uns := 10) -- with Ghost; -+ ; - with procedure P_Lemma_Exponent_Unsigned_Ghost_Overflow - (Value : Uns; - Exp : Natural; - Base : Uns := 10) -- with Ghost; -+ ; - with procedure P_Lemma_Exponent_Unsigned_Ghost_Step - (Value : Uns; - Exp : Natural; - Base : Uns := 10) -- with Ghost; -+ ; - - with function P_Scan_Raw_Unsigned_Ghost - (Str : String; - From, To : Integer) - return Uns -- with Ghost; -+ ; - with procedure P_Lemma_Scan_Based_Number_Ghost_Base - (Str : String; - From, To : Integer; - Base : Uns := 10; - Acc : Uns := 0) -- with Ghost; -+ ; - with procedure P_Lemma_Scan_Based_Number_Ghost_Underscore - (Str : String; - From, To : Integer; - Base : Uns := 10; - Acc : Uns := 0) -- with Ghost; -+ ; - with procedure P_Lemma_Scan_Based_Number_Ghost_Overflow - (Str : String; - From, To : Integer; - Base : Uns := 10; - Acc : Uns := 0) -- with Ghost; -+ ; - with procedure P_Lemma_Scan_Based_Number_Ghost_Step - (Str : String; - From, To : Integer; - Base : Uns := 10; - Acc : Uns := 0) -- with Ghost; -+ ; - - with function P_Raw_Unsigned_Last_Ghost - (Str : String; - From, To : Integer) - return Positive -- with Ghost; -+ ; - with function P_Only_Decimal_Ghost - (Str : String; - From, To : Integer) - return Boolean -- with Ghost; -+ ; - with function P_Scan_Based_Number_Ghost - (Str : String; - From, To : Integer; - Base : Uns := 10; - Acc : Uns := 0) - return P_Uns_Option -- with Ghost; -+ ; - with function P_Is_Unsigned_Ghost (Str : String) return Boolean -- with Ghost; -+ ; - with function P_Is_Value_Unsigned_Ghost - (Str : String; - Val : Uns) return Boolean -- with Ghost; -+ ; - - with procedure P_Prove_Scan_Only_Decimal_Ghost - (Str : String; - Val : Uns) -- with Ghost; -+ ; - with procedure P_Prove_Scan_Based_Number_Ghost_Eq - (Str1, Str2 : String; - From, To : Integer; - Base : Uns := 10; - Acc : Uns := 0) -- with Ghost; -+ ; - - package Uns_Params is -- subtype Uns_Option is P_Uns_Option with Ghost; -+ subtype Uns_Option is P_Uns_Option ; - function Wrap_Option (Value : Uns) return Uns_Option renames - P_Wrap_Option; - function Hexa_To_Unsigned_Ghost -@@ -605,24 +605,24 @@ - - with package P_Uns_Params is new System.Val_Util.Uns_Params - (Uns => Uns, others => <>) -- with Ghost; -+ ; - - with function P_Abs_Uns_Of_Int (Val : Int) return Uns -- with Ghost; -+ ; - with function P_Is_Int_Of_Uns - (Minus : Boolean; - Uval : Uns; - Val : Int) - return Boolean -- with Ghost; -+ ; - with function P_Is_Integer_Ghost (Str : String) return Boolean -- with Ghost; -+ ; - with function P_Is_Value_Integer_Ghost - (Str : String; - Val : Int) return Boolean -- with Ghost; -+ ; - with procedure P_Prove_Scan_Only_Decimal_Ghost (Str : String; Val : Int) -- with Ghost; -+ ; - - package Int_Params is - package Uns_Params renames P_Uns_Params; +@@ -57,18 +57,13 @@ WARN_ADAFLAGS= -W -Wall + # checks fully active. + + STAGE1=False +-GNATBIND_FLAGS= ++GNATBIND_FLAGS=-t + GNATLIB= + + ifeq ($(CROSS),) +- ADAFLAGS=$(COMMON_ADAFLAGS) -gnatwns +- + ifeq ($(if $(wildcard ../stage_current),$(shell cat ../stage_current),stage1),stage1) + STAGE1=True +- GNATBIND_FLAGS=-t + endif +-else +- ADAFLAGS=$(COMMON_ADAFLAGS) + endif + + ALL_ADAFLAGS = \ +@@ -87,13 +82,9 @@ ifeq ($(strip $(filter-out hpux%,$(host_ + STAGE1_LIBS=/usr/lib/libcl.a + endif + +-ifeq ($(STAGE1),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) +-else +- ADA_INCLUDES=-nostdinc $(COMMON_ADA_INCLUDES) -Iada/libgnat -I$(srcdir)/ada/libgnat -Iada/gcc-interface -I$(srcdir)/ada/gcc-interface +-endif ++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) + + GNATLIBFLAGS= -W -Wall -gnatpg -nostdinc + GNATLIBCFLAGS= -g -O2 $(TCFLAGS) +@@ -484,76 +475,6 @@ GNAT1_C_OBJS+= \ + ada/rtfinal.o \ + ada/rtinit.o \ + ada/seh_init.o +- +-GNAT_ADA_OBJS+= \ +- ada/gcc-interface/system.o \ +- ada/libgnat/a-assert.o \ +- ada/libgnat/a-charac.o \ +- ada/libgnat/a-chlat1.o \ +- ada/libgnat/a-elchha.o \ +- ada/libgnat/a-except.o \ +- ada/libgnat/a-exctra.o \ +- ada/libgnat/a-ioexce.o \ +- ada/libgnat/a-nubinu.o \ +- ada/libgnat/a-numeri.o \ +- ada/libgnat/ada.o \ +- ada/libgnat/g-byorma.o \ +- ada/libgnat/g-heasor.o \ +- ada/libgnat/g-htable.o \ +- ada/libgnat/g-spchge.o \ +- ada/libgnat/g-speche.o \ +- ada/libgnat/g-table.o \ +- ada/libgnat/g-u3spch.o \ +- ada/libgnat/interfac.o \ +- ada/libgnat/s-addope.o \ +- ada/libgnat/s-addima.o \ +- ada/libgnat/s-assert.o \ +- ada/libgnat/s-bitops.o \ +- ada/libgnat/s-carun8.o \ +- ada/libgnat/s-casuti.o \ +- ada/libgnat/s-crtl.o \ +- ada/libgnat/s-conca2.o \ +- ada/libgnat/s-conca3.o \ +- ada/libgnat/s-conca4.o \ +- ada/libgnat/s-conca5.o \ +- ada/libgnat/s-conca6.o \ +- ada/libgnat/s-conca7.o \ +- ada/libgnat/s-conca8.o \ +- ada/libgnat/s-conca9.o \ +- ada/libgnat/s-crc32.o \ +- ada/libgnat/s-excdeb.o \ +- ada/libgnat/s-except.o \ +- ada/libgnat/s-excmac.o \ +- ada/libgnat/s-exctab.o \ +- ada/libgnat/s-htable.o \ +- ada/libgnat/s-imgint.o \ +- ada/libgnat/s-mastop.o \ +- ada/libgnat/s-memory.o \ +- ada/libgnat/s-os_lib.o \ +- ada/libgnat/s-parame.o \ +- ada/libgnat/s-purexc.o \ +- ada/libgnat/s-restri.o \ +- ada/libgnat/s-secsta.o \ +- ada/libgnat/s-soflin.o \ +- ada/libgnat/s-soliin.o \ +- ada/libgnat/s-stache.o \ +- ada/libgnat/s-stalib.o \ +- ada/libgnat/s-stoele.o \ +- ada/libgnat/s-strcom.o \ +- ada/libgnat/s-strhas.o \ +- ada/libgnat/s-string.o \ +- ada/libgnat/s-traceb.o \ +- ada/libgnat/s-traent.o \ +- ada/libgnat/s-trasym.o \ +- ada/libgnat/s-unstyp.o \ +- ada/libgnat/s-valint.o \ +- ada/libgnat/s-valuns.o \ +- ada/libgnat/s-valuti.o \ +- ada/libgnat/s-wchcnv.o \ +- ada/libgnat/s-wchcon.o \ +- ada/libgnat/s-wchjis.o \ +- ada/libgnat/s-wchstw.o \ +- ada/libgnat/s-widuns.o + endif + + # Object files for gnat executables +@@ -656,57 +577,6 @@ GNATBIND_OBJS += \ + ada/rtfinal.o \ + ada/rtinit.o \ + ada/seh_init.o \ +- ada/gcc-interface/system.o \ +- ada/libgnat/a-assert.o \ +- ada/libgnat/a-elchha.o \ +- ada/libgnat/a-except.o \ +- ada/libgnat/a-nubinu.o \ +- ada/libgnat/a-numeri.o \ +- ada/libgnat/ada.o \ +- ada/libgnat/g-byorma.o \ +- ada/libgnat/g-hesora.o \ +- ada/libgnat/g-htable.o \ +- ada/libgnat/interfac.o \ +- ada/libgnat/s-addope.o \ +- ada/libgnat/s-assert.o \ +- ada/libgnat/s-carun8.o \ +- ada/libgnat/s-casuti.o \ +- ada/libgnat/s-conca2.o \ +- ada/libgnat/s-conca3.o \ +- ada/libgnat/s-conca4.o \ +- ada/libgnat/s-conca5.o \ +- ada/libgnat/s-conca6.o \ +- ada/libgnat/s-conca7.o \ +- ada/libgnat/s-conca8.o \ +- ada/libgnat/s-conca9.o \ +- ada/libgnat/s-crc32.o \ +- ada/libgnat/s-excdeb.o \ +- ada/libgnat/s-except.o \ +- ada/libgnat/s-excmac.o \ +- ada/libgnat/s-exctab.o \ +- ada/libgnat/s-htable.o \ +- ada/libgnat/s-imgint.o \ +- ada/libgnat/s-mastop.o \ +- ada/libgnat/s-memory.o \ +- ada/libgnat/s-os_lib.o \ +- ada/libgnat/s-parame.o \ +- ada/libgnat/s-restri.o \ +- ada/libgnat/s-secsta.o \ +- ada/libgnat/s-soflin.o \ +- ada/libgnat/s-soliin.o \ +- ada/libgnat/s-stache.o \ +- ada/libgnat/s-stalib.o \ +- ada/libgnat/s-stoele.o \ +- ada/libgnat/s-strhas.o \ +- ada/libgnat/s-string.o \ +- ada/libgnat/s-traent.o \ +- ada/libgnat/s-traceb.o \ +- ada/libgnat/s-unstyp.o \ +- ada/libgnat/s-wchcnv.o \ +- ada/libgnat/s-wchcon.o \ +- ada/libgnat/s-wchjis.o \ +- ada/libgnat/s-wchstw.o \ +- ada/libgnat/s-widuns.o \ + ada/adaint.o \ + ada/argv.o \ + ada/cio.o \ +diff -urp gcc-13.1.0.bak/gcc/ada/init.c gcc-13.1.0/gcc/ada/init.c +--- gcc-13.1.0.bak/gcc/ada/init.c 2023-04-26 07:09:39.000000000 +0000 ++++ gcc-13.1.0/gcc/ada/init.c 2023-07-15 15:26:00.319639756 +0000 +@@ -93,8 +93,12 @@ extern struct Exception_Data storage_err + #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;