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> 2023-10-13 17:44:27-07:00
logf9c9ae84c6c0773ab8dc710cae3ce9024ca1e91c
treee86b5708cb81a0f6a9817b453924e0de71c7ca3a
parent4bfa18b07f5fe139688cdf07fb0e2b4f73c3f42e

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, 4 insertions(+), 0 deletions(-)

lib/libc/include/generic-glibc/features.h+4
...@@ -222,8 +222,12 @@...@@ -222,8 +222,12 @@
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# if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 34) || __GLIBC__ > 2
225# undef _DYNAMIC_STACK_SIZE_SOURCE227# undef _DYNAMIC_STACK_SIZE_SOURCE
226# define _DYNAMIC_STACK_SIZE_SOURCE 1228# define _DYNAMIC_STACK_SIZE_SOURCE 1
229# endif
230
227#endif231#endif
228232
229/* If nothing (other than _GNU_SOURCE and _DEFAULT_SOURCE) is defined,233/* If nothing (other than _GNU_SOURCE and _DEFAULT_SOURCE) is defined,