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

Michael Spencer bigcheesegs at gmail.com
Sun Apr 3 16:37:03 PDT 2011


On Fri, Apr 1, 2011 at 8:19 PM, Óscar Fuentes <ofv at wanadoo.es> wrote:
> 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.

It's actually possible to do this without explicit directives by
making use of link -dump to dump the symbol table to an export file
and relink all the static libs into a giant DLL that exports
everything. At one point I was working on this, but got pulled into
other things.

- Michael Spencer

>> 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]
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>




More information about the cfe-dev mailing list