Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[windows][toolchain] Enable builtins and sanitizers #77770

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

weliveindetail
Copy link
Contributor

Profile and builtin libraries from compiler-rt are static and do not require a link step. We can enable them in our CMake caches and we can build and install them in the unified LLVM build step. Sanitizers contain dynamic libraries. We need the target-specific Visual Studio shell to perform the link step. This patch adds extra build steps in build.ps1 that reconfigure, build and install the target-specific build-trees in the LLVM runtimes directory through their respective Visual Studio shells.

@@ -66,6 +66,9 @@ If no such Windows SDK is installed, it will be downloaded from nuget.
Include the ds2 remote debug server in the SDK.
This component is currently only supported in Android builds.

.PARAMETER IncludeSanitizers
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the motivation for the new option? I think that if we are able to build the sanitizers, we should do that unconditionally. This has been a missing piece in our toolchain distribution, but it was left out due to the inability to get it to work rather than being intentionally left out.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes agree in principle, but it will also add extra requirements for the default build. For example, the Visual Studio cross libs for Arm64 must be installed (which I had to do explicitly). We need to check if CI is prepared for that and maybe add a note in the quick-start docs right? If we keep it disabled by default, that wouldn't be necessary (now). I'd keep the option for a transition period and see. However, if you want it done now, no problem.

if ($IncludeSanitizers) {
$InstallTo = "$($HostArch.ToolchainInstallRoot)\usr"
Invoke-BuildStep Build-Sanitizers Windows $ArchX64 $InstallTo
Invoke-BuildStep Build-Sanitizers Windows $ArchARM64 $InstallTo
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should do this for all the SDKs:

for ($Arch in $WindowsSDKArch) {
  Invoke-BuildStep Build-Sanitizers Windows $Arch $($HostArch.ToolchainInstallRoot)\usr"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants