pipe2 support incorrectly flagged on Darwin for iOS Simulator · Issue #21236 · curl/curl · GitHub
Skip to content You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert pipe2 support incorrectly flagged on Darwin for iOS Simulator #21236 New issue Copy link New issue Copy link Closed Closed pipe2 support incorrectly flagged on Darwin for iOS Simulator #21236 Copy link Labels appleOS specific to an Apple operating system specific to an Apple operating system build Description ecnepsnai opened on Apr 6, 2026 Issue body actions I did this After updating to Xcode 26.4, my script to compile curl for use in iOS fails specifically for the iOS simulator: configure: Configured to build curl/libcurl: Host setup: arm-apple-darwin Install prefix: /Users/ian/Developer/tlskit-external-dependencies/builder/curl-ios/build/curl_arm64-iphonesimulator/artifacts Compiler: /Applications/Xcode.app/Contents/Developer/usr/bin/gcc CFLAGS: -arch arm64 -pipe -Os -gdwarf-2 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator26.4.sdk -miphonesimulator-version-min=12.0 -Qunused-arguments -Werror-implicit-function-declaration -Werror=partial-availability CFLAGS extras: CPPFLAGS: -isystem /Users/ian/Developer/tlskit-external-dependencies/builder/openssl-ios/build/openssl_arm64-iphonesimulator/artifacts/include LDFLAGS: -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator26.4.sdk -L/Users/ian/Developer/tlskit-external-dependencies/builder/openssl-ios/build/openssl_arm64-iphonesimulator/artifacts/lib curl-config: -L/Users/ian/Developer/tlskit-external-dependencies/builder/openssl-ios/build/openssl_arm64-iphonesimulator/artifacts/lib LIBS: -lssl -lcrypto -lssl -lcrypto -lz curl version: 8.19.0 SSL: enabled (OpenSSL) SSH: no (--with-{libssh,libssh2}) zlib: enabled brotli: no (--with-brotli) zstd: no (--with-zstd) GSS-API: no (--with-gssapi) GSASL: no (--with-gsasl) TLS-SRP: no (--enable-tls-srp) resolver: POSIX threaded IPv6: enabled Unix sockets: enabled IDN: no (--with-{libidn2,winidn}) Build docs: no Build libcurl: Shared=no, Static=yes Built-in manual: no (--enable-manual) --libcurl option: enabled (--disable-libcurl-option) Type checking: enabled (--disable-typecheck) Verbose errors: enabled (--disable-verbose) Code coverage: disabled SSPI: no (--enable-sspi) ca native: no ca cert bundle: no ca cert path: no ca cert embed: /Users/ian/Developer/tlskit-external-dependencies/builder/curl-ios/rootca-apple-bundle_20260319.pem ca fallback: no LDAP: no (--enable-ldap / --with-ldap-lib / --with-lber-lib) LDAPS: no (--enable-ldaps) IPFS/IPNS: no (--enable-ipfs) RTSP: no (--enable-rtsp) RTMP: no (--with-librtmp) PSL: no (--with-libpsl) Alt-svc: enabled (--disable-alt-svc) Headers API: enabled (--disable-headers-api) HSTS: enabled (--disable-hsts) HTTP1: enabled (internal) HTTP2: no (--with-nghttp2) HTTP3: no (--with-ngtcp2 --with-nghttp3, --with-quiche) ECH: no (--enable-ech) HTTPS RR: no (--enable-httpsrr) SSLS-EXPORT: no (--enable-ssls-export) Protocols: http https ws wss Features: alt-svc AsynchDNS CAcert HSTS HTTPS-proxy IPv6 Largefile libz SSL threadsafe UnixSockets The error appears to be around an incorrect test result for supporting pipe2 , which appears to be a GNU function that isn't going to be available on Darwin: [...] checking for pipe2... yes [...] socketpair.c:59:6: error: call to undeclared function 'pipe2'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 59 | if(pipe2(socks, flags)) | ^ socketpair.c:59:6: note: did you mean 'pipe'? /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator26.4.sdk/usr/include/unistd.h:482:6: note: 'pipe' declared here 482 | int pipe(int [2]); | ^ 1 error generated.
CC libcurl_la-splay.lo CC libcurl_la-strcase.lo make[2]: *** [libcurl_la-socketpair.lo] Error 1 make[2]: *** Waiting for unfinished jobs.... make[1]: *** [all] Error 2 make: *** [all-recursive] Error 1 This only happens for the iphonesimulator platform, compiling for devices itself works (pipe2 support is correctly flagged as no). See the full log from configure and make: arm64-iphonesimulator_build.log I expected the following Curl to not try and use GNU methods that don't exist on Darwin curl/libcurl version 8.19.0 operating system macOS 26.4 Activity Next bagder commented on Apr 6, 2026 bagder on Apr 6, 2026 Member More actions FTR, pipe2() is posix: https://pubs.opengroup.org/onlinepubs/9799919799/functions/pipe.html Reacted by Ian Spence bagder commented on Apr 6, 2026 bagder on Apr 6, 2026 Member More actions It appears to be a missing #include for the prototype that causes the build to fail. vszakats commented on Apr 6, 2026 vszakats on Apr 6, 2026 Member More actions pipe2 declaration seems to be missing from all Apple SDK headers.
Strange that this symbol is exported or whatever is causing the mis-detection. @ecnepsnai Would you mind attaching config.log ? ecnepsnai commented on Apr 6, 2026 ecnepsnai on Apr 6, 2026 Contributor Author More actions FTR, pipe2() is posix Oh! good to know. I had searched through Apple's docs and the headers and didn't see it so I (incorrectly) jumped to the conclusion that it was GNU. Attached is the config log: config.log Also I checked, if I pass ac_cv_func_pipe2=no to my ./configure then things to build successfully, so that at least unblocks me as a temporary workaround.
Reacted by Viktor Szakats vszakats commented on Apr 6, 2026 vszakats on Apr 6, 2026 Member More actions pipe2 detection in config.log : configure:42707: checking for pipe2 configure:42707: /Applications/Xcode.app/Contents/Developer/usr/bin/gcc -o conftest -arch arm64 -pipe -Os -gdwarf-2 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator26.4.sdk -miphonesimulator-version-min=12.0 -Qunused-arguments -Werror-implicit-function-declaration -Werror=partial-availability -I/Users/ian/Developer/tlskit-external-dependencies/builder/openssl-ios/build/openssl_arm64-iphonesimulator/artifacts/include -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator26.4.sdk -L/Users/.../Developer/tlskit-external-dependencies/builder/openssl-ios/build/openssl_arm64-iphonesimulator/artifacts/lib conftest.c -lssl -lcrypto -lssl -lcrypto -lz >&5 ld: warning: ignoring duplicate libraries: '-lcrypto', '-lssl' configure:42707: $? = 0 configure:42707: result: yes Can't spot anything unexpected.
I wonder where the phantom symbol may be coming from. The check can be fenced off from apple, or replaced by a complex/slow check (not a fan), but it'd be nevertheless interesting to understand what's going on. I can't find signs of this kind of issue on the internet. pipe2 detection was added a year ago with no reports since. One known weak spot of this detection method is that the symbol may be picked up from 3rd-party libs if they for some reason export it.
I had seen this with LibreSSL. vszakats added build appleOS specific to an Apple operating system specific to an Apple operating system on Apr 6, 2026 ecnepsnai commented on Apr 7, 2026 ecnepsnai on Apr 7, 2026 Contributor Author More actions One known weak spot of this detection method is that the symbol may be picked up from 3rd-party libs if they for some reason export it. I had seen this with LibreSSL. Is there a way I could check for this?
I am building OpenSSL and providing that to curl when I build it. vszakats commented on Apr 7, 2026 vszakats on Apr 7, 2026 Member More actions One known weak spot of this detection method is that the symbol may be picked up from 3rd-party libs if they for some reason export it. I had seen this with LibreSSL. Is there a way I could check for this?
The rest of this page is on the live site.