Skip to content

Commit f9c9ae8

Browse files
committed
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 parent 4bfa18b commit f9c9ae8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/libc/include/generic-glibc/features.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,12 @@
222222
# define _DEFAULT_SOURCE 1
223223
# undef _ATFILE_SOURCE
224224
# define _ATFILE_SOURCE 1
225+
226+
# if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 34) || __GLIBC__ > 2
225227
# undef _DYNAMIC_STACK_SIZE_SOURCE
226228
# define _DYNAMIC_STACK_SIZE_SOURCE 1
229+
# endif
230+
227231
#endif
228232

229233
/* If nothing (other than _GNU_SOURCE and _DEFAULT_SOURCE) is defined,

0 commit comments

Comments
 (0)