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-02-02 22:01:09-07:00
logaad6ef1fc32538063a3d5d03d9c24d2f61797565
tree457cd2a84de942988a413e040bf6512f1b897b4c
parentb54f6186ac9eb3c8ba1ee45a9ee5f0cf8b4e984d

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 @@
220220# define _DEFAULT_SOURCE 1
221221# undef _ATFILE_SOURCE
222222# define _ATFILE_SOURCE 1
223
224# if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 34) || __GLIBC__ > 2
223225# undef _DYNAMIC_STACK_SIZE_SOURCE
224226# define _DYNAMIC_STACK_SIZE_SOURCE 1
227# endif
228
225229#endif
226230
227231/* If nothing (other than _GNU_SOURCE and _DEFAULT_SOURCE) is defined,
......@@ -512,4 +516,4 @@
512516#include <gnu/stubs.h>
513517
514518
515#endif /* features.h */
\ No newline at end of file
519#endif /* features.h */