LLVM+Clang 3.2rc2 MinGW binaries' libstdc++ requirement

I attempted to run the 3.2rc2 experimental LLVM+Clang package for
Mingw32/x86 [1], and ran into difficulty finding a suitable version of
MinGW to run it with. Part of the problem is that Windows G++ changed
its C++ ABI in 4.7 [2].

LLVM+Clang 3.2rc2 Mingw32/x86 binaries were built on Windows 7
machine with fresh Minwg32 installation. Minwg32 installation
was performed using latest automated installer and default settings
"mingw-get-inst-20120426.exe" [4]

Through experimentation, I've determined that the LLVM binaries do not
run using the libraries shipped with TDM-GCC 4.5 because there is a
missing symbol. They segfault with TDM-GCC 4.7, which I assume is
caused by the ABI change. (Through inspection of the assembly, it
appears that Clang was not built with 4.7 -- the code doesn't use
thiscall.) TDM-GCC 4.6 is just right, though, so perhaps that should be
noted somewhere. Perhaps the filename should include something like
"mingw32-46" in it.

TDM-GCC 4.6 matches g++ version installed with
"mingw-get-inst-20120426.exe" [4]
"g++ --version" reports "g++.exe (GCC) 4.6.2"

I had to download these three files to run LLVM binaries:

TDM-GCC Compiler - Browse Files at SourceForge.net


The openmp package is needed for pthreadGC2.dll. It's also important to
use DW2. TDM-GCC also provides SJLJ libraries that do not work with Clang.

Another solution would be to rebuild entire LLVM+Clang package using
your g++ 4.7 based Mingw32 dev environment.

I am wondering whether the Clang project will attempt to match MinGW's
new ABI.[3] AIUI, the 4.7 breakage is not intended to be a one-time
event. A stable ABI would be a nice thing.


[2] MinGW 4.7 enabled the thiscall convention, which changes the
register/stack usage for all member function calls. See

[3] http://llvm.org/bugs/show_bug.cgi?id=12684


[4] MinGW - Minimalist GNU for Windows - Browse Files at SourceForge.net