Mingw32 4.6.3 build crashes

The toolchain I downloaded and am using is from here:

It builds for a 32-bit target and this toolchain is built to use DW2 dwarf unwinding instead of setjump longjump for exception handling.

I downloaded blender’s svn with TortoiseSVN and proceed to build it with cmake. I had to make a couple of changes to the blender source for it to be able to compile without errors.


The first change: add_definitions(-D__MINGW64__)

that was added keep extern libmv from redefining sincos in its numerical.h file. This function is already present in mingw’s math.h

The second change in GHOST_SystemWin32.cpp is because mingw’s definition does agree now, at least the headers supplied by ruben’s toolchain does. So I had to comment out that workaround so compile can proceed.

The final change in BLI_winstuff.h is because mingw-w64 uses a different macro guard than mingw. For this I just added both of them in there. I believe this issue appeared it in the pass before but it wasn’t clear how best to fix it – the suggested solution at the time was to just pass -D_SSIZE_T_DEFINED when compiling that file in question.

The external library dependencies used during the linking step is whatever is provided in /lib/mingw32.

I’m able to build blender but the compiled executable would just crash during startup. Blender gets as far as creating the window but none of the GUI elements are draw before the crash happens. So no menus, no viewport, just a blank gray background window with borders.

I have a backtrace of the crash in gdb if anyone’s interested. Any idea why this is happening? Please let me know if I need to provide any other detail.