[LLVMdev] Building LLVM as a shared library using Visual C++ 2010?

Justin Holewinski justin.holewinski at gmail.com
Sun Apr 8 09:22:45 PDT 2012


On Sat, Apr 7, 2012 at 11:58 PM, Alan Garny <agarny at hellix.com> wrote:

> Óscar Fuentes <ofv at wanadoo.es> writes:
> > Michael Spencer <bigcheesegs at gmail.com> writes:
> > > The problem is that MSVC++ requires sprinkling
> > > __declspec(dllexport/dllimport) all over the code, and we really don't
> > > want to deal with maintaining that, as most developers have little to
> > > no experience with Windows DLLs.
> >
> > BTW, you don't put __declspec(dllexport) / __declspec(dllimport) on the
> > code, but macros that alternatively expand to those declspecs depending
> > on if the library is being compiled or referenced.
>
> I have just realised that I directly replied to Michael rather than the
> mailing list (!!), but it was to say the same as Óscar with regards to the
> use of a macro. In fact, I am thinking of taking this approach for the
> classes that I need in my project. Still, it will mean 'hacking' the code
> myself, and I really wish I didn't have to go that route, but... what other
> choice do I have if I want to use MSVC?...
>

Until this is resolved, why not statically link?


>
> > Yeah, I tried that too. AFAIK the 2^16 symbol limitation on the VS
> > linker applies to .def files in general, not just when exporting by
> > ordinal. One problem I found was to differentiate the relevant stuff
> > from the junk while deciding what to put on the .def file. I find it
> > hard to believe that any LLVM library exports 65000 symbols. Maybe
> > fine-tuning the symbol filtering the .def files could be used regardless
> > the 2^16 limit, altough generating those .def files would never be as
> > reliable as putting the declarations on the source code, IMO.
>
> FWIW, using MinGW, I end up with a DLL with 13,320 symbols. Still, I agree
> with Óscar, this wouldn't be as reliable as using a macro (not to mention
> that maintenance could be a bit of a nightmare).
>
> Alan
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>



-- 

Thanks,

Justin Holewinski
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120408/24464b0b/attachment.html>


More information about the llvm-dev mailing list