> From: Stefan Weil [mailto:s...@weilnetz.de] > Am 09.02.2015 um 09:07 schrieb Pavel Dovgaluk: > >> From: Stefan Weil [mailto:s...@weilnetz.de] > >> Am 09.02.2015 um 08:55 schrieb Pavel Dovgalyuk: > >>> On w64, setjmp is implemented by _setjmp which needs a second parameter. > >>> This parameter should be NULL to allow using longjump from generated code. > >>> This patch replaces all usages of setjmp.h with new header files which > >>> replaces setjmp with _setjmp function on win64 platform. > >>> > >>> Signed-off-by: Pavel Dovgalyuk <pavel.dovga...@ispras.ru> > >> Please have a look at include/sysemu/os-win32.h. I think that your patch > >> is not needed because the current code already uses _setjmp. > > Right, but some of the files (e.g. include/qom/cpu.h) include setjmp.h > > directly. > > Then we have the following for compiling cpu-exec.c: > > > > cpu-exec.c: > > ... > > os-win32.h > > ... > > setjmp.h > > ... > > > > In this situation cpu-exec will call incorrect setjmp function. > > > > Pavel Dovgalyuk > > > It won't call the wrong setjmp function, at least not in my tests. > cpu-exec.c gets the setjmp declaration from os-win32.h. Without it, QEMU > would be unusable because it would crash very soon during the emulation. > > Do you see problems caused by a wrong setjmp with latest QEMU? If yes: > which build environment do you use (host, compiler, version of MinGW*)?
Yes, I've got the problems. To verify the correctness of the call I disassembled cpu-exec.o and found that setjmp is called with second parameter not equal to zero. I'm using Cygwin environment and packages from here: http://win-builds.org/ My host OS is Windows 7x64 and the compiler is x86_64-w64-mingw32-gcc.exe (GCC) 4.8.3 Pavel Dovgalyuk