Skip to content

Commit cbe14c8

Browse files
authored
gh-103097: Add workaround for Windows ARM64 compiler bug (GH-103098)
See https://developercommunity.visualstudio.com/t/Regression-in-MSVC-1433-1434-ARM64-co/10224361 for details of the issue. It only applies to version 14.34.
1 parent d189e2d commit cbe14c8

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

PCbuild/pyproject.props

+9
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@
2121
<LinkIncremental Condition="$(Configuration) != 'Debug'">false</LinkIncremental>
2222
</PropertyGroup>
2323

24+
<PropertyGroup Label="MSVC Bug Workarounds" Condition="$(VCToolsVersion) != ''">
25+
<_VCToolsVersion>$([System.Version]::Parse(`$(VCToolsVersion)`).Major).$([System.Version]::Parse(`$(VCToolsVersion)`).Minor)</_VCToolsVersion>
26+
27+
<!-- See https://developercommunity.visualstudio.com/t/Regression-in-MSVC-1433-1434-ARM64-co/10224361 -->
28+
<MSVCHasBrokenARM64Clamping Condition="$(_VCToolsVersion) == '14.34'">true</MSVCHasBrokenARM64Clamping>
29+
</PropertyGroup>
30+
2431
<PropertyGroup>
2532
<_DebugPreprocessorDefinition>NDEBUG;</_DebugPreprocessorDefinition>
2633
<_DebugPreprocessorDefinition Condition="$(Configuration) == 'Debug'">_DEBUG;</_DebugPreprocessorDefinition>
@@ -47,6 +54,7 @@
4754
<ControlFlowGuard Condition="$(EnableControlFlowGuard) != ''">$(EnableControlFlowGuard)</ControlFlowGuard>
4855
<AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>
4956
<MultiProcessorCompilation>true</MultiProcessorCompilation>
57+
<AdditionalOptions Condition="$(MSVCHasBrokenARM64Clamping) == 'true' and $(Platform) == 'ARM64'">-d2pattern-opt-disable:-932189325 %(AdditionalOptions)</AdditionalOptions>
5058
</ClCompile>
5159
<ClCompile Condition="$(Configuration) == 'Debug'">
5260
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
@@ -76,6 +84,7 @@
7684
<LinkTimeCodeGeneration Condition="$(SupportPGO) and $(Configuration) == 'PGUpdate'">PGUpdate</LinkTimeCodeGeneration>
7785
<AdditionalDependencies>advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;%(AdditionalDependencies)</AdditionalDependencies>
7886
<AdditionalOptions Condition="$(Configuration) != 'Debug'">/OPT:REF,NOICF %(AdditionalOptions)</AdditionalOptions>
87+
<AdditionalOptions Condition="$(MSVCHasBrokenARM64Clamping) == 'true' and $(Platform) == 'ARM64'">-d2:-pattern-opt-disable:-932189325 %(AdditionalOptions)</AdditionalOptions>
7988
</Link>
8089
<Lib>
8190
<LinkTimeCodeGeneration Condition="$(Configuration) == 'Release'">true</LinkTimeCodeGeneration>

0 commit comments

Comments
 (0)