ALRIGHT, so...
I've taken this opportunity to clean up my system somewhat. I've upgraded (deleted and installed the latest version of):
- TDM-GCC-w64 (5.1.0-2)
- CMake (3.3.0)
- ICU (55.1)
- Boost (1.58.0)
(I swear I'm going to write a series of articles about how to do all this...)
and I am right now ATM compiling LLVM. So far, so good (I'm at 10%)...
The magic trick is that the libraries are created using
ar(3), so "-m32" is an inappropriate tag to pass to it. You need to provide an appropriate "--target", which in this case is "pe-i386".
To set it up, you need to follow several important setup steps.
First, I have downloaded LLVM's source and put it in a convenient directory.
Next, you need the following in your path:
- CMake
- Python27 (
not 3.x)
- TDM-GCC-w64
C:\Users\Michael\Programming\LLVM> path C:\PROGRA~2\CMake\bin;C:\Python27;C:\TCM-GCC-64\bin;%PATH% |
(Note that PROGRA~2 is the "Program Files (x86)" folder.)
Then you need to extract LLVM's source and configure.
C:\Users\Michael\Programming\LLVM> 7z x llvm-3.6.2.src.tar.xz
C:\Users\Michael\Programming\LLVM> 7z x llvm-3.6.2.src.tar
C:\Users\Michael\Programming\LLVM> md llvm-build32
C:\Users\Michael\Programming\LLVM> cd llvm-build32
C:\Users\Michael\Programming\LLVM\llvm-build32> cmake-gui ..\llvm-3.6.2.src
|
Once you have CMake's GUI up, press the "Configure" button and select the second option down to choose "gcc" and "g++" as your compilers. Once that's done, wait for the first configure pass to finish.
Click the "Advanced" checkbox.
Modify the following, case-sensitive:
1 2 3 4 5 6 7 8 9
|
CMAKE_BUILD_TYPE
CMAKE_CXX_FLAGS
CMAKE_C_FLAGS
CMAKE_EXE_LINKER_FLAGS
CMAKE_EXE_LINKER_FLAGS_RELEASE
CMAKE_SHARED_LINKER_FLAGS
CMAKE_SHARED_LINKER_FLAGS_RELEASE
CMAKE_STATIC_LINKER_FLAGS
CMAKE_STATIC_LINKER_FLAGS_RELEASE
|
Release
-m32
-m32
--target=pe-i386
--target=pe-i386
--target=pe-i386
--target=pe-i386
--target=pe-i386
--target=pe-i386 |
I've also enabled the following boolean values by putting a little check mark in the box:
1 2
|
LLVM_ENABLE_EH
LLVM_ENABLE_RTTI
|
A couple of other things you may wish to have checked:
1 2
|
LLVM_ENABLE_THREADS
LLVM_ENABLE_ZLIB
|
Click the "Configure" button again and wait for it to finish.
Then click the "Generate" button.
After that, close CMake-GUI and at the command line (which you should still have open!) type everyone's favorite invocation:
C:\Users\Michael\Programming\LLVM\llvm-build32> mingw32-make |
Then sit back and cross your fingers. I'm at 32% now... I'll post back on the success (or failure) of the current build.
[update]
[ 89%] Linking CXX executable ..\..\bin\opt.exe
../../lib/libLLVMSupport.a(DynamicLibrary.cpp.obj):DynamicLibrary.cpp:(.text+0xb40): undefined reference to `__alloca'
../../lib/libLLVMSupport.a(DynamicLibrary.cpp.obj):DynamicLibrary.cpp:(.text+0xb60): undefined reference to `___chkstk'
../../lib/libLLVMSupport.a(DynamicLibrary.cpp.obj):DynamicLibrary.cpp:(.text+0xb84): undefined reference to `___chkstk_ms'
|
Fooey.