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> 2022-01-28 18:36:23-07:00
log39083c31a550ed80f369f60d35791e98904b8096
treeb2d4f0b9b5f2d99053ea0ab5320368d96f243685
parentcd5b25c5ae258e7b172d8af6979c060d2a823035

glibc: 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. Closes #10713

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

lib/libc/include/generic-glibc/features.h+5-1
...@@ -220,8 +220,12 @@...@@ -220,8 +220,12 @@
220# define _DEFAULT_SOURCE 1220# define _DEFAULT_SOURCE 1
221# undef _ATFILE_SOURCE221# undef _ATFILE_SOURCE
222# define _ATFILE_SOURCE 1222# define _ATFILE_SOURCE 1
223
224# if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 34) || __GLIBC__ > 2
223# undef _DYNAMIC_STACK_SIZE_SOURCE225# undef _DYNAMIC_STACK_SIZE_SOURCE
224# define _DYNAMIC_STACK_SIZE_SOURCE 1226# define _DYNAMIC_STACK_SIZE_SOURCE 1
227# endif
228
225#endif229#endif
226230
227/* If nothing (other than _GNU_SOURCE and _DEFAULT_SOURCE) is defined,231/* If nothing (other than _GNU_SOURCE and _DEFAULT_SOURCE) is defined,
...@@ -512,4 +516,4 @@...@@ -512,4 +516,4 @@
512#include <gnu/stubs.h>516#include <gnu/stubs.h>
513517
514518
515#endif /* features.h */
\ No newline at end of file
519#endif /* features.h */