I have successfully built the Cog VM for debugging (make debug) using the standalone (without Cygwin) MinGW/MSYS environment.
This has been for an athlon-xp using revision 3164.
I have attached a patch with the modifications I have had to make to the makefiles just for reference (MinGWTuning.patch).
However, the VM fails when loading the image, prompting a system error.
I have used the GNU debugger (gdb) to isolate the problematic function call ( which apparently contains an instruction not supported by the hardware).
[...]
(gdb) updateMicrosecondClock () at ../../platforms/win32/vm/sqWin32Heartbeat.c:202 202 if (!asserta(newUtcMicrosecondClock >= utcMicrosecondClock)) { (gdb) 206 newLocalMicrosecondClock = newUtcMicrosecondClock + vmGMTOffset; (gdb) 208 set64(utcMicrosecondClock,newUtcMicrosecondClock); (gdb)
Program received signal SIGILL, Illegal instruction. 0x00474dee in updateMicrosecondClock () at ../../platforms/win32/vm/sqWin32Heartbeat.c:208 208 set64(utcMicrosecondClock,newUtcMicrosecondClock);
[...]
I have attached the log of the build of the VM for debugging (LOGD) and the debugging session (logGDB).
On the other hand, using explicitly the -mno-sse2 or -march=native switches makes the build fail around the same piece of code:
[...]
../../platforms/win32/vm/sqWin32Heartbeat.c: In function
'updateMicrosecondClock':../../platforms/win32/vm/sqWin32Heartbeat.c:208:2: error: can't find a register in class
'GENERAL_REGS' while reloading 'asm'../../platforms/win32/vm/sqWin32Heartbeat.c:209:2: error: can't find a register in class
'GENERAL_REGS' while reloading 'asm'../../platforms/win32/vm/sqWin32Heartbeat.c:208:2: error: 'asm' operand has impossible
constraints../../platforms/win32/vm/sqWin32Heartbeat.c:209:2: error: 'asm' operand has impossible constraintsmake[1]: ***
[builddbg/vm/sqWin32Heartbeat.o] Error 1 make[1]: Leaving directory `/c/Documents and Settings/Usuario/Mis documentos/cog/build.win32x86/squeak.cog.v3' make: *** [debug] Error 2
[...]
Greetings, Osl
vm-dev@lists.squeakfoundation.org