You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When experimenting with the MinGW-w64 based libs, there was a problem -
an undefined reference to function `_(_)chkstk`, emitted by LLVM for
stack probing (e.g., after an `alloca`) and not provided by MinGW-w64.
Initially, I used the symbol exported by ntdll.dll; normal user apps
aren't supposed to depend on that system DLL though, and it also led to
duplicate symbols for 32-bit code.
After some digging, I found that LLVM's builtins compiler-rt library
contains 2 implementations (1 MS-compatible, 1 for MinGW/Cygwin, both
with different names than the MS one). Our library didn't contain it
though, so I digged deeper.
I found the culprit in the builtins CMake script; when using an MSVC
toolchain, the builtins lib on Windows only contains very few C files
and none of the various ASM ones, because they use AT&T syntax.
So I decided to try building LLVM & compiler-rt with clang instead. That
works fine, but I had to fix the CMake script, as the ASM files are
excluded for MS-*compatible* toolchains, incl. clang. So I forked
compiler-rt to fix this and some more annoyances.
When compiling LLVM with clang-cl, the LLVM C++ compile flags include
some clang-specific ones, so building LDC with MSVC didn't work. While
that can be fixed at some point (stripping the clang-specific ones), I
decided to build LDC (and the C/ASM files in our default libs) with
clang too. That required some adaptations, as it started out with > 5k
warnings. ;)
So this commit switches to clang for compiling C/C++/ASM, but still uses
Microsoft's linker.
0 commit comments