Skip to content

Commit 0c62d1f

Browse files
authored
Merge pull request #79853 from hjyamauchi/oom2
Limit the Swift link job pool size to 4
2 parents 2df3211 + 7997dd3 commit 0c62d1f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

utils/build.ps1

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1687,6 +1687,12 @@ function Build-Compilers() {
16871687
$SwiftFlags += @("-Xcc", "-D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH");
16881688
}
16891689

1690+
# Limit the number of parallel links to avoid OOM when debug info is enabled
1691+
$DebugOptions = @{}
1692+
if ($DebugInfo) {
1693+
$DebugOptions = @{ SWIFT_PARALLEL_LINK_JOBS = "4"; }
1694+
}
1695+
16901696
New-Item -ItemType SymbolicLink -Path "$BinaryCache\$($HostArch.LLVMTarget)\compilers" -Target "$BinaryCache\5" -ErrorAction Ignore
16911697
Build-CMakeProject `
16921698
-Src $SourceCache\llvm-project\llvm `
@@ -1737,7 +1743,7 @@ function Build-Compilers() {
17371743
SWIFT_STDLIB_ASSERTIONS = "NO";
17381744
SWIFTSYNTAX_ENABLE_ASSERTIONS = "NO";
17391745
"cmark-gfm_DIR" = "$($Arch.ToolchainInstallRoot)\usr\lib\cmake";
1740-
})
1746+
} + $DebugOptions)
17411747
}
17421748

17431749
$Settings = @{

0 commit comments

Comments
 (0)