From 76d9d0289ad0807a1a39e37392db6b9bb30546e8 Mon Sep 17 00:00:00 2001 From: Aaron R Robinson Date: Sat, 4 Apr 2026 11:54:21 -0700 Subject: [PATCH 1/4] Disable ICorProfiler on mobile and WASM platforms Refactor FEATURE_CORPROFILER in clrfeatures.cmake to disable the ICorProfiler feature on Android, Mac Catalyst, iOS, and WASM targets. Previously the profiler was unconditionally enabled and then only explicitly disabled for WASM. This consolidates the logic into a single guard that excludes all unsupported platforms and makes the flag overridable from the command line. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/coreclr/clrfeatures.cmake | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/coreclr/clrfeatures.cmake b/src/coreclr/clrfeatures.cmake index 7b87cefead0c25..87ca399ce0b184 100644 --- a/src/coreclr/clrfeatures.cmake +++ b/src/coreclr/clrfeatures.cmake @@ -46,14 +46,17 @@ if(NOT DEFINED FEATURE_DBGIPC) endif() endif(NOT DEFINED FEATURE_DBGIPC) -# ICorProfiler is supported by default -set(FEATURE_CORPROFILER 1) +if(NOT DEFINED FEATURE_CORPROFILER) + # ICorProfiler isn't supported on mobile or WASM scenarios + if(NOT CLR_CMAKE_TARGET_ARCH_WASM AND NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE_TARGET_MACCATALYST AND NOT CLR_CMAKE_TARGET_IOS) + set(FEATURE_CORPROFILER 1) + endif() +endif() if(CLR_CMAKE_TARGET_ARCH_WASM) # FEATURE_INTERPRETER is already enabled by default set(FEATURE_PORTABLE_ENTRYPOINTS 1) set(FEATURE_PORTABLE_HELPERS 1) - set(FEATURE_CORPROFILER 0) endif(CLR_CMAKE_TARGET_ARCH_WASM) if(CLR_CMAKE_TARGET_BROWSER) From 3b4f873a6d87360015bb35cf95435d2b650e01dd Mon Sep 17 00:00:00 2001 From: Aaron R Robinson Date: Sat, 4 Apr 2026 12:13:18 -0700 Subject: [PATCH 2/4] Also exclude tvOS from ICorProfiler support Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/coreclr/clrfeatures.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreclr/clrfeatures.cmake b/src/coreclr/clrfeatures.cmake index 87ca399ce0b184..a0a4f9ba443673 100644 --- a/src/coreclr/clrfeatures.cmake +++ b/src/coreclr/clrfeatures.cmake @@ -48,7 +48,7 @@ endif(NOT DEFINED FEATURE_DBGIPC) if(NOT DEFINED FEATURE_CORPROFILER) # ICorProfiler isn't supported on mobile or WASM scenarios - if(NOT CLR_CMAKE_TARGET_ARCH_WASM AND NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE_TARGET_MACCATALYST AND NOT CLR_CMAKE_TARGET_IOS) + if(NOT CLR_CMAKE_TARGET_ARCH_WASM AND NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE_TARGET_MACCATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS) set(FEATURE_CORPROFILER 1) endif() endif() From 7b5e7fca478bdd5d2355c03654e31d77eb68cafc Mon Sep 17 00:00:00 2001 From: Aaron R Robinson Date: Sat, 4 Apr 2026 12:18:28 -0700 Subject: [PATCH 3/4] Update ICorProfiler support check to exclude non-desktop targets and WASM --- src/coreclr/clrfeatures.cmake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/coreclr/clrfeatures.cmake b/src/coreclr/clrfeatures.cmake index a0a4f9ba443673..e3b99b9bd8987f 100644 --- a/src/coreclr/clrfeatures.cmake +++ b/src/coreclr/clrfeatures.cmake @@ -47,8 +47,12 @@ if(NOT DEFINED FEATURE_DBGIPC) endif(NOT DEFINED FEATURE_DBGIPC) if(NOT DEFINED FEATURE_CORPROFILER) - # ICorProfiler isn't supported on mobile or WASM scenarios - if(NOT CLR_CMAKE_TARGET_ARCH_WASM AND NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE_TARGET_MACCATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS) + # ICorProfiler isn't supported on non-desktop targets or WASM scenarios + if(NOT CLR_CMAKE_TARGET_ARCH_WASM + AND NOT CLR_CMAKE_TARGET_ANDROID + AND NOT CLR_CMAKE_TARGET_MACCATALYST + AND NOT CLR_CMAKE_TARGET_IOS + AND NOT CLR_CMAKE_TARGET_TVOS) set(FEATURE_CORPROFILER 1) endif() endif() From 1c34317aa8bcba25c4404d3e5539cee1eac72d5d Mon Sep 17 00:00:00 2001 From: Aaron R Robinson Date: Tue, 7 Apr 2026 08:03:59 -0700 Subject: [PATCH 4/4] Apply suggestion from @AaronRobinsonMSFT --- src/coreclr/clrfeatures.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/coreclr/clrfeatures.cmake b/src/coreclr/clrfeatures.cmake index e3b99b9bd8987f..55d3a3c070ca3b 100644 --- a/src/coreclr/clrfeatures.cmake +++ b/src/coreclr/clrfeatures.cmake @@ -49,9 +49,9 @@ endif(NOT DEFINED FEATURE_DBGIPC) if(NOT DEFINED FEATURE_CORPROFILER) # ICorProfiler isn't supported on non-desktop targets or WASM scenarios if(NOT CLR_CMAKE_TARGET_ARCH_WASM - AND NOT CLR_CMAKE_TARGET_ANDROID - AND NOT CLR_CMAKE_TARGET_MACCATALYST - AND NOT CLR_CMAKE_TARGET_IOS + # AND NOT CLR_CMAKE_TARGET_ANDROID + # AND NOT CLR_CMAKE_TARGET_MACCATALYST + # AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS) set(FEATURE_CORPROFILER 1) endif()