@@ -66,6 +66,9 @@ If no such Windows SDK is installed, it will be downloaded from nuget.
66
66
Include the ds2 remote debug server in the SDK.
67
67
This component is currently only supported in Android builds.
68
68
69
+ . PARAMETER IncludeSanitizers
70
+ If set, include ASAN and UBSAN artifacts in the toolchain.
71
+
69
72
. PARAMETER SkipBuild
70
73
If set, does not run the build phase.
71
74
@@ -1764,6 +1767,21 @@ function Build-CURL([Platform]$Platform, $Arch) {
1764
1767
})
1765
1768
}
1766
1769
1770
+ function Build-Sanitizers ([Platform ]$Platform , $Arch , $InstallTo ) {
1771
+ Isolate- EnvVars {
1772
+ # Use configured compilers
1773
+ Build-CMakeProject `
1774
+ - Src $SourceCache \llvm- project\runtimes `
1775
+ - Bin " $ ( Get-HostProjectBinaryCache Compilers) \runtimes\runtimes-$ ( $Arch.LLVMTarget ) -bins" `
1776
+ - InstallTo $InstallTo `
1777
+ - Arch $Arch `
1778
+ - Platform $Platform `
1779
+ - Defines (@ {
1780
+ COMPILER_RT_BUILD_SANITIZERS = " YES"
1781
+ })
1782
+ }
1783
+ }
1784
+
1767
1785
function Build-Runtime ([Platform ]$Platform , $Arch ) {
1768
1786
$PlatformDefines = @ {}
1769
1787
if ($Platform -eq " Android" ) {
@@ -2756,6 +2774,11 @@ if (-not $SkipBuild) {
2756
2774
2757
2775
Invoke-BuildStep Build-CMark $HostArch
2758
2776
Invoke-BuildStep Build-Compilers $HostArch
2777
+ if ($IncludeSanitizers ) {
2778
+ $InstallTo = " $ ( $HostArch.ToolchainInstallRoot ) \usr"
2779
+ Invoke-BuildStep Build-Sanitizers Windows $ArchX64 $InstallTo
2780
+ Invoke-BuildStep Build-Sanitizers Windows $ArchARM64 $InstallTo
2781
+ }
2759
2782
}
2760
2783
2761
2784
if ($Clean ) {
0 commit comments