[LLVMdev] Build LLVM as a DLL on Windows x86

Alan Garny agarny at hellix.com
Mon Nov 14 07:06:55 PST 2011


> >> GNU make is essential to msys build. I guess msysdtk would have it.
> >
> > I could find a copy of msysDTK at
> >
> http://sourceforge.net/projects/mingw/files/Other/Unsupported/MSYS/msy
> > sDTK/, but not only is the 'latest' version a very old version
> > (2003!), but once installed I couldn't find a copy of gmake in it.
> 
> msysDTK is *not* required (nor useful) for building LLVM. Plain MSYS used
> to include a `make' command.

Indeed... 

> > I wish the documentation on how to build a shared version of LLVM on
> > Windows was up-to-date (e.g. the need for Python is not mentioned) and
> > links to where to get prerequisites mentioned. I would be happy to
> > help with this, but I would first need to be able to build LLVM...
> > Otherwise, it would be nice, too, to have CMake to fully work with
> > LLVM... :)
> 
> The CMake build should work on Windows, with either VS or MinGW. LLVM
> DLL's on Windows are not supported by the CMake build because the LLVM
> source code lacks the symbol export directives, not because the CMake build
> is missing anything. 

There is at least that. I mean, there isn't the usual __declspec(dllimport) / __declspec(dllexport), but I believe I did come across (at least) another issue when I first tried to do a CMake build.

> The autoconf build exploits a feature of MinGW's
> binutils that auto-exports all symbols, like in Linux. It is a bit fragile. Building
> the big DLL would be also possible with the CMake build using the same
> technique, but AFAIR nobody cared too much.

That's too bad, I would have thought that it would have been useful to quite a few people...? Personally, I have already spent a lot of time trying to get a DLL for LLVM (too much time when I consider how quickly and easily I was able to get a shared library for LLVM on Linux and Mac OS X), but I find it difficult to tell what is wrong with my build environment.

Wouldn't it be possible for the LLVM team to release a shared library for LLVM? After all, there are already LLVM binaries for Mingw32/x86...

Alan 





More information about the llvm-dev mailing list