If at first you don't succeed...
I can now build LLVM 2.6 using MinGW GCC 4.4.0, and it isn't too hard once you know how. I still cannot run the DejaGNU tests, though at first sight that shouldn't be that hard - most likely I'll need the CygWin packages for dejagnu and expect. I also haven't built llvm-gcc yet.
Before the step-by-step, here are the three problems...
Problem 1...
Attempting to build llvm using the standard build instructions fails with the
following compiler error in Signals.cpp (win32/Program.inc)
llvm[1]: Compiling Signals.cpp for Release build
In file included from Signals.cpp:33:
Win32/Signals.inc: In function 'LONG LLVMUnhandledExceptionFilter(_EXCEPTION_POINTERS*)':
Win32/Signals.inc:234: error: exception handling disabled, use -fexceptions to enable
The workaround is to use "make -k -fexceptions" - answer found in the pure language documentation.
Problem 2...
Even with the first workaround, the following compiler error occurs...
ExternalFunctions.cpp: In function 'bool ffiInvoke(void (*)(), llvm::Function*, const std::vector<llvm::GenericValue, std::allocator<llvm::GenericValue> >&, const llvm::TargetData*, llvm::GenericValue&)':
ExternalFunctions.cpp:207: error: 'alloca' was not declared in this scope
It seems that an option is being specified which disables the "alloca" built-in.
The workaround is to edit the problem file
C:\llvm-2.6\lib\ExecutionEngine\Interpreter\ExternalFunctions.cpp
Just after the "#include <string>" line, insert...
#define alloca __builtin_alloca
Problem 3...
Even with the compilation errors fixed, the example programs won't run. The run-time errors are...
Assertion failed: errorcode == 0, file RWMutex.cpp, line 87
This relates to the use of the pthreads library,
answered 2010-01-30T19:46:57.883