Skip to content

pipe2 support incorrectly flagged on Darwin for iOS Simulator #21236

Closed

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

Activity

  1. bagder commented on Apr 6, 2026

    @bagder
    Member
  2. bagder commented on Apr 6, 2026

    @bagder
    Member

    It appears to be a missing #include for the prototype that causes the build to fail.

  3. vszakats commented on Apr 6, 2026

    @vszakats
    Member

    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?

  4. ecnepsnai commented on Apr 6, 2026

    @ecnepsnai
    ContributorAuthor

    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.

  5. vszakats commented on Apr 6, 2026

    @vszakats
    Member

    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.

  6. ecnepsnai commented on Apr 7, 2026

    @ecnepsnai
    ContributorAuthor

    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.

  7. vszakats commented on Apr 7, 2026

    @vszakats
    Member

    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.

    #!/bin/sh
    
    cat > conftest.c <<EOF
    /* end confdefs.h.  */
    
    #define pipe2 innocuous_pipe2
    #ifdef __STDC__
    #  include <limits.h>
    #else
    #  include <assert.h>
    #endif
    #undef pipe2
    #ifdef __cplusplus
    extern "C"
    #endif
    char pipe2 ();
    #if defined __stub_pipe2 || defined __stub___pipe2
    #error force compilation error
    #endif
    
    int main(void)
    {
    return pipe2 ();
      return 0;
    }
    EOF
    
    /Applications/Xcode.app/Contents/Developer/usr/bin/gcc -v -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/ian/Developer/tlskit-external-dependencies/builder/openssl-ios/build/openssl_arm64-iphonesimulator/artifacts/lib \
      conftest.c -lssl -lcrypto -lssl -lcrypto -lz \
      -Wl,-map,conftest.map

    conftest.map may hopefully give some clues.

  8. ecnepsnai commented on Apr 7, 2026

    @ecnepsnai
    ContributorAuthor

    That ran without error (exit 0)

    Apple clang version 21.0.0 (clang-2100.0.123.102)
    Target: arm64-apple-darwin25.4.0
    Thread model: posix
    InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
     "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple arm64-apple-ios12.0.0-simulator -Os -Wundef-prefix=TARGET_OS_ -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -Werror=implicit-function-declaration -emit-obj -dumpdir conftest- -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name conftest.c -mrelocation-model pic -pic-level 2 -mframe-pointer=non-leaf -fno-strict-return -ffp-contract=on -fno-rounding-math -funwind-tables=1 -fobjc-msgsend-selector-stubs -fno-sized-deallocation -target-sdk-version=26.4 -fvisibility-inlines-hidden-static-local-var -fno-modulemap-allow-subdirectory-search -fdefine-target-os-macros -fno-assume-unique-vtables -fno-modulemap-allow-subdirectory-search -enable-tlsdesc -target-cpu apple-m1 -target-feature +v8.5a -target-feature +aes -target-feature +altnzcv -target-feature +ccdp -target-feature +ccpp -target-feature +complxnum -target-feature +crc -target-feature +dotprod -target-feature +flagm -target-feature +fp-armv8 -target-feature +fp16fml -target-feature +fptoint -target-feature +fullfp16 -target-feature +jsconv -target-feature +lse -target-feature +neon -target-feature +pauth -target-feature +perfmon -target-feature +predres -target-feature +ras -target-feature +rcpc -target-feature +rdm -target-feature +sb -target-feature +sha2 -target-feature +sha3 -target-feature +specrestrict -target-feature +ssbs -target-abi darwinpcs -debug-info-kind=standalone -dwarf-version=2 -debugger-tuning=lldb -fdebug-compilation-dir=/Users/ian/Developer/tlskit-external-dependencies -target-linker-version 1266.8 -v -fcoverage-compilation-dir=/Users/ian/Developer/tlskit-external-dependencies -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/21 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator26.4.sdk -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator26.4.sdk -I /Users/ian/Developer/tlskit-external-dependencies/builder/openssl-ios/build/openssl_arm64-iphonesimulator/artifacts/include -internal-isystem /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator26.4.sdk/usr/local/include -internal-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/21/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator26.4.sdk/usr/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -internal-iframework /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator26.4.sdk/System/Library/Frameworks -internal-iframework /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator26.4.sdk/System/Library/SubFrameworks -internal-iframework /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator26.4.sdk/Library/Frameworks -Werror-implicit-function-declaration -Werror=partial-availability -Wno-elaborated-enum-base -ferror-limit 19 -fmessage-length=130 -stack-protector 1 -mdarwin-stkchk-strong-link -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -fmax-type-align=16 -fcommon -fcolor-diagnostics -vectorize-loops -vectorize-slp -clang-vendor-feature=+disableNonDependentMemberExprInCurrentInstantiation -fno-odr-hash-protocols -clang-vendor-feature=+enableAggressiveVLAFolding -clang-vendor-feature=+revert09abecef7bbf -clang-vendor-feature=+thisNoAlignAttr -clang-vendor-feature=+thisNoNullAttr -clang-vendor-feature=+disableAtImportPrivateFrameworkInImplementationError -Wno-error=allocator-wrappers -fdwarf2-cfi-asm -o /var/folders/l2/f0d6lbyx5lg7phhg6j7gd7q40000gn/T/conftest-220f79.o -x c conftest.c
    clang -cc1 version 21.0.0 (clang-2100.0.123.102) default target arm64-apple-darwin25.4.0
    ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator26.4.sdk/usr/local/include"
    ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator26.4.sdk/Library/Frameworks"
    #include "..." search starts here:
    #include <...> search starts here:
     /Users/ian/Developer/tlskit-external-dependencies/builder/openssl-ios/build/openssl_arm64-iphonesimulator/artifacts/include
     /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/21/include
     /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator26.4.sdk/usr/include
     /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
     /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator26.4.sdk/System/Library/Frameworks (framework directory)
     /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator26.4.sdk/System/Library/SubFrameworks (framework directory)
    End of search list.
     "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch arm64 -platform_version ios-simulator 14.0.0 26.4 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator26.4.sdk -Os -mllvm -enable-linkonceodr-outlining -o conftest -L/Users/ian/Developer/tlskit-external-dependencies/builder/openssl-ios/build/openssl_arm64-iphonesimulator/artifacts/lib /var/folders/l2/f0d6lbyx5lg7phhg6j7gd7q40000gn/T/conftest-220f79.o -lssl -lcrypto -lssl -lcrypto -lz -map conftest.map -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/21/lib/darwin/libclang_rt.iossim.a
    ld: warning: ignoring duplicate libraries: '-lcrypto', '-lssl'
     "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/dsymutil" -o conftest.dSYM conftest
    

    However if I change it to use iPhoneOS it fails as expected:

    Apple clang version 21.0.0 (clang-2100.0.123.102)
    Target: arm64-apple-darwin25.4.0
    Thread model: posix
    InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
     "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple arm64-apple-ios12.0.0 -Os -Wundef-prefix=TARGET_OS_ -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -Werror=implicit-function-declaration -emit-obj -dumpdir conftest- -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name conftest.c -mrelocation-model pic -pic-level 2 -mframe-pointer=non-leaf -fno-strict-return -ffp-contract=on -fno-rounding-math -funwind-tables=1 -fobjc-msgsend-selector-stubs -fno-sized-deallocation -target-sdk-version=26.4 -fvisibility-inlines-hidden-static-local-var -fno-modulemap-allow-subdirectory-search -fdefine-target-os-macros -fno-assume-unique-vtables -fno-modulemap-allow-subdirectory-search -enable-tlsdesc -target-cpu apple-a7 -target-feature +v8a -target-feature +aes -target-feature +fp-armv8 -target-feature +neon -target-feature +perfmon -target-feature +sha2 -target-abi darwinpcs -debug-info-kind=standalone -dwarf-version=2 -debugger-tuning=lldb -fdebug-compilation-dir=/Users/ian/Developer/tlskit-external-dependencies -target-linker-version 1266.8 -v -fcoverage-compilation-dir=/Users/ian/Developer/tlskit-external-dependencies -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/21 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS26.4.sdk -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS26.4.sdk -I /Users/ian/Developer/tlskit-external-dependencies/builder/openssl-ios/build/openssl_arm64-iphoneos/artifacts/include -internal-isystem /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS26.4.sdk/usr/local/include -internal-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/21/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS26.4.sdk/usr/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -internal-iframework /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS26.4.sdk/System/Library/Frameworks -internal-iframework /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS26.4.sdk/System/Library/SubFrameworks -internal-iframework /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS26.4.sdk/Library/Frameworks -Werror-implicit-function-declaration -Werror=partial-availability -Wno-elaborated-enum-base -ferror-limit 19 -fmessage-length=209 -stack-protector 1 -mdarwin-stkchk-strong-link -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -fmax-type-align=16 -fcommon -fcolor-diagnostics -vectorize-loops -vectorize-slp -clang-vendor-feature=+disableNonDependentMemberExprInCurrentInstantiation -fno-odr-hash-protocols -clang-vendor-feature=+enableAggressiveVLAFolding -clang-vendor-feature=+revert09abecef7bbf -clang-vendor-feature=+thisNoAlignAttr -clang-vendor-feature=+thisNoNullAttr -clang-vendor-feature=+disableAtImportPrivateFrameworkInImplementationError -Wno-error=allocator-wrappers -fdwarf2-cfi-asm -o /var/folders/l2/f0d6lbyx5lg7phhg6j7gd7q40000gn/T/conftest-1488ce.o -x c conftest.c
    clang -cc1 version 21.0.0 (clang-2100.0.123.102) default target arm64-apple-darwin25.4.0
    ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS26.4.sdk/usr/local/include"
    ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS26.4.sdk/Library/Frameworks"
    #include "..." search starts here:
    #include <...> search starts here:
     /Users/ian/Developer/tlskit-external-dependencies/builder/openssl-ios/build/openssl_arm64-iphoneos/artifacts/include
     /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/21/include
     /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS26.4.sdk/usr/include
     /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
     /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS26.4.sdk/System/Library/Frameworks (framework directory)
     /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS26.4.sdk/System/Library/SubFrameworks (framework directory)
    End of search list.
     "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch arm64 -platform_version ios 12.0.0 26.4 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS26.4.sdk -Os -mllvm -enable-linkonceodr-outlining -o conftest -L/Users/ian/Developer/tlskit-external-dependencies/builder/openssl-ios/build/openssl_arm64-iphoneos/artifacts/lib /var/folders/l2/f0d6lbyx5lg7phhg6j7gd7q40000gn/T/conftest-1488ce.o -lssl -lcrypto -lssl -lcrypto -lz -map conftest.map -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/21/lib/darwin/libclang_rt.ios.a
    ld: warning: ignoring duplicate libraries: '-lcrypto', '-lssl'
    Undefined symbols for architecture arm64:
      "_pipe2", referenced from:
          _main in conftest-1488ce.o
    ld: symbol(s) not found for architecture arm64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    
  9. vszakats commented on Apr 8, 2026

    @vszakats
    Member

    What is the content of conftest.map in either cases?

  10. ecnepsnai commented on Apr 8, 2026

    @ecnepsnai
    ContributorAuthor

    Apologies, forgot to upload that. Here you are:

    # Path: conftest
    # Arch: arm64
    # Object files:
    [  0] linker synthesized
    [  1] /var/folders/l2/f0d6lbyx5lg7phhg6j7gd7q40000gn/T/conftest-bcfe09.o
    [  2] /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator26.4.sdk/usr/lib/libz.tbd
    [  3] /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator26.4.sdk/usr/lib/libSystem.tbd
    [  4] /usr/lib/system/libdyld.dylib
    [  5] /usr/lib/system/libsystem_sim_kernel.dylib
    # Sections:
    # Address	Size    	Segment	Section
    0x1000005B0	0x00000014	__TEXT	__text
    0x1000005C4	0x0000000C	__TEXT	__stubs
    0x1000005D0	0x00000024	__TEXT	__stub_helper
    0x1000005F4	0x00000058	__TEXT	__unwind_info
    0x100004000	0x00000008	__DATA_CONST	__got
    0x100008000	0x00000008	__DATA	__la_symbol_ptr
    0x100008008	0x00000008	__DATA	__data
    # Symbols:
    # Address	Size    	File  Name
    0x100000000	0x00000000	[  0] __mh_execute_header
    0x1000005B0	0x00000014	[  1] _main
    0x1000005C4	0x0000000C	[  5] _pipe2.stub
    0x1000005D0	0x00000018	[  0] anon
    0x1000005E8	0x0000000C	[  0] anon
    0x1000005F4	0x00000058	[  0] compact unwind info
    0x100004000	0x00000008	[  4] dyld_stub_binder.got
    0x100008000	0x00000008	[  5] _pipe2.lazy_ptr
    0x100008008	0x00000008	[  0] __dyld_private
    
  11. vszakats commented on Apr 8, 2026

    @vszakats
    Member

    Thanks! It answers the riddle: /usr/lib/system/libsystem_sim_kernel.dylib is
    exporting this symbol. Might be an oversight, but I wouldn't expect Apple fixing
    this, even if it is.

    In this case guarding off this feature check for Apple platforms seems like a
    reasonable solution to me. If Apple ever gets to support this API, it will require
    a different approach, but that's not something likely to happen IMO.

  12. added a commit that references this issue on Apr 8, 2026
    f21306f
  13. vszakats commented on Apr 8, 2026

    @vszakats
    Member

    @ecnepsnai Does this patch fix the issue for you?: #21271

  14. 2 remaining items

  15. ecnepsnai commented on Apr 8, 2026

    @ecnepsnai
    ContributorAuthor

    I did not, thanks for pointing that out!

    And after doing that, I can confirm your patch does fix the issue.

  16. vszakats commented on Apr 8, 2026

    @vszakats
    Member

    Thanks for your tests! I merged the fix.

  17. added a commit that references this issue on Apr 8, 2026
    1737e47
  18. added a commit that references this issue on Jun 3, 2026
    aad0d00
  19. akoeplinger commented on Sep 16, 2026

    @akoeplinger

    it looks like Apple added this function in the macOS/iOS 27 releases, from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/include/sys/unistd.h

    __API_AVAILABLE(macos(27.0), ios(27.0), tvos(27.0), watchos(27.0), visionos(27.0))
    int     pipe2(int [2], int);
  20. vszakats commented on Sep 28, 2026

    @vszakats
    Member

    @akoeplinger Thanks for reporting. I landed PR #23126 to enable pipe2() support on Apple OSes. (could not try it locally due to the lack of SDK 27, but the CI builds it and runs tests with it.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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