[llvm-dev] Windows vs Mac/Linux distribution discrepancy

Dimitry Andric via llvm-dev llvm-dev at lists.llvm.org
Thu Jul 23 11:32:42 PDT 2020


On 23 Jul 2020, at 20:00, Alex Denisov via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> 
> I’m trying to port some code built on top of LLVM/Clang to Windows,
> however I just discovered that the precompiled versions from releases.llvm.org
> are missing all the libLLVM* and libclang* dlls.

This is controlled by the following CMake settings (see https://llvm.org/docs/CMake.html#llvm-specific-variables):

LLVM_BUILD_LLVM_DYLIB:BOOL

If enabled, the target for building the libLLVM shared library is added. This library contains all of LLVM’s components in a single shared library. Defaults to OFF. This cannot be used in conjunction with BUILD_SHARED_LIBS. Tools will only be linked to the libLLVM shared library if LLVM_LINK_LLVM_DYLIB is also ON. The components in the library can be customised by setting LLVM_DYLIB_COMPONENTS to a list of the desired components. This option is not available on Windows.

LLVM_LINK_LLVM_DYLIB:BOOL

If enabled, tools will be linked with the libLLVM shared library. Defaults to OFF. Setting LLVM_LINK_LLVM_DYLIB to ON also sets LLVM_BUILD_LLVM_DYLIB to ON. This option is not available on Windows.

E.g. these options are off by default (probably because it saves build time, but I'm just guessing here), and are not available on Windows (for reasons unknown to me).


> Also, some tools (e.g. opt) are missing on Windows as well.

I don't know about that, but maybe Hans Wennborg has more information.


> I’m curious whether it’s a technical limitation (i.e. certain things don’t work on Windows),
> or something else?
> 
> For the others out there building cross-platform tools based on LLVM:
> how do you deal with this issue? Am I supposed to build LLVM myself there?

Either you can link against distro-provided LLVM dynamic libraries, like those shipped by Debian and Ubuntu, or you can link against the static libraries in the release tarballs.

But obviously, you could always build them yourself, and ship them with your tools. This would give you the most flexibility.

-Dimitry

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 223 bytes
Desc: Message signed with OpenPGP
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200723/64c1364c/attachment.sig>


More information about the llvm-dev mailing list