build: avoid pipe2 on Darwin (for now)

macOS 27 will support pipe2 at runtime, and Xcode 27 (and Command Line
Tools) support it at compile time. This means a macOS < 27 system will
detect support for pipe2, but then binaries will crash at runtime, as
pipe2 is not available.

Just avoid pipe2 on macOS for now, and continue using pipe. Note that
the compilation also produces availability warnings, and this will need
to be backported.

Github-Pull: #36218
Rebased-From: 9c7748315d
This commit is contained in:
fanquake
2026-09-10 12:17:58 +01:00
parent 07d502d944
commit 7265ca9bba

View File

@@ -15,7 +15,9 @@ check_include_file_cxx(vm/vm_param.h HAVE_VM_VM_PARAM_H)
check_cxx_symbol_exists(O_CLOEXEC "fcntl.h" HAVE_O_CLOEXEC) check_cxx_symbol_exists(O_CLOEXEC "fcntl.h" HAVE_O_CLOEXEC)
check_cxx_symbol_exists(fdatasync "unistd.h" HAVE_FDATASYNC) check_cxx_symbol_exists(fdatasync "unistd.h" HAVE_FDATASYNC)
check_cxx_symbol_exists(fork "unistd.h" HAVE_DECL_FORK) check_cxx_symbol_exists(fork "unistd.h" HAVE_DECL_FORK)
check_cxx_symbol_exists(pipe2 "unistd.h" HAVE_DECL_PIPE2) if (NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin")
check_cxx_symbol_exists(pipe2 "unistd.h" HAVE_DECL_PIPE2)
endif()
check_cxx_symbol_exists(setsid "unistd.h" HAVE_DECL_SETSID) check_cxx_symbol_exists(setsid "unistd.h" HAVE_DECL_SETSID)
check_include_file_cxx(sys/types.h HAVE_SYS_TYPES_H) check_include_file_cxx(sys/types.h HAVE_SYS_TYPES_H)