authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-01-28 18:31:23-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-06-05 22:43:53-07:00
loga4a88e441f989942400dac8ac9b7f7e1a8f83b22
treea8f9f266ca58fdf091e943430e75249d0d8c6176
parentcbe9923c2220d7e3475c0adfe87a29142fef8e6d

glibc patch: version-gate _DYNAMIC_STACK_SIZE_SOURCE

This is a patch to glibc features.h which makes _DYNAMIC_STACK_SIZE_SOURCE undefined unless the version is >= 2.34. This feature was introduced with glibc 2.34 and without this patch, code built against these headers but then run on an older glibc will end up making a call to sysconf() that returns -1 for the value of SIGSTKSZ and MINSIGSTKSZ.

1 files changed, 5 insertions(+), 0 deletions(-)

lib/libc/include/generic-glibc/features.h+5
...@@ -222,8 +222,13 @@...@@ -222,8 +222,13 @@
222# define _DEFAULT_SOURCE 1222# define _DEFAULT_SOURCE 1
223# undef _ATFILE_SOURCE223# undef _ATFILE_SOURCE
224# define _ATFILE_SOURCE 1224# define _ATFILE_SOURCE 1
225
226/* Zig patch */
227# if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 34) || __GLIBC__ > 2
225# undef _DYNAMIC_STACK_SIZE_SOURCE228# undef _DYNAMIC_STACK_SIZE_SOURCE
226# define _DYNAMIC_STACK_SIZE_SOURCE 1229# define _DYNAMIC_STACK_SIZE_SOURCE 1
230# endif
231
227#endif232#endif
228233
229/* If nothing (other than _GNU_SOURCE and _DEFAULT_SOURCE) is defined,234/* If nothing (other than _GNU_SOURCE and _DEFAULT_SOURCE) is defined,