]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-154271: Enable socket ancillary data and forkserver on illumos (GH-154273) main
authorSerhiy Storchaka <storchaka@gmail.com>
Tue, 28 Jul 2026 17:35:26 +0000 (20:35 +0300)
committerGitHub <noreply@github.com>
Tue, 28 Jul 2026 17:35:26 +0000 (20:35 +0300)
illumos declares the socket ancillary-data API (CMSG_*, sendmsg(),
recvmsg()) only under _XOPEN_SOURCE >= 600.  __EXTENSIONS__ keeps the
other platform features.  This enables the forkserver start method.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Misc/NEWS.d/next/Build/2026-07-20-20-30-00.gh-issue-154271.solxopen.rst [new file with mode: 0644]
configure
configure.ac

diff --git a/Misc/NEWS.d/next/Build/2026-07-20-20-30-00.gh-issue-154271.solxopen.rst b/Misc/NEWS.d/next/Build/2026-07-20-20-30-00.gh-issue-154271.solxopen.rst
new file mode 100644 (file)
index 0000000..7f1744b
--- /dev/null
@@ -0,0 +1,4 @@
+Define ``_XOPEN_SOURCE=600`` on Solaris and illumos, so that on illumos the
+socket module is built with :meth:`~socket.socket.sendmsg`,
+:meth:`~socket.socket.recvmsg` and the ``CMSG_*`` helpers.  This also
+enables the ``forkserver`` :mod:`multiprocessing` start method.
index 69d76f7b9f2dba2e2f4ea1b7d0152ea45a5d2b8a..8e7accb4bc793da9747b8cc7fe75d95603d49ba9 100755 (executable)
--- a/configure
+++ b/configure
@@ -4747,11 +4747,8 @@ printf "%s\n" "#define _BSD_SOURCE 1" >>confdefs.h
   # Marc Recht
   NetBSD/1.5 | NetBSD/1.5.* | NetBSD/1.6 | NetBSD/1.6.* | NetBSD/1.6[A-S])
     define_xopen_source=no;;
-  # From the perspective of Solaris, _XOPEN_SOURCE is not so much a
-  # request to enable features supported by the standard as a request
-  # to disable features not supported by the standard.  The best way
-  # for Python to use Solaris is simply to leave _XOPEN_SOURCE out
-  # entirely and define __EXTENSIONS__ instead.
+  # On Solaris, _XOPEN_SOURCE=800 hides platform specific features.
+  # A lower level is defined below.
   SunOS/*)
     define_xopen_source=no;;
   # On UnixWare 7, u_long is never defined with _XOPEN_SOURCE,
@@ -4821,6 +4818,15 @@ printf "%s\n" "#define _POSIX_C_SOURCE 202405L" >>confdefs.h
 
 printf "%s\n" "#define _ISOC23_SOURCE 1" >>confdefs.h
 
+elif test "$ac_sys_system" = "SunOS"
+then
+  # On illumos the socket ancillary-data API (CMSG_*, sendmsg(), recvmsg())
+  # is declared only with _XOPEN_SOURCE >= 600; Solaris declares it anyway.
+  # __EXTENSIONS__ keeps the platform specific features which _XOPEN_SOURCE
+  # would otherwise hide.  See gh-57208.
+
+printf "%s\n" "#define _XOPEN_SOURCE 600" >>confdefs.h
+
 fi
 
 # On HP-UX mbstate_t requires _INCLUDE__STDC_A1_SOURCE
index 93b211eef749880bd870574de0c26120b92b5194..ce146cfa1cbc4cd8b88b52366173daae33be8d95 100644 (file)
@@ -871,11 +871,8 @@ case $ac_sys_system/$ac_sys_release in
   # Marc Recht
   NetBSD/1.5 | NetBSD/1.5.* | NetBSD/1.6 | NetBSD/1.6.* | NetBSD/1.6@<:@A-S@:>@)
     define_xopen_source=no;;
-  # From the perspective of Solaris, _XOPEN_SOURCE is not so much a
-  # request to enable features supported by the standard as a request
-  # to disable features not supported by the standard.  The best way
-  # for Python to use Solaris is simply to leave _XOPEN_SOURCE out
-  # entirely and define __EXTENSIONS__ instead.
+  # On Solaris, _XOPEN_SOURCE=800 hides platform specific features.
+  # A lower level is defined below.
   SunOS/*)
     define_xopen_source=no;;
   # On UnixWare 7, u_long is never defined with _XOPEN_SOURCE,
@@ -941,6 +938,14 @@ then
   # with -std=c11.  Defining _ISOC23_SOURCE makes them visible again.
   AC_DEFINE([_ISOC23_SOURCE], [1],
             [Define to activate ISO C23 library declarations])
+elif test "$ac_sys_system" = "SunOS"
+then
+  # On illumos the socket ancillary-data API (CMSG_*, sendmsg(), recvmsg())
+  # is declared only with _XOPEN_SOURCE >= 600; Solaris declares it anyway.
+  # __EXTENSIONS__ keeps the platform specific features which _XOPEN_SOURCE
+  # would otherwise hide.  See gh-57208.
+  AC_DEFINE([_XOPEN_SOURCE], [600],
+            [Define to the level of X/Open that your system supports])
 fi
 
 # On HP-UX mbstate_t requires _INCLUDE__STDC_A1_SOURCE