@@ -66,6 +66,9 @@ If no such Windows SDK is installed, it will be downloaded from nuget.
6666Include the ds2 remote debug server in the SDK.
6767This component is currently only supported in Android builds.
6868
69+ . PARAMETER IncludeSanitizers
70+ If set, include ASAN and UBSAN artifacts in the toolchain.
71+
6972. PARAMETER SkipBuild
7073If set, does not run the build phase.
7174
@@ -1764,6 +1767,21 @@ function Build-CURL([Platform]$Platform, $Arch) {
17641767 })
17651768}
17661769
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+
17671785function Build-Runtime ([Platform ]$Platform , $Arch ) {
17681786 $PlatformDefines = @ {}
17691787 if ($Platform -eq " Android" ) {
@@ -2756,6 +2774,11 @@ if (-not $SkipBuild) {
27562774
27572775 Invoke-BuildStep Build-CMark $HostArch
27582776 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+ }
27592782}
27602783
27612784if ($Clean ) {
0 commit comments