Skip to content

Commit e869134

Browse files
authored
[3.13] gh-153711: Avoid use of dup3 and pipe2 calls introduced in macOS 27 (#155211)
This prevents potential segfaults when builds are used on older systems and avoids adding new code for supporting weaklinking.
1 parent 093c800 commit e869134

3 files changed

Lines changed: 29 additions & 14 deletions

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
On macOS, do not attempt to use the :manpage:`dup3(2)` and
2+
:manpage:`pipe2(2)` system calls introduced in
3+
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
@@ -5282,7 +5282,13 @@ fi
52825282
# header definition prevents usage - autoconf doesn't use the headers), or
52835283
# raise an error if used at runtime. Force these symbols off.
52845284
if test "$ac_sys_system" != "iOS" ; then
5285-
AC_CHECK_FUNCS([dup3 getentropy getgroups pipe2 system])
5285+
AC_CHECK_FUNCS([getentropy getgroups system])
5286+
fi
5287+
# In addition, macOS introduced dup3 and pipe2 in macOS 27, late in the
5288+
# lifetime of this version of Python. Rather than adding weaklinking
5289+
# support for them, just continue to ignore them.
5290+
if test "$ac_sys_system" != "iOS" -a "$ac_sys_system" != "Darwin"; then
5291+
AC_CHECK_FUNCS([dup3 pipe2])
52865292
fi
52875293

52885294
AC_CHECK_DECL([dirfd],

0 commit comments

Comments
 (0)