From ed05654e247c7c9a4e0bc743b2a50c6e2f0e3cd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Wed, 24 Jun 2026 17:52:33 +0900 Subject: [PATCH 1/7] Make crossbuilds faster The reason crossbuilds are slower is because we need to build cross-targeting tools: when building arm64 from an x64 machine, we need x64 hosted crossgen2 in addition to the standard arm64 hosted one to R2R compile CoreLib on the build machine. However, the x64-hosted crossgen is limited in purpose - it only needs to be able to build for the target architecture. We were currently building all the JIT flavors so that this native-hosted crossgen can target _anything_, same as the target-hosted one. However, we don't ship the native-hosted crossgen and we only need it to target the target architecture. This updates the build so that the host architecture crossgen only has one codegen: the one for the target. This should shave good 5 minutes off the CI time. --- eng/Subsets.props | 2 +- src/coreclr/tools/aot/AotCompilerCommon.props | 40 +++++++++++++++++++ .../tools/aot/ILCompiler/ILCompiler.props | 27 ------------- .../tools/aot/crossgen2/crossgen2.props | 25 ------------ 4 files changed, 41 insertions(+), 53 deletions(-) diff --git a/eng/Subsets.props b/eng/Subsets.props index f81c5e0661cf5d..a828a09050c15e 100644 --- a/eng/Subsets.props +++ b/eng/Subsets.props @@ -378,7 +378,7 @@ - <_CrossToolSubset Condition="'$(_BuildCrossComponents)' == 'true' and '$(TargetArchitecture)' != 'wasm' and ($(_subset.Contains('+clr.tools+')) or $(_subset.Contains('+clr.nativecorelib+')) or $(_subset.Contains('+clr.crossarchtools+')))" Include="ClrAllJitsSubset=true" /> + <_CrossToolSubset Condition="'$(_BuildCrossComponents)' == 'true' and '$(TargetArchitecture)' != 'wasm' and ($(_subset.Contains('+clr.tools+')) or $(_subset.Contains('+clr.nativecorelib+')) or $(_subset.Contains('+clr.crossarchtools+')))" Include="ClrJitSubset=true" /> <_CrossToolSubset Condition="'$(_BuildCrossComponents)' == 'true' and '$(TargetArchitecture)' == 'wasm' and ($(_subset.Contains('+clr.tools+')) or $(_subset.Contains('+clr.nativecorelib+')) or $(_subset.Contains('+clr.crossarchtools+')))" Include="ClrWasmJitSubset=true" /> diff --git a/src/coreclr/tools/aot/AotCompilerCommon.props b/src/coreclr/tools/aot/AotCompilerCommon.props index 800a9cff0cc9f6..2b31479c8e1f6d 100644 --- a/src/coreclr/tools/aot/AotCompilerCommon.props +++ b/src/coreclr/tools/aot/AotCompilerCommon.props @@ -16,5 +16,45 @@ <_LibPrefix Condition="'$(CrossHostArch)' != 'true'">$(HostLibPrefix) <_LibSuffix Condition="'$(CrossHostArch)' == 'true'">$(LibSuffix) <_LibSuffix Condition="'$(CrossHostArch)' != 'true'">$(HostLibSuffix) + + $(TargetArchitecture) + $(CrossHostArch) + arm + + $(_LibPrefix)jitinterface_$(TargetArchitectureForSharedLibraries)$(_LibSuffix) + + <_TargetArchitectureForJitLibraryName>$(TargetArchitecture) + <_TargetArchitectureForJitLibraryName Condition="'$(_TargetArchitectureForJitLibraryName)' == 'armel'">arm + <_TargetArchitectureForJitLibraryName Condition="'$(_TargetArchitectureForJitLibraryName)' == 'wasm'">wasm + <_TargetOSForJitLibraryName Condition="'$(TargetArchitecture)' == 'arm' or '$(TargetArchitecture)' == 'armel' or '$(TargetArchitecture)' == 'arm64' or '$(TargetArchitecture)' == 'wasm'">universal + <_TargetOSForJitLibraryName Condition="'$(_TargetOSForJitLibraryName)' == '' and '$(TargetOS)' == 'windows'">win + <_TargetOSForJitLibraryName Condition="'$(_TargetOSForJitLibraryName)' == ''">unix + $(_LibPrefix)clrjit_$(_TargetOSForJitLibraryName)_$(_TargetArchitectureForJitLibraryName)_$(TargetArchitectureForSharedLibraries)$(_LibSuffix) + + + + + + + + diff --git a/src/coreclr/tools/aot/ILCompiler/ILCompiler.props b/src/coreclr/tools/aot/ILCompiler/ILCompiler.props index e3e6d02212c298..e901d56df167fb 100644 --- a/src/coreclr/tools/aot/ILCompiler/ILCompiler.props +++ b/src/coreclr/tools/aot/ILCompiler/ILCompiler.props @@ -53,31 +53,4 @@ - - - $(TargetArchitecture) - $(CrossHostArch) - arm - - $(_LibPrefix)jitinterface_$(TargetArchitectureForSharedLibraries)$(_LibSuffix) - - $(RuntimeBinDir)$(CrossHostArch) - - - - - - - diff --git a/src/coreclr/tools/aot/crossgen2/crossgen2.props b/src/coreclr/tools/aot/crossgen2/crossgen2.props index 825f499e688d04..5c912720c8c927 100644 --- a/src/coreclr/tools/aot/crossgen2/crossgen2.props +++ b/src/coreclr/tools/aot/crossgen2/crossgen2.props @@ -41,31 +41,6 @@ - - $(TargetArchitecture) - $(CrossHostArch) - arm - - $(_LibPrefix)jitinterface_$(TargetArchitectureForSharedLibraries)$(_LibSuffix) - - - - - - - - Date: Wed, 24 Jun 2026 17:54:12 +0900 Subject: [PATCH 2/7] Revert "Enforce 75-minute timeout floor for windows_arm64 global build jobs (#129553)" This reverts commit 95aa263d8387779ef28b1ac89fe186d523bb6c0b. --- eng/pipelines/common/global-build-job.yml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/eng/pipelines/common/global-build-job.yml b/eng/pipelines/common/global-build-job.yml index c0e1a20daa934a..33dcc731daccac 100644 --- a/eng/pipelines/common/global-build-job.yml +++ b/eng/pipelines/common/global-build-job.yml @@ -49,17 +49,7 @@ jobs: pool: ${{ parameters.pool }} container: ${{ parameters.container }} condition: and(succeeded(), ${{ parameters.condition }}) - # Windows arm64 builds are slower than the 60 min ADO default, - # so enforce a floor of 75 minutes while still honoring any larger explicit value. - ${{ if eq(parameters.platform, 'windows_arm64') }}: - ${{ if eq(parameters.timeoutInMinutes, '') }}: - timeoutInMinutes: 75 - ${{ elseif gt(parameters.timeoutInMinutes, 75) }}: - timeoutInMinutes: ${{ parameters.timeoutInMinutes }} - ${{ else }}: - timeoutInMinutes: 75 - ${{ else }}: - timeoutInMinutes: ${{ parameters.timeoutInMinutes }} + timeoutInMinutes: ${{ parameters.timeoutInMinutes }} enablePublishTestResults: ${{ parameters.enablePublishTestResults }} testResultsFormat: ${{ parameters.testResultsFormat }} enableMicrobuild: ${{ parameters.isOfficialBuild }} From bee0ad4d6b07cf8c6888615abcb06a3232733f4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Wed, 24 Jun 2026 19:09:35 +0900 Subject: [PATCH 3/7] Maybe fix wasm special case --- src/coreclr/tools/aot/AotCompilerCommon.props | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/coreclr/tools/aot/AotCompilerCommon.props b/src/coreclr/tools/aot/AotCompilerCommon.props index 2b31479c8e1f6d..bb517447135718 100644 --- a/src/coreclr/tools/aot/AotCompilerCommon.props +++ b/src/coreclr/tools/aot/AotCompilerCommon.props @@ -30,6 +30,8 @@ <_TargetOSForJitLibraryName Condition="'$(_TargetOSForJitLibraryName)' == '' and '$(TargetOS)' == 'windows'">win <_TargetOSForJitLibraryName Condition="'$(_TargetOSForJitLibraryName)' == ''">unix $(_LibPrefix)clrjit_$(_TargetOSForJitLibraryName)_$(_TargetArchitectureForJitLibraryName)_$(TargetArchitectureForSharedLibraries)$(_LibSuffix) + $(_LibPrefix)clrjit$(_LibSuffix) + $(SingleJitLibraryName) @@ -49,7 +51,7 @@ Condition="'$(CrossHostArch)' == ''" /> - Date: Wed, 24 Jun 2026 19:17:18 +0900 Subject: [PATCH 4/7] ReadyToRun testing targets everything (?!) --- eng/Subsets.props | 1 + 1 file changed, 1 insertion(+) diff --git a/eng/Subsets.props b/eng/Subsets.props index a828a09050c15e..ce9081f87cdde0 100644 --- a/eng/Subsets.props +++ b/eng/Subsets.props @@ -378,6 +378,7 @@ + <_CrossToolSubset Condition="'$(_BuildCrossComponents)' == 'true' and '$(TargetArchitecture)' != 'wasm' and $(_subset.Contains('+clr.toolstests+'))" Include="ClrAllJitsSubset=true" /> <_CrossToolSubset Condition="'$(_BuildCrossComponents)' == 'true' and '$(TargetArchitecture)' != 'wasm' and ($(_subset.Contains('+clr.tools+')) or $(_subset.Contains('+clr.nativecorelib+')) or $(_subset.Contains('+clr.crossarchtools+')))" Include="ClrJitSubset=true" /> <_CrossToolSubset Condition="'$(_BuildCrossComponents)' == 'true' and '$(TargetArchitecture)' == 'wasm' and ($(_subset.Contains('+clr.tools+')) or $(_subset.Contains('+clr.nativecorelib+')) or $(_subset.Contains('+clr.crossarchtools+')))" Include="ClrWasmJitSubset=true" /> From 5847192b4141a3b0819e715d020c3100db43c4c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Wed, 24 Jun 2026 19:27:10 +0900 Subject: [PATCH 5/7] Maybe fix armel too --- src/coreclr/tools/aot/AotCompilerCommon.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreclr/tools/aot/AotCompilerCommon.props b/src/coreclr/tools/aot/AotCompilerCommon.props index bb517447135718..6a568f7009dea3 100644 --- a/src/coreclr/tools/aot/AotCompilerCommon.props +++ b/src/coreclr/tools/aot/AotCompilerCommon.props @@ -31,7 +31,7 @@ <_TargetOSForJitLibraryName Condition="'$(_TargetOSForJitLibraryName)' == ''">unix $(_LibPrefix)clrjit_$(_TargetOSForJitLibraryName)_$(_TargetArchitectureForJitLibraryName)_$(TargetArchitectureForSharedLibraries)$(_LibSuffix) $(_LibPrefix)clrjit$(_LibSuffix) - $(SingleJitLibraryName) + $(SingleJitLibraryName) From cc6adf96a069d9ae788c9eca77a29670c8527cb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Wed, 24 Jun 2026 21:19:58 +0900 Subject: [PATCH 6/7] Do not install clrjit into sharedFramework when building crosscomponents The justification is the same as the comment above for alljits. --- src/coreclr/jit/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/coreclr/jit/CMakeLists.txt b/src/coreclr/jit/CMakeLists.txt index 0178c65397d36b..0544cd33ec9be4 100644 --- a/src/coreclr/jit/CMakeLists.txt +++ b/src/coreclr/jit/CMakeLists.txt @@ -716,11 +716,12 @@ else() endif() create_standalone_jit(TARGET clrjit OS ${TARGET_OS_NAME} ARCH ${ARCH_TARGET_NAME}) -install_clr(TARGETS clrjit DESTINATIONS . sharedFramework COMPONENT jit) +install_clr(TARGETS clrjit DESTINATIONS . COMPONENT jit) if (NOT CLR_CROSS_COMPONENTS_BUILD) # Install the clrjit into the sharedframework dir only when we're not doing a cross-components build. # We never want to ship the cross-component JIT (it would never be used). + install_clr(TARGETS clrjit DESTINATIONS sharedFramework COMPONENT jit) install_clr(TARGETS clrjit DESTINATIONS sharedFramework COMPONENT alljits) endif() From a2b987437250a1c813d4261746b24e527108f383 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Wed, 24 Jun 2026 21:32:13 +0900 Subject: [PATCH 7/7] More workarounds for ILCompiler.ReadyToRun.Tests.csproj --- src/coreclr/tools/aot/AotCompilerCommon.props | 5 +++-- .../ILCompiler.ReadyToRun.Tests.csproj | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/coreclr/tools/aot/AotCompilerCommon.props b/src/coreclr/tools/aot/AotCompilerCommon.props index 6a568f7009dea3..827d2d3fc94ec0 100644 --- a/src/coreclr/tools/aot/AotCompilerCommon.props +++ b/src/coreclr/tools/aot/AotCompilerCommon.props @@ -32,6 +32,7 @@ $(_LibPrefix)clrjit_$(_TargetOSForJitLibraryName)_$(_TargetArchitectureForJitLibraryName)_$(TargetArchitectureForSharedLibraries)$(_LibSuffix) $(_LibPrefix)clrjit$(_LibSuffix) $(SingleJitLibraryName) + true @@ -48,7 +49,7 @@ CopyToPublishDirectory="PreserveNewest" ExcludeFromSingleFile="$(PublishSingleFile)" Link="%(FileName)%(Extension)" - Condition="'$(CrossHostArch)' == ''" + Condition="'$(CopyAllJitLibrariesToAotCompilerOutput)' == 'true'" /> diff --git a/src/coreclr/tools/aot/ILCompiler.ReadyToRun.Tests/ILCompiler.ReadyToRun.Tests.csproj b/src/coreclr/tools/aot/ILCompiler.ReadyToRun.Tests/ILCompiler.ReadyToRun.Tests.csproj index 9fa35c126976d9..72e0847ba05f0e 100644 --- a/src/coreclr/tools/aot/ILCompiler.ReadyToRun.Tests/ILCompiler.ReadyToRun.Tests.csproj +++ b/src/coreclr/tools/aot/ILCompiler.ReadyToRun.Tests/ILCompiler.ReadyToRun.Tests.csproj @@ -27,7 +27,8 @@ even when this test project is built in a different configuration than CoreCLR was (e.g. CoreCLR built Release via 'clr -rc release', but the test built/run as Debug). Mirrors the CoreLib SetConfiguration pattern in eng/references.targets. --> - Configuration=$(CoreCLRConfiguration) + CopyAllJitLibrariesToAotCompilerOutput=true + Configuration=$(CoreCLRConfiguration);CopyAllJitLibrariesToAotCompilerOutput=true