Tracking bug for supporting Clang builds on Windows.
Created attachment 349006 [details] WIP patch > perl Tools\Scripts\build-webkit --release --wincairo --ninja --cmakeargs="-DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_C_FLAGS=-m64 -DCMAKE_CXX_FLAGS=-m64"
Created attachment 349010 [details] WIP patch
I uploaded build logs showing all compilation errors. https://gist.github.com/fujii/ea5a60634e44f9c2a84cf3d3de95e2ad I'm using LLVM-8.0.0-r339319-win64.exe.
LLVM Project Blog: Clang is now used to build Chrome for Windows http://blog.llvm.org/2018/03/clang-is-now-used-to-build-chrome-for.html I believe this is the right direction WinCairo port should follow.
Created attachment 349627 [details] WIP patch Compiler macro definitions should be rethought. Current definitions: WTF_COMPILER_GCC_OR_CLANG 0 WTF_COMPILER_CLANG 1 WTF_COMPILER_MSVC 1 * It is weird WTF_COMPILER_GCC_OR_CLANG is off even though WTF_COMPILER_CLANG is on. * Should WTF_COMPILER_MSVC be on?
Here are the built-in macro definitions of Clang for Windows: _MSC_VER: 1914 __GNUC__ is not defined __clang__: 1 clang version 8.0.0 (trunk) Target: x86_64-pc-windows-msvc check program: https://gist.github.com/fujii/4547bda099b3568f46ee164674b1f60d
Using clang-cl to ship Windows builds - Google Group https://groups.google.com/forum/m/#!topic/mozilla.dev.platform/wwO48xXFx0A 1443590 - Use clang-cl for Windows builds we ship to users https://bugzilla.mozilla.org/show_bug.cgi?id=1443590 glandium.org » Blog Archive » Firefox is now built with clang LTO on all* platforms https://glandium.org/blog/?p=3888
Created attachment 350006 [details] WIP Patch not to define WTF_COMPILER_MSVC WTF_COMPILER_GCC_OR_CLANG 1 WTF_COMPILER_CLANG 1 WTF_COMPILER_MSVC 0
Created attachment 350007 [details] WIP Patch to define WTF_COMPILER_MSVC WTF_COMPILER_GCC_OR_CLANG 0 WTF_COMPILER_CLANG 1 WTF_COMPILER_MSVC 1
Comment on attachment 350006 [details] WIP Patch not to define WTF_COMPILER_MSVC It seems safer that Clang for Windows builds the same code path with MSVC in the transition phase.
WinCairo port can be built by Clang for Windows (with zillions of compilation warnings). https://trac.webkit.org/r236450 I took benchmarks: ARES-6: MSVC: 37.24ms Clang: 35.85ms (faster) Speedometer: MSVC: 59.38 (faster) Clang: 56.9 (I needed some trial for Clang because Clang built executable is unstable and did finish the benchmark.) Build Time: Ninja+MSVC: 30min (much faster) Ninja+Clang+link.exe: 50min
(In reply to Fujii Hironori from comment #11) > (I needed some trial for Clang because Clang built executable is unstable > and did finish the benchmark.) did not finish
(In reply to Fujii Hironori from comment #12) > (In reply to Fujii Hironori from comment #11) > > (I needed some trial for Clang because Clang built executable is unstable > > and did finish the benchmark.) > > did not finish I was wrong. MSVC builds are also unstable for the benchmark. This is not Clang builds issue.
(In reply to Fujii Hironori from comment #11) > Build Time: > > Ninja+MSVC: 30min (much faster) > Ninja+Clang+link.exe: 50min This slowness is caused by the zillions of compilation warnings. If I apply the part of Comment 8 patch to suppress the warning, the build time becomes comparable. > ==================================================================== > WebKit is now built (32m:13s). > ====================================================================
How to: Debug an Executable Not Part of a Visual Studio Solution | Microsoft Docs https://docs.microsoft.com/en-us/previous-versions/dotnet/netframework-3.0/0bxe8ytt(v=vs.85)
* Set up http://releases.llvm.org/download.html#7.0.0 LLVM-7.0.0-win64.exe Add path to clang-cl and ninja * Build set CC=clang-cl set CXX=clang-cl perl Tools\Scripts\build-webkit --release --wincairo --ninja * Remaining Tasks - Create a Docker image with clang-cl - Fix more compilation warnings
This is a blocker for Clang 9. Bug 201759 – [Win][Clang 9][MiniBrowser] comip.h(174,16): error: conflicting types for '_com_ptr_t' Keep you clang-cl 8.0.1 at the moment.
New blocker: Bug 204831 – [Win] lld-link: error: /manifestdependency: is not allowed in .drectve
Can we close this now?
There are still remaining compilation warnings. And, I'm maintaining internal WinCairo clang-cl Jenkins jobs, but there is no public bots using clang-cl. So, I'm using this ticket to let anyone know the current status. https://trac.webkit.org/wiki/BuildingCairoOnWindows#CompileWinCairowithClang When will WinCairo bots switch to Clang? The MSVC lambda bug is annoying. (Bug 209358)
LLVM 12.0.0 was released. I upgraded it for all internal Jenkins workers.
I upgraded the internal Jenkins workers to Clang 13.0.0.
The latest WinCairo can't compile with Clang. Bug 234696 – [Clang][Win] NotificationData.h(47,5): error: reference to 'UUID' is ambiguous