From 8c8c8c85129c807282be6bb4642018799cd9eebb Mon Sep 17 00:00:00 2001 From: Larry Ewing Date: Tue, 15 Sep 2026 22:38:39 -0500 Subject: [PATCH 1/4] Fix pipe2 detection for Apple deployment targets Use a compile probe that calls pipe2 and treats Apple availability diagnostics as errors, while keeping the result independent from shared feature caches. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- src/coreclr/pal/src/configure.cmake | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/coreclr/pal/src/configure.cmake b/src/coreclr/pal/src/configure.cmake index 8ada9b82c11ad9..80f7e2c0156ff0 100644 --- a/src/coreclr/pal/src/configure.cmake +++ b/src/coreclr/pal/src/configure.cmake @@ -141,7 +141,25 @@ check_function_exists(vm_read HAVE_VM_READ) check_function_exists(semget HAS_SYSV_SEMAPHORES) check_function_exists(pthread_mutex_init HAS_PTHREAD_MUTEXES) check_function_exists(ttrace HAVE_TTRACE) -check_function_exists(pipe2 HAVE_PIPE2) + +set(PREVIOUS_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS}) +if(CLR_CMAKE_HOST_APPLE) + set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Werror=unguarded-availability-new") +endif() +check_cxx_source_compiles(" +#include +#include +int main() +{ + int pipeDescriptors[2]; + return pipe2(pipeDescriptors, O_CLOEXEC); +}" HAVE_PIPE2_USABLE) +if(HAVE_PIPE2_USABLE) + set(HAVE_PIPE2 1) +else() + set(HAVE_PIPE2 0) +endif() +set(CMAKE_REQUIRED_FLAGS ${PREVIOUS_CMAKE_REQUIRED_FLAGS}) check_cxx_source_compiles(" #include From 05c41fbaa334f352548fec9b5eded20bec21d57b Mon Sep 17 00:00:00 2001 From: Larry Ewing Date: Tue, 15 Sep 2026 23:23:08 -0500 Subject: [PATCH 2/4] Keep PAL pipe2 probe out of shared cache Use a PAL-specific probe variable so browser cache regeneration cannot preseed the host deployment-target check. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- src/coreclr/pal/src/configure.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/coreclr/pal/src/configure.cmake b/src/coreclr/pal/src/configure.cmake index 80f7e2c0156ff0..ebe5fda1b23e7b 100644 --- a/src/coreclr/pal/src/configure.cmake +++ b/src/coreclr/pal/src/configure.cmake @@ -153,8 +153,8 @@ int main() { int pipeDescriptors[2]; return pipe2(pipeDescriptors, O_CLOEXEC); -}" HAVE_PIPE2_USABLE) -if(HAVE_PIPE2_USABLE) +}" PAL_HAVE_PIPE2) +if(PAL_HAVE_PIPE2) set(HAVE_PIPE2 1) else() set(HAVE_PIPE2 0) From f28bd4b179d073143505bd1355e31bd5ec400ec8 Mon Sep 17 00:00:00 2001 From: Larry Ewing Date: Tue, 15 Sep 2026 23:50:55 -0500 Subject: [PATCH 3/4] Propagate PAL pipe2 probe result Publish the deployment-aware result to the CMake cache so sibling directories such as debug-pal cannot observe the stale preloaded value. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- src/coreclr/pal/src/configure.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/coreclr/pal/src/configure.cmake b/src/coreclr/pal/src/configure.cmake index ebe5fda1b23e7b..057dc115743841 100644 --- a/src/coreclr/pal/src/configure.cmake +++ b/src/coreclr/pal/src/configure.cmake @@ -155,9 +155,9 @@ int main() return pipe2(pipeDescriptors, O_CLOEXEC); }" PAL_HAVE_PIPE2) if(PAL_HAVE_PIPE2) - set(HAVE_PIPE2 1) + set(HAVE_PIPE2 1 CACHE INTERNAL "" FORCE) else() - set(HAVE_PIPE2 0) + set(HAVE_PIPE2 0 CACHE INTERNAL "" FORCE) endif() set(CMAKE_REQUIRED_FLAGS ${PREVIOUS_CMAKE_REQUIRED_FLAGS}) From 82b4b119768018bf6245e0be0a2fd31268792e5b Mon Sep 17 00:00:00 2001 From: Larry Ewing Date: Wed, 16 Sep 2026 00:00:09 -0500 Subject: [PATCH 4/4] Use standard CMake pipe2 symbol check Keep the PAL-specific cache key and Apple availability diagnostic while using the existing CMake helper. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- src/coreclr/pal/src/configure.cmake | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/coreclr/pal/src/configure.cmake b/src/coreclr/pal/src/configure.cmake index 057dc115743841..9c284590e99f41 100644 --- a/src/coreclr/pal/src/configure.cmake +++ b/src/coreclr/pal/src/configure.cmake @@ -146,14 +146,7 @@ set(PREVIOUS_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS}) if(CLR_CMAKE_HOST_APPLE) set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Werror=unguarded-availability-new") endif() -check_cxx_source_compiles(" -#include -#include -int main() -{ - int pipeDescriptors[2]; - return pipe2(pipeDescriptors, O_CLOEXEC); -}" PAL_HAVE_PIPE2) +check_cxx_symbol_exists(pipe2 unistd.h PAL_HAVE_PIPE2) if(PAL_HAVE_PIPE2) set(HAVE_PIPE2 1 CACHE INTERNAL "" FORCE) else()