[cfe-dev] Distributing libclang-cpp.dll for Windows in the pre-built downloads

Martin Storsjö via cfe-dev cfe-dev at lists.llvm.org
Wed Mar 18 14:35:05 PDT 2020


On Wed, 18 Mar 2020, Michael Kruse via cfe-dev wrote:

> Am Mi., 18. März 2020 um 12:51 Uhr schrieb Stephen Crane <sjc at immunant.com>:
>> On Wed, Mar 18, 2020 at 9:23 AM Michael Kruse <llvm at meinersbur.de> wrote:
>> > Windows DLLs have a limit of 2^16 exported symbols, that LLVM
>> > unfortunately exceeds.
>>
>> Would the individual libclang* libraries (e.g. libclangAST,
>> libclangParse, etc.) exceed this limit? I'll do some experimental
>> builds and see what I can determine.
>
> BUILD_SHARED_LIBS is also not supported on Windows, but I don't know
> whether for the same reason.

It's not supported when building with MSVC (or with Clang in MSVC mode), 
as it requires dllexport attributes on all symbols to be visible in the 
external interface of the DLL (or a def file listing all the exported 
symbols), and the interfaces of all the internal libraries aren't 
decorated with such attributes.

If building with a MinGW toolchain (either GCC/binutils based, or 
Clang/lld based), it can export all symbols if none are marked 
specifically for export with dllexport attributes - and BUILD_SHARED_LIBS 
should work in this configuration (at least builds with it enabled 
succeeded last I tested maybe 7 weeks ago).

// Martin


More information about the cfe-dev mailing list