[LLVMdev] Getting started with LLVM on Win32 from non-C/C++ language

Óscar Fuentes ofv at wanadoo.es
Wed Mar 31 12:33:07 PDT 2010


Barry Kelly <bkelly.ie at gmail.com> writes:

[snip]

> It was available. I live in Cygwin; MSYS is a poor alternative. Also
> generally speaking, open source projects targeting a POSIXy environment
> have a higher probability of working first time with Cygwin, so it
> serves well for investigation (e.g. no distribution in the GPL sense).

LLVM is not a POSIX-centric project. Maintainers are happy to apply
patches that improve its usability on other platforms, specially
Windows. If right now LLVM lacks something on Windows, is due to the
fact that most developers work on Unix. For the specific case of DLLs,
they are available on Linux and Mac OS just because they are so easy to
create there. Maintaining a VS-compatible DLL build would be a
nightmare, given the volatility of the LLVM C++ API and the heavy
inter-dependencies among its libraries.

[snip]

> I was able to build a DLL by roughly:
>
>   cd Release/lib
>   for f in *.a; ar x $f; done
>   rm PluginMain.o
>   g++ -shared --export-all-symbols -o LLVM.dll *.o

Yes, this works. But what I've done is to isolate my backend on its own
DLL, which statically links LLVM. This approach has the advantage of
working everywhere. Another option for you is to add the declspec's to
the C bindings and create a dll that just exposes that interface. Please
submit a patch if you follow this route.

[snip]

> If Visual Studio 2008 were supported, I'd consider using it. The current
> solution and project files work less than optimally when auto-upgraded
> by VS2008.

LLVM is fine on VS 2008. The hand-made project files were removed after
the 2.6 release. Use cmake for generating the project files:

http://www.llvm.org/docs/CMake.html

[snip]




More information about the llvm-dev mailing list