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:
[415/1121] Building CXX object src/util/CMakeFiles/bitcoin_util.dir/tokenpipe.cpp.o
../src/util/tokenpipe.cpp:89:9: warning: 'pipe2' is only available on macOS 27.0 or newer [-Wunguarded-availability-new]
89 | if (pipe2(fds, O_CLOEXEC) != 0) {
| ^~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/unistd.h:219:9: note: 'pipe2' has been marked as being introduced in macOS 27.0 here, but the deployment target is macOS 26.0.0
219 | int pipe2(int [2], int);
| ^
../src/util/tokenpipe.cpp:89:9: note: enclose 'pipe2' in a __builtin_available check to silence this warning
89 | if (pipe2(fds, O_CLOEXEC) != 0) {
| ^~~~~
90 | return std::nullopt;
91 | }
and this will need to be backported. When macOS 27 is released, we could change approach, but wanted to PR something straightforward (and backportable) for 32.x.