[LLVMdev] Creating and building LLVM projects with Eclipse CDT on Windows?

Trip Volpe mraccident at gmail.com
Sun Aug 1 15:22:51 PDT 2010


I just downloaded LLVM a couple days ago -- I got everything built and
installed quite easily using CMake to generate build files for Eclipse CDT +
MinGW. That much worked like a charm -- but I've spent most of the
intervening time trying to get a simple project set up.  :-P

My goal is to create a project consisting of two main parts:
   - A backend for WDC 65816
   - A frontend including a simple programming language and tools for
managing generated code

It's my understanding that it's necessary to develop the backend as part of
the LLVM source tree. The frontend, though, I would like to maintain as a
separate project, with as little coupling as possible to the rest of the
LLVM source and build configuration.

The problem, though, is that I'm having a heck of a time figuring out how to
do this. I started with the "Creating an LLVM Project" documentation:

        http://llvm.org/docs/Projects.html

Which advises copying projects/sample to a location of your choosing and
modifying it with autoconf. That seems to be a tricky proposition on
Windows, though, especially if you want to use Eclipse CDT to build and
maintain your project. For one thing, since I built using CMake instead of
using the configure script, some files (like Makefile.config in
LLVM_OBJ_ROOT) do not exist.

Eventually I decided to just try compiling the source for Chapter 3 of the
Kaleidoscope tutorial directly with GCC. Here was the command line I used:

        g++ toy.cpp `llvm-config --cxxflags` `llvm-config --libs core`
`llvm-config --ldflags`

This compiled just fine, with no warnings; but when I tried to run the
program, as soon as I entered an expression for Kaleidoscope to compile, I
got an assert failure like this:

        define double @0()Assertion failed: errorcode == 0, file
c:/llvm-2.7/lib/System/RWMutex.cpp, line 87

When I built the examples using Eclipse CDT (via the CMake-generated project
files), the Kaleidoscope examples all worked perfectly.

So what's the scoop? Is there any way I can conveniently create a project
with Eclipse CDT that uses LLVM? What do I actually need to include and
link? Any advice or guidance would be greatly appreciated.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100801/f3c7d187/attachment.html>


More information about the llvm-dev mailing list