[compiler-rt] [compiler-rt][MSVC][CMake] Wrap Linker flags for ICX (PR #118496)

via llvm-commits llvm-commits at lists.llvm.org
Mon May 19 11:37:38 PDT 2025


BukeBeyond wrote:

> clang-cl shouldn't depend on any more MS tools than clang, it is just a different command line in the end. Anyway if you wish to work on getting llvm buildable with clang instead of clang-cl then I can offer to review patches, this is a topic I had the misfortune of looking at quite a lot :).

Cmake before 3.31, looks for and tests with ms mt.exe during setup, even when not used for LLVM, and now it finds llvm-mt.exe instead!  

I also renamed ms link.exe away, and clang-cl seems to be happy without it, using lld-link.  So -fuse-ld=lld-link seems unnecessary.

We may finally have ms independance building LLVM for windows!.  This is great, because we may build it on a linux machine with just the ms includes and the .lib files.  At least in theory, and without the ms marketing and lawyers involved.  :-)

Clang-cl behavior seems to be a lot more than the driver translating flags and setting different defaults.  Cmake and its scripts behave differently in this mode, and give different flags (like /D_WINDOWS), that Cmake Clang mode does not.  It also seems, Clang internals detect IsCLMode() and behave differently more than just the flags.  Replicating all these settings to find a clang match is time consuming, because even with successful builds that take a while, produced exes may crash.

It was nice to be able build LLVM upto 19 with Clang only.  I like the purity of it, vs all these variant front ends.  Relying on clang-cl perpetuates and accumulated archaic complexity going forward.  I wish official build tests included LLVM windows with Clang.  The problems introduced in 20 and 21 would have been caught early.

-DLLVM_HOST_TRIPLE=x86_64-pc-win32 is still working here, but it seems to be one of those abandoned settings, partially ming, partially msvc, which noone uses!  I do remember fixing another compiler-rt problem because of it.  I will correct it to x86_64-pc-windows-msvc.  Thank you for catching it.

Cmake is horrors as a language from the days before Ninja existed and Python took off.  We use a custom builder in Python and Ninja.  In an ideal world, LLVM would migrate to something more modern than Cmake.

https://github.com/llvm/llvm-project/pull/118496


More information about the llvm-commits mailing list