Skip to content

Commit 8978ca1

Browse files
committed
gh-153711: Avoid use of dup3 and pipe2 calls introduced in macOS 27
This prevents potential segfaults when builds are used on older systems and avoids adding new code for supporting weaklinking.
1 parent 709041c commit 8978ca1

3 files changed

Lines changed: 28 additions & 14 deletions

File tree

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Do not attempt to use the `dup3` and `pipe2` system calls introduced in
2+
macOS 27 to prevent problems when running on older systems.

configure

Lines changed: 19 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5361,7 +5361,13 @@ fi
53615361
# header definition prevents usage - autoconf doesn't use the headers), or
53625362
# raise an error if used at runtime. Force these symbols off.
53635363
if test "$ac_sys_system" != "iOS" ; then
5364-
AC_CHECK_FUNCS([dup3 getentropy getgroups pipe2 system])
5364+
AC_CHECK_FUNCS([getentropy getgroups system])
5365+
fi
5366+
# In addition, macOS introduced dup3 and pipe2 in macOS 27, late in the
5367+
# lifetime of this version of Python. Rather than adding weaklinking
5368+
# support for them, just continue to ignore them.
5369+
if test "$ac_sys_system" != "iOS" -a "$ac_sys_system" != "Darwin"; then
5370+
AC_CHECK_FUNCS([dup3 pipe2])
53655371
fi
53665372

53675373
AC_CHECK_DECL([dirfd],

0 commit comments

Comments
 (0)