Skip to content

Commit 0c93d56

Browse files
Fix gcc 5-10 build issues: Ada MINSIGSTKSZ, ubsan pointer comparison (#40)
* Add patches and config for gcc 5-10 compatibility with modern build env - gcc5/config: disable Ada (was never built with Ada on CE; also ada/init.c uses MINSIGSTKSZ in #if which fails on glibc 2.34+) - gcc6/config: disable Ada (same - not in existing S3 tarballs) - gcc5.1-5.4/patches: wide-int.h template<> fix (applied per-minor so it doesn't try to apply to 5.5.0 which already has the fix) - gcc6.1-6.3/patches: ubsan.c pointer-vs-char comparison fix (xloc.file == '\0' should be xloc.file[0] == '\0'; fixed in 6.4.0) - gcc7-10/patches: ada/init.c MINSIGSTKSZ fix for glibc 2.34+ (MINSIGSTKSZ is no longer a compile-time constant; guard the #if with a __GLIBC_PREREQ check; gcc 11 already removed the check) 🤖 Generated by LLM (Claude, via OpenClaw) * Build Ada for gcc 5 and 6 too (add MINSIGSTKSZ patch) Rather than disabling Ada, apply the same ada/init.c MINSIGSTKSZ patch to gcc5 and gcc6. The patch applies cleanly to both (fuzzy match on line offset). This means all rebuilt compilers will include Ada support. 🤖 Generated by LLM (Claude, via OpenClaw) * Use symlinks for wide-int patch in gcc5.2-5.4 (not copies) 🤖 Generated by LLM (Claude, via OpenClaw) * Move patches to top level, use symlinks from version dirs Canonical patch files live at build/patches/*.patch; version-specific dirs contain symlinks, making the intent clear. Consistent with the existing binutils-in-tree.patch pattern. 🤖 Generated by LLM (Claude, via OpenClaw) --------- Co-authored-by: mattgodbolt-molty <mattgodbolt-molty@users.noreply.github.com>
1 parent d990d44 commit 0c93d56

16 files changed

Lines changed: 40 additions & 0 deletions
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
--- a/gcc/ada/init.c 2026-03-10 13:21:47.767280667 -0500
2+
+++ b/gcc/ada/init.c 2026-03-10 13:21:47.792659877 -0500
3+
@@ -572,9 +572,13 @@
4+
#define HAVE_GNAT_ALTERNATE_STACK 1
5+
/* This must be in keeping with System.OS_Interface.Alternate_Stack_Size.
6+
It must be larger than MINSIGSTKSZ and hopefully near 2 * SIGSTKSZ. */
7+
+/* On glibc 2.34+, MINSIGSTKSZ is not a compile-time constant.
8+
+ Skip this check on those systems. */
9+
+#if !defined (__GLIBC__) || !__GLIBC_PREREQ (2, 34)
10+
# if 16 * 1024 < MINSIGSTKSZ
11+
# error "__gnat_alternate_stack too small"
12+
# endif
13+
+#endif
14+
char __gnat_alternate_stack[16 * 1024];
15+
#endif
16+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../ada-minsigstksz.patch
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../wide-int-modern-cxx.patch
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../wide-int-modern-cxx.patch
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../wide-int-modern-cxx.patch
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../wide-int-modern-cxx.patch
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../ada-minsigstksz.patch
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../ubsan-ptr-cmp.patch
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../ubsan-ptr-cmp.patch
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../ubsan-ptr-cmp.patch

0 commit comments

Comments
 (0)