gnuboot-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v2] ressources/coreboot/fam15h*: fix building crossgcc 8.3.0 (fix


From: Adrien 'neox' Bourmault
Subject: [PATCH v2] ressources/coreboot/fam15h*: fix building crossgcc 8.3.0 (fixes #64870)
Date: Mon, 9 Sep 2024 15:59:30 +0200

From: Adrien Bourmault <neox@gnu.org>

This commit fixes an error encountered on Trisquel 11 while trying to
build the fam15h coreboot crossgcc 8.3.0:

In file included from /usr/include/signal.h:328,
                 from /usr/include/x86_64-linux-gnu/sys/param.h:28,
                 from ../../gcc-8.3.0/gcc/system.h:298,
                 from ../../gcc-8.3.0/gcc/ada/init.c:65:
../../gcc-8.3.0/gcc/ada/init.c:575:18: error: missing binary operator before 
token "("
  575 | # if 16 * 1024 < MINSIGSTKSZ
      |                  ^~~~~~~~~~~
make[1]: *** [Makefile:1110 : ada/init.o] Erreur 1

The changes of the GLIBC that removed the MINSKTSZ constant was
introduced only for systems using the Linux kernel, and while the
changelog is recommanding using sysconf to get the value of
`_SC_MINSTKSZ`. The problem is that it does not allow to get the value
in the preprocessor context.

This error has been corrected on upstream GCC by Eric Botcazou 
<ebotcazou@adacore.com>
but this was not applied on upstream coreboot (even 4.11 branch).
It has been accepted by GCC and the bug report has been set as RESOLVED
FIXED, meaning it solved the bug.

This patch is needed for all GCC versions from 8 to 9, since this
commit solved the bug for 9, 10 and later versions. It has been adopted
by OpenSUSE for its GCC 8 package:
https://build.opensuse.org/projects/devel:gcc/packages/gcc8/files/gcc8-ada-MINSTKSZ.patch


Here's the corresponding patch header (in debian's format: 
https://dep-team.pages.debian.net/deps/dep3/):

Origin: upstream, 
https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=a5a7cdcaa0c29ee547c41d24f495e9694a6fe7f1
Bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99264
Bug-GNU Boot: https://savannah.gnu.org/bugs/?64870
Signed-off-by: Adrien 'neox' Bourmault <neox@gnu.org>
Acked-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
---
 .../patches/0012-gcc-8.3.0_ada-MINSTKSZ.patch | 70 +++++++++++++++++++
 .../patches/0012-gcc-8.3.0_ada-MINSTKSZ.patch | 70 +++++++++++++++++++
 2 files changed, 140 insertions(+)
 create mode 100644 
resources/coreboot/fam15h_rdimm/patches/0012-gcc-8.3.0_ada-MINSTKSZ.patch
 create mode 100644 
resources/coreboot/fam15h_udimm/patches/0012-gcc-8.3.0_ada-MINSTKSZ.patch

diff --git 
a/resources/coreboot/fam15h_rdimm/patches/0012-gcc-8.3.0_ada-MINSTKSZ.patch 
b/resources/coreboot/fam15h_rdimm/patches/0012-gcc-8.3.0_ada-MINSTKSZ.patch
new file mode 100644
index 0000000..44060ef
--- /dev/null
+++ b/resources/coreboot/fam15h_rdimm/patches/0012-gcc-8.3.0_ada-MINSTKSZ.patch
@@ -0,0 +1,70 @@
+From 3a1ff2c972975b16812a96b800d34073edf9302d Mon Sep 17 00:00:00 2001
+From: Eric Botcazou <ebotcazou@adacore.com>
+Date: Fri, 5 Mar 2021 12:45:41 +0100
+Subject: [PATCH] Fix build breakage with latest glibc release
+To: gcc-patches@gcc.gnu.org
+
+Signed-off-by: Adrien Bourmault <neox@gnu.org>
+---
+ .../patches/gcc-8.3.0_ada-MINSTKSZ.patch      | 50 +++++++++++++++++++
+ 1 file changed, 50 insertions(+)
+ create mode 100644 util/crossgcc/patches/gcc-8.3.0_ada-MINSTKSZ.patch
+
+diff --git a/util/crossgcc/patches/gcc-8.3.0_ada-MINSTKSZ.patch 
b/util/crossgcc/patches/gcc-8.3.0_ada-MINSTKSZ.patch
+new file mode 100644
+index 0000000000..25e0d83b1a
+--- /dev/null
++++ b/util/crossgcc/patches/gcc-8.3.0_ada-MINSTKSZ.patch
+@@ -0,0 +1,50 @@
++From a5a7cdcaa0c29ee547c41d24f495e9694a6fe7f1 Mon Sep 17 00:00:00 2001
++From: Eric Botcazou <ebotcazou@adacore.com>
++Date: Fri, 5 Mar 2021 12:45:41 +0100
++Subject: [PATCH] Fix build breakage with latest glibc release
++To: gcc-patches@gcc.gnu.org
++
++gcc/ada/
++      PR ada/99264
++      * init.c (__gnat_alternate_sta) [Linux]: Remove preprocessor test on
++      MINSIGSTKSZ and bump size to 32KB.
++      * libgnarl/s-osinte__linux.ads (Alternate_Stack_Size): Bump to 32KB.
++---
++ gcc/ada/init.c                       | 8 ++------
++ gcc/ada/libgnarl/s-osinte__linux.ads | 2 +-
++ 2 files changed, 3 insertions(+), 7 deletions(-)
++
++diff --git a/gcc/ada/init.c b/gcc/ada/init.c
++index 00f32e5e02a..050800ffbf8 100644
++--- a/gcc/ada/init.c
+++++ b/gcc/ada/init.c
++@@ -570,12 +570,8 @@ __gnat_error_handler (int sig, siginfo_t *si 
ATTRIBUTE_UNUSED, void *ucontext)
++
++ #ifndef __ia64__
++ #define HAVE_GNAT_ALTERNATE_STACK 1
++-/* This must be in keeping with System.OS_Interface.Alternate_Stack_Size.
++-   It must be larger than MINSIGSTKSZ and hopefully near 2 * SIGSTKSZ.  */
++-# if 16 * 1024 < MINSIGSTKSZ
++-#  error "__gnat_alternate_stack too small"
++-# endif
++-char __gnat_alternate_stack[16 * 1024];
+++/* This must be in keeping with System.OS_Interface.Alternate_Stack_Size.  */
+++char __gnat_alternate_stack[32 * 1024];
++ #endif
++
++ #ifdef __XENO__
++diff --git a/gcc/ada/libgnarl/s-osinte__linux.ads 
b/gcc/ada/libgnarl/s-osinte__linux.ads
++index ba3b82423ad..9d5cd05257a 100644
++--- a/gcc/ada/libgnarl/s-osinte__linux.ads
+++++ b/gcc/ada/libgnarl/s-osinte__linux.ads
++@@ -329,7 +329,7 @@ package System.OS_Interface is
++    pragma Import (C, Alternate_Stack, "__gnat_alternate_stack");
++    --  The alternate signal stack for stack overflows
++
++-   Alternate_Stack_Size : constant := 16 * 1024;
+++   Alternate_Stack_Size : constant := 32 * 1024;
++    --  This must be in keeping with init.c:__gnat_alternate_stack
++
++    function Get_Stack_Base (thread : pthread_t) return Address;
++-- 
++2.34.1
+-- 
+2.45.2
diff --git 
a/resources/coreboot/fam15h_udimm/patches/0012-gcc-8.3.0_ada-MINSTKSZ.patch 
b/resources/coreboot/fam15h_udimm/patches/0012-gcc-8.3.0_ada-MINSTKSZ.patch
new file mode 100644
index 0000000..44060ef
--- /dev/null
+++ b/resources/coreboot/fam15h_udimm/patches/0012-gcc-8.3.0_ada-MINSTKSZ.patch
@@ -0,0 +1,70 @@
+From 3a1ff2c972975b16812a96b800d34073edf9302d Mon Sep 17 00:00:00 2001
+From: Eric Botcazou <ebotcazou@adacore.com>
+Date: Fri, 5 Mar 2021 12:45:41 +0100
+Subject: [PATCH] Fix build breakage with latest glibc release
+To: gcc-patches@gcc.gnu.org
+
+Signed-off-by: Adrien Bourmault <neox@gnu.org>
+---
+ .../patches/gcc-8.3.0_ada-MINSTKSZ.patch      | 50 +++++++++++++++++++
+ 1 file changed, 50 insertions(+)
+ create mode 100644 util/crossgcc/patches/gcc-8.3.0_ada-MINSTKSZ.patch
+
+diff --git a/util/crossgcc/patches/gcc-8.3.0_ada-MINSTKSZ.patch 
b/util/crossgcc/patches/gcc-8.3.0_ada-MINSTKSZ.patch
+new file mode 100644
+index 0000000000..25e0d83b1a
+--- /dev/null
++++ b/util/crossgcc/patches/gcc-8.3.0_ada-MINSTKSZ.patch
+@@ -0,0 +1,50 @@
++From a5a7cdcaa0c29ee547c41d24f495e9694a6fe7f1 Mon Sep 17 00:00:00 2001
++From: Eric Botcazou <ebotcazou@adacore.com>
++Date: Fri, 5 Mar 2021 12:45:41 +0100
++Subject: [PATCH] Fix build breakage with latest glibc release
++To: gcc-patches@gcc.gnu.org
++
++gcc/ada/
++      PR ada/99264
++      * init.c (__gnat_alternate_sta) [Linux]: Remove preprocessor test on
++      MINSIGSTKSZ and bump size to 32KB.
++      * libgnarl/s-osinte__linux.ads (Alternate_Stack_Size): Bump to 32KB.
++---
++ gcc/ada/init.c                       | 8 ++------
++ gcc/ada/libgnarl/s-osinte__linux.ads | 2 +-
++ 2 files changed, 3 insertions(+), 7 deletions(-)
++
++diff --git a/gcc/ada/init.c b/gcc/ada/init.c
++index 00f32e5e02a..050800ffbf8 100644
++--- a/gcc/ada/init.c
+++++ b/gcc/ada/init.c
++@@ -570,12 +570,8 @@ __gnat_error_handler (int sig, siginfo_t *si 
ATTRIBUTE_UNUSED, void *ucontext)
++
++ #ifndef __ia64__
++ #define HAVE_GNAT_ALTERNATE_STACK 1
++-/* This must be in keeping with System.OS_Interface.Alternate_Stack_Size.
++-   It must be larger than MINSIGSTKSZ and hopefully near 2 * SIGSTKSZ.  */
++-# if 16 * 1024 < MINSIGSTKSZ
++-#  error "__gnat_alternate_stack too small"
++-# endif
++-char __gnat_alternate_stack[16 * 1024];
+++/* This must be in keeping with System.OS_Interface.Alternate_Stack_Size.  */
+++char __gnat_alternate_stack[32 * 1024];
++ #endif
++
++ #ifdef __XENO__
++diff --git a/gcc/ada/libgnarl/s-osinte__linux.ads 
b/gcc/ada/libgnarl/s-osinte__linux.ads
++index ba3b82423ad..9d5cd05257a 100644
++--- a/gcc/ada/libgnarl/s-osinte__linux.ads
+++++ b/gcc/ada/libgnarl/s-osinte__linux.ads
++@@ -329,7 +329,7 @@ package System.OS_Interface is
++    pragma Import (C, Alternate_Stack, "__gnat_alternate_stack");
++    --  The alternate signal stack for stack overflows
++
++-   Alternate_Stack_Size : constant := 16 * 1024;
+++   Alternate_Stack_Size : constant := 32 * 1024;
++    --  This must be in keeping with init.c:__gnat_alternate_stack
++
++    function Get_Stack_Base (thread : pthread_t) return Address;
++-- 
++2.34.1
+--
+2.45.2
--
2.46.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]