[cfe-dev] [PATCH] plugin problem on Windows

Óscar Fuentes ofv at wanadoo.es
Fri Apr 1 17:19:06 PDT 2011


John Thompson <john.thompson.jtsoftware at gmail.com> writes:

> Yeah, I tried building a DLL version of Clang using:
>
> cmake -G "Visual Studio 9 2008" -D SHARED_LIBRARY=true .
> but Visual Studio 2008 would just hang.

It is -DBUILD_SHARED_LIBS=ON, not -D SHARED_LIBRARY=true.

Anyways that's pointless because Clang (and LLVM) lacks the necessary
directives (exports file or declspec(dllimport|dllexport) on
declarations.) MinGW can do up to some point without those, because
binutils supports marking everything as exported, but VC++ requires
explicit directives.

> I'm guessing it probably has to do with circular dependencies, which can be
> problematic on Windows with DLLs.  But even if it isn't, having Clang be a
> bunch of DLLs probably is not a good idea anyway.  Rather than try to figure
> it out, maybe the cmake build should be redone to directly build a single
> big DLL.  Since I don't know cmake (yet), I'll leave this for your comments.

Such "big DLL" would be useless because it exports nothing. Actually,
clang.dll is created by the CMake build for VC++, but only a few
functions are exported. See clang/tools/libclang/libclang.exports.

[snip]



More information about the cfe-dev mailing list