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

Keith Sheppard keithshep at gmail.com
Fri Apr 13 10:18:08 PDT 2012


What about only exporting the C interface? I think this pretty much
covers all the people like me who want to call the LLVM API from a VM
or interpreter (python, .NET, Java bindings...). Am I right in
thinking this is the biggest use case for building LLVM as a DLL?

-Keith

On Sat, Apr 7, 2012 at 8:26 PM, Michael Spencer <bigcheesegs at gmail.com> wrote:
> On Fri, Apr 6, 2012 at 6:15 PM, Alan Garny <agarny at hellix.com> wrote:
>> Hi,
>>
>> From what I have seen on this mailing list and elsewhere, it would seem that
>> it isn’t possible to build LLVM as a shared library using Visual C++. Still,
>> I would imagine that quite a few people are or would be interested in it,
>> so… is there any plan to support this any time soon? This, unless it’s
>> already supported in some way or another which I am not aware of…? I have
>> been able to build LLVM as a shared library using Autotools and GCC (through
>> MinGW) on Windows (as well as on Linux and Mac OS X), so it would really be
>> a shame if the same couldn’t be done using Visual C++…
>>
>> Cheers, Alan.
>
> 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.
>
> There may be a work around for this, which I partially implemented in
> the past. You have a script which automatically generates a .def file
> for all the public functions in all the object files. My attempt did
> not work because I tried to export by ordinal, but that only supports
> up to 2^16 symbols. It may work without exporting by ordinal, but I
> never tried it.
>
> - Michael Spencer
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev



-- 
keithsheppard.name




More information about the llvm-dev mailing list