@@ -152,6 +152,7 @@ if ($PinnedBuild -eq "") {
152
152
" AMD64" {
153
153
$PinnedBuild = " https://download.swift.org/swift-5.10.1-release/windows10/swift-5.10.1-RELEASE/swift-5.10.1-RELEASE-windows10.exe"
154
154
$PinnedSHA256 = " 3027762138ACFA1BBE3050FF6613BBE754332E84C9EFA5C23984646009297286"
155
+ $PinnedVersion = " 5.10.1"
155
156
}
156
157
" ARM64" {
157
158
# TODO(hjyamauchi) once we have an arm64 release, fill in PinnedBuild and PinnedSHA256.
@@ -739,6 +740,13 @@ function Get-PinnedToolchainRuntime() {
739
740
return " $BinaryCache \toolchains\${PinnedToolchain} \PFiles64\Swift\runtime-development\usr\bin"
740
741
}
741
742
743
+ function Get-PinnedToolchainVersion () {
744
+ if (Test-Path variable:PinnedVersion) {
745
+ return $PinnedVersion
746
+ }
747
+ return " 5.10.1"
748
+ }
749
+
742
750
function TryAdd-KeyValue ([hashtable ]$Hashtable , [string ]$Key , [string ]$Value ) {
743
751
if (-not $Hashtable.Contains ($Key )) {
744
752
$Hashtable.Add ($Key , $Value )
@@ -1311,6 +1319,14 @@ function Build-Compilers() {
1311
1319
}
1312
1320
}
1313
1321
1322
+ # The STL in VS 17.10 requires Clang 17 or higher, but Swift toolchains prior to version 6 include older versions
1323
+ # of Clang. If bootstrapping with an older toolchain, we need to relax to relax this requirement with
1324
+ # ALLOW_COMPILER_AND_STL_VERSION_MISMATCH.
1325
+ $SwiftFlags = @ ();
1326
+ if ([System.Version ](Get-PinnedToolchainVersion ) -lt [System.Version ]" 6.0" ) {
1327
+ $SwiftFlags += @ (" -Xcc" , " -D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH" );
1328
+ }
1329
+
1314
1330
Build-CMakeProject `
1315
1331
- Src $SourceCache \llvm- project\llvm `
1316
1332
- Bin $CompilersBinaryCache `
@@ -1323,7 +1339,7 @@ function Build-Compilers() {
1323
1339
- Defines ($TestingDefines + @ {
1324
1340
CLANG_TABLEGEN = (Join-Path - Path $BuildTools - ChildPath " clang-tblgen.exe" );
1325
1341
CLANG_TIDY_CONFUSABLE_CHARS_GEN = (Join-Path - Path $BuildTools - ChildPath " clang-tidy-confusable-chars-gen.exe" );
1326
- CMAKE_Swift_FLAGS = @ ( " -Xcc " , " -D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH " ) ;
1342
+ CMAKE_Swift_FLAGS = $SwiftFlags ;
1327
1343
LLDB_PYTHON_EXE_RELATIVE_PATH = " python.exe" ;
1328
1344
LLDB_PYTHON_EXT_SUFFIX = " .pyd" ;
1329
1345
LLDB_PYTHON_RELATIVE_PATH = " lib/site-packages" ;
0 commit comments