Skip to content

pipe2 support incorrectly flagged on Darwin for iOS Simulator #21236

@ecnepsnai

Description

@ecnepsnai

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    appleOSspecific to an Apple operating systembuild

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions