Page MenuHomePhabricator

Link LLVM dynamically on Windows, deploy Universal CRT dlls.
ClosedPublic

Authored by vadimcn on Jan 25 2017, 1:41 PM.

Details

Summary

This addresses LLDB bug 31699, which was caused by LLVM using static linking on Windows.

In order to make sure that LLVM continues to work on machines that do not have the Universal CRT yet, we'll need to ship a copy of UCRT in the Windows installation package. Fortunately, CMake 3.6+ already supports app-local deployment of UCRT dlls, we just need to turn this on.

Diff Detail

Repository
rL LLVM

Event Timeline

vadimcn created this revision.Jan 25 2017, 1:41 PM
rnk accepted this revision.Jan 25 2017, 4:09 PM

lgtm

This revision is now accepted and ready to land.Jan 25 2017, 4:09 PM
hans edited edge metadata.Jan 25 2017, 5:20 PM

Thanks! This sounds good.

Could we make CMAKE_INSTALL_UCRT_LIBRARIES the default when building for Windows? Would there be any downside to that?

Could we make CMAKE_INSTALL_UCRT_LIBRARIES the default when building for Windows? Would there be any downside to that?

I don't think it's necessary. People building locally will already UCRT installed since they have MSVC. It's only the "official" builds that might get installed on a bare machine that might need those dlls.
Besides, CMake will mark WINDOWS_KITS_REDIST_DIR path with an error if builder's machine doesn't have a recent version of Windows 10 SDK installed (UCRT was not redistributable until late 2015). This might be confusing.

hans accepted this revision.Jan 26 2017, 2:00 PM

lgtm

This revision was automatically updated to reflect the committed changes.