[LLVMdev] LLVM on MinGW

Alain Frisch alain.frisch at lexifi.com
Wed Nov 28 07:57:50 PST 2007


I'm trying to use LLVM on Windows, using the MinGW toolchain that comes
with Cygwin (gcc -mno-cygwin, not the standalone msys package). Has
anyone successfully built LLVM from sources with this toolchain?

The ./configure scripts automatically detects a Cygwin environment. I've
spent some time trying to let it know that it should compile for MinGW.
FWIW, here's what I've done:

* CFLAGS=-mno-cygwin CXXFLAGS=-mno-cygwin ./configure ...
--build=i686-pc-mingw32 --disable-threads --disable-ltdl-install

* Put CFLAGS=-mno-cygwin and CXXFLAGS=-mno-cygwin in Makefile.config
(I could not get the configure script to do it on its own).

* In include/llvm/Config/config.h, disable HAVE_ARGZ_H and HAVE_LIBDL.

* Change the Makefile that calls tblgen.exe to pass relative filenames
to this tool (being compiled as a Win32 application, it cannot deal
with Cygwin absolute filename like /home/...).

Still, I get errors. Since I guess I'm not the first one trying to use
the Cygwin's MinGW compiler, I'd prefer to ask for help before adding
more hacks to the build system.

Actually, I think I could live with a binary distribution compiled for
MinGW. The binary package on the LLVM site (for LLVM 2.1) only contains
the programs, not the compiled libraries. Can I find those libraries
somewhere else?

Also, at some point, I'll be interested in compiling LLVM with the
Microsoft C compiler (with the command line tools, without Visual
Studio). Has anyone done that before?



More information about the llvm-dev mailing list