summaryrefslogtreecommitdiffstats
path: root/PCbuild
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@python.org>2023-03-28 23:47:13 (GMT)
committerGitHub <noreply@github.com>2023-03-28 23:47:13 (GMT)
commit24ba507b1dd70cf468a1beadea6ca6336fe1d40f (patch)
treee70e364bb920b2947cb146136379d22cfcfafb5b /PCbuild
parentba65a065cf07a7a9f53be61057a090f7311a5ad7 (diff)
downloadcpython-24ba507b1dd70cf468a1beadea6ca6336fe1d40f.zip
cpython-24ba507b1dd70cf468a1beadea6ca6336fe1d40f.tar.gz
cpython-24ba507b1dd70cf468a1beadea6ca6336fe1d40f.tar.bz2
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.
Diffstat (limited to 'PCbuild')
-rw-r--r--PCbuild/pyproject.props9
1 files changed, 9 insertions, 0 deletions
diff --git a/PCbuild/pyproject.props b/PCbuild/pyproject.props
index 92c7849..36c4c26 100644
--- a/PCbuild/pyproject.props
+++ b/PCbuild/pyproject.props
@@ -21,6 +21,13 @@
<LinkIncremental Condition="$(Configuration) != 'Debug'">false</LinkIncremental>
</PropertyGroup>
+ <PropertyGroup Label="MSVC Bug Workarounds" Condition="$(VCToolsVersion) != ''">
+ <_VCToolsVersion>$([System.Version]::Parse(`$(VCToolsVersion)`).Major).$([System.Version]::Parse(`$(VCToolsVersion)`).Minor)</_VCToolsVersion>
+
+ <!-- See https://developercommunity.visualstudio.com/t/Regression-in-MSVC-1433-1434-ARM64-co/10224361 -->
+ <MSVCHasBrokenARM64Clamping Condition="$(_VCToolsVersion) == '14.34'">true</MSVCHasBrokenARM64Clamping>
+ </PropertyGroup>
+
<PropertyGroup>
<_DebugPreprocessorDefinition>NDEBUG;</_DebugPreprocessorDefinition>
<_DebugPreprocessorDefinition Condition="$(Configuration) == 'Debug'">_DEBUG;</_DebugPreprocessorDefinition>
@@ -50,6 +57,7 @@
<AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions Condition="$(PlatformToolset) == 'ClangCL'">-Wno-deprecated-non-prototype -Wno-unused-label -Wno-pointer-sign -Wno-incompatible-pointer-types-discards-qualifiers -Wno-unused-function %(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions Condition="$(Configuration) != 'Debug' and $(PlatformToolset) == 'ClangCL'">-flto %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalOptions Condition="$(MSVCHasBrokenARM64Clamping) == 'true' and $(Platform) == 'ARM64'">-d2pattern-opt-disable:-932189325 %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<ClCompile Condition="$(Configuration) == 'Debug'">
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
@@ -79,6 +87,7 @@
<LinkTimeCodeGeneration Condition="$(SupportPGO) and $(Configuration) == 'PGUpdate'">PGUpdate</LinkTimeCodeGeneration>
<AdditionalDependencies>advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalOptions Condition="$(Configuration) != 'Debug'">/OPT:REF,NOICF %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalOptions Condition="$(MSVCHasBrokenARM64Clamping) == 'true' and $(Platform) == 'ARM64'">-d2:-pattern-opt-disable:-932189325 %(AdditionalOptions)</AdditionalOptions>
</Link>
<Lib>
<LinkTimeCodeGeneration Condition="$(Configuration) == 'Release'">true</LinkTimeCodeGeneration>