Skip to content

Xcode 27 pipe2 detection breaks macOS host builds targeting macOS 14 #134024

Description

@lewing

Description

Fresh CoreCLR CMake configurations fail with Xcode 27 because the PAL's check_function_exists(pipe2 HAVE_PIPE2) detects the newly declared pipe2 symbol without accounting for its deployment-target availability. The resulting build defines HAVE_PIPE2=1 while targeting macOS 14.0.

Reproduction Steps

With Xcode 27 selected, run a fresh build that compiles the macOS host-side PAL, for example:

PATH="/opt/homebrew/bin:$PATH" ./build.sh clr -os browser -arch wasm -c Release

The generated compile command contains:

-DHAVE_PIPE2=1 -mmacosx-version-min=14.0 -Werror

Expected behavior

The availability probe should determine that pipe2 cannot be called when targeting macOS 14.0. HAVE_PIPE2 should remain disabled and the existing pipe plus fcntl(FD_CLOEXEC) fallback should compile.

Actual behavior

Compilation of src/coreclr/pal/src/thread/threadsusp.cpp fails:

error: 'pipe2' is only available on macOS 27.0 or newer
[-Werror,-Wunguarded-availability-new]

Xcode 27's SDK declares:

__API_AVAILABLE(macos(27.0), ios(27.0), tvos(27.0), watchos(27.0), visionos(27.0))
int pipe2(int [2], int);

The current symbol/link probe succeeds because the SDK exports the symbol, but it does not verify usability at CMAKE_OSX_DEPLOYMENT_TARGET=14.0 with availability diagnostics enabled.

Regression?

Yes, this is exposed by Xcode 27 / macOS SDK 27. Older SDKs did not declare pipe2, so fresh configurations selected the fallback. Existing worktrees configured before an Xcode update may also retain HAVE_PIPE2=0 in their CMake cache and continue to build.

Known Workarounds

Use a worktree configured with an older SDK, or locally force HAVE_PIPE2=0. Neither is suitable for CI or normal development.

Configuration

  • macOS arm64
  • Xcode 27.0, build 27A266a
  • macOS SDK 27.0
  • Apple clang 21.0.0
  • CoreCLR host deployment target: macOS 14.0

Other information

The fix should make the feature test deployment-target-aware rather than hardcoding an Xcode version. For example, compile a source snippet that calls pipe2 using the configured deployment target and treats -Wunguarded-availability-new as an error. This should leave HAVE_PIPE2=0 when the target predates the API.

Note

This issue was generated with the assistance of GitHub Copilot.

Activity

  1. added theissue type on Sep 16, 2026
  2. added a commit that references this issue on Sep 16, 2026
    34590a4
  3. added a commit that references this issue on Sep 18, 2026
    1632f46
  4. locked and limited conversation to collaborators on Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions