Context
I am developing a cross-platform project that depends on a highly performance sensitive open-source library. This library supports a number of different compilers, but the most performant version is compiled via clang
, due to inline assembly which isn't supported by the MSVC compiler (cl
). This has highlighted to me that clang is capable of compiling code on Windows, and emitting highly performant dll libraries, but that there is also a deficit in my understanding of the interoperability of the MSVC toolchain and the clang ecosystem.
Question
To what extent is code compiled with clang, interoperable with the MSVC toolchain?
- Are binaries emitted by clang ABI compatible with binaries emitted by cl, up to and including the latest language standard?
- Specifically, can a static library (.a) compiled with clang be consumed by the MSVC toolchain? (ie. symbol definitions are not dllexport/imported).
- Can clang emit 32-bit binaries?
- I recognise clang-cl is simply a driver for clang, but are there any practical limitations or other reasons not to favour clang-cl over cl for new projects?