First i tried the mingw-w64 package i686-6.4.0-release-win32-sjlj-rt_v5-rev0.7z but failed misarably building the gdtoa target. So i've used the tdm-gcc 5.1 included with CodeBlocks. This is a mingw32 Debug build, there's a 64 bit version of tdm-gcc but no idea about that.
My changes for review are @ the g3.3mgw branch, someone could cherry-pick from there or i could do a PR. This is not the latest master but 3.3.2, i couldn't resist.
https://github.com/drfrag666/gzdoom/commits/g3.3mgw
There are a few problems: the truecolor software renderer crashes inmediately when r_multithreaded is set to true as soon as you start a new game. This is for the SSE2 version, the non SSE2 version works.
@dpJudas: is this to be expected? I mean, does this happen on any other platform? AFAIK this is a win32 native build not one running on a POSIX emulation layer (there's another mingw version for that). I've attached debugging info below.
Then the crash on exit in vmframe.cpp is still there, i'll update that thread now. That was a nasty crash and killed DirectX on win98, i don't think this version will work there. The non SSE2 version would crash now on old CPUs due to some later changes.
To set up the environment download CodeBlocks 17 from: http://sourceforge.net/projects/codeblo ... -setup.exe
Run the installer as an administrator just in case or the program dir won't be added to the path, i don't even know if this is really needed. Else you might need to add it manually to the system environment vars.
(batch file example: 'set PATH=C:\Program Files\CodeBlocks\MinGW\bin;C:\DEV\nasm-2.10.09;%PATH%')
(Add 'C:\Program Files\CodeBlocks\MinGW\bin;' to the Path variable)
Edit: it's needed or CMake would fail. Control panel->system->advanced system settings->environment vars.
For MinGW_w64 download i686-7.3.0-release-posix-sjlj-rt_v5-rev0.7z.
Add me as remote: https://github.com/drfrag666 and fetch from g3.3mgw
Then extract the code to a new folder or just clone the entire repo with copy-pasta to avoid screwing you VS cache.
Copy-pasta the following in CMake GUI (i use 3.9.6).
C:/Program Files/CodeBlocks/MinGW/bin/
C:/Program Files/CodeBlocks/MinGW/include/
C:/Program Files/CodeBlocks/MinGW/lib/
C:/Program Files/Microsoft DirectX SDK (November 2008)/Include (optional for XInput)
Edit: for MinGW-w64 change the paths to (for instance):
C:/DEV/mingw32/bin/
C:/DEV/mingw32/i686-w64-mingw32/include/
C:/DEV/mingw32/i686-w64-mingw32/lib/
Select CodeBlocks MinGW generator. Run the project and in project->build options modify zdoom's make commands (build project and compile single file adding -j2 before the -f).
Then project->properties, in build targets all select GUI application and type gzdoom.exe.
Settings->debugger GDB C:\Program Files\CodeBlocks\MinGW\bin\gdb32.exe
Edit: for MinGW-w64 C:/DEV/mingw32/bin/gdb.exe
Save the project.
For debugging open debugging windows (should just open automatically).
When debugging as soon as you can type set logging on debug.log for instance to log to a file.
You'll see the toolchain it's not bad at all, the weakest link is the debugger but it's okay for basic debugging i guess. If you need help let me know.
Debugging info for the multithreaded truecolor crash:
Code: Select all
Program received signal SIGSEGV, Segmentation fault.
Loop<swrenderer::DrawWall32TModes::SimpleShade, swrenderer::DrawWall32TModes::NearestFilter> (shade_constants=..., thread=0xaeb4818, this=0x11747390) at C:/DEV/vsqzdoom/src/swrenderer/drawers/r_draw_wall32_sse2.h:92
C:\DEV\vsqzdoom\src\swrenderer\drawers\r_draw_wall32_sse2.h:92:3471:beg:0xb86591
>>>>>>cb_gdb:inv_desaturate = {4294968400, 570277803283447808}
fracstep = 118238304
frac = 11218458
ssecount = 118238304
textureheight = 128
inv_light = {1271420150815718884, 19791020617432580}
vpz = 1.054547e-034
stepvpz = 1.84971397e-042
viewpos_z = {1.054547e-034, 9.70126072e+033, 9.4968106e-034, 3.13847248e-038}
dest = 0x70c2c60
dest_y = 1320
srcalpha = 11218458
source = 0xbbeab48
shade_light = {863989571435375608, 48142949845827584}
destalpha = 1104
source2 = 0x0
shade_fade = {118238200, 48145892194450668}
desaturate = 11208642
count = 201163248
num_lights = 296025324
one = 33554433
light = 51
mlight = {0, 72262240935673116}
pitch = 0
texturefracx = 296025324
lights = 0x12adfe0 <DrawerThreads::Instance()::threads>
step_viewpos_z = {1.054547e-034, -nan(0x7fffff), 0, 6.92150845e+032}
>>>>>>cb_gdb:shade_constants = {light_alpha = 0, light_red = 256, light_green = 256, light_blue = 256, fade_alpha = 0, fade_red = 0, fade_green = 0, fade_blue = 0, desaturate = 0, simple_shade = true}
thread = 0xaeb4818
this = 0x11747390
>>>>>>cb_gdb:#0 Loop<swrenderer::DrawWall32TModes::SimpleShade, swrenderer::DrawWall32TModes::NearestFilter> (shade_constants=..., thread=0xaeb4818, this=0x11747390) at C:/DEV/vsqzdoom/src/swrenderer/drawers/r_draw_wall32_sse2.h:92
#1 swrenderer::DrawWall32T<swrenderer::DrawWall32TModes::OpaqueWall>::Execute (this=0x11747390, thread=0xaeb4818) at C:/DEV/vsqzdoom/src/swrenderer/drawers/r_draw_wall32_sse2.h:67
#2 0x00479806 in DrawerThreads::WorkerMain (this=0x12adfe0 <DrawerThreads::Instance()::threads>, thread=0xaeb4818) at C:/DEV/vsqzdoom/src/swrenderer/drawers/r_thread.cpp:129
#3 0x00479964 in DrawerThreads::<lambda()>::operator()(void) const (__closure=0xbf10e38) at C:/DEV/vsqzdoom/src/swrenderer/drawers/r_thread.cpp:159
#4 0x004ab427 in std::_Bind_simple<DrawerThreads::StartThreads()::<lambda()>()>::_M_invoke<>(std::_Index_tuple<>) (this=0xbf10e38) at C:/PROGRA~1/CODEBL~1/MinGW/lib/gcc/mingw32/5.1.0/include/c++/functional:1531
#5 0x004ab346 in std::_Bind_simple<DrawerThreads::StartThreads()::<lambda()>()>::operator()(void) (this=0xbf10e38) at C:/PROGRA~1/CODEBL~1/MinGW/lib/gcc/mingw32/5.1.0/include/c++/functional:1520
#6 0x004ab2ac in std::thread::_Impl<std::_Bind_simple<DrawerThreads::StartThreads()::<lambda()>()> >::_M_run(void) (this=0xbf10e2c) at C:/PROGRA~1/CODEBL~1/MinGW/lib/gcc/mingw32/5.1.0/include/c++/thread:115
#7 0x00a7f700 in execute_native_thread_routine ()
#8 0x070c2c60 in ?? ()
#9 0x00000001 in ?? ()
>>>>>>cb_gdb:#2 0x00479806 in DrawerThreads::WorkerMain (this=0x12adfe0 <DrawerThreads::Instance()::threads>, thread=0xaeb4818) at C:/DEV/vsqzdoom/src/swrenderer/drawers/r_thread.cpp:129
C:\DEV\vsqzdoom\src\swrenderer\drawers\r_thread.cpp:129:3683:beg:0x479806
>>>>>>cb_gdb:command = @0xb38bc60: 0x11747390
__for_range = @0x7ea0874: {<std::_Vector_base<DrawerCommand*, std::allocator<DrawerCommand*> >> = {_M_impl = {<std::allocator<DrawerCommand*>> = {<__gnu_cxx::new_allocator<DrawerCommand*>> = {<No data fields>}, <No data fields>}, _M_start = 0xb38bc60, _M_finish = 0xb38eeb4, _M_end_of_storage = 0xb38fc60}}, <No data fields>}
__for_begin = {_M_current = 0xb38bc60}
__for_end = {_M_current = 0xb38eeb4}
start_lock = {_M_device = 0x12adfec <DrawerThreads::Instance()::threads+12>, _M_owns = false}
list = {<std::__shared_ptr<DrawerCommandQueue, (__gnu_cxx::_Lock_policy)2>> = {_M_ptr = 0x7ea0870, _M_refcount = {_M_pi = 0x7ea08a0}}, <No data fields>}
end_lock = {_M_device = 0x6f250c10, _M_owns = 12}
finishedTasks = 17
>>>>>>cb_gdb:this = 0x12adfe0 <DrawerThreads::Instance()::threads>
thread = 0xaeb4818
>>>>>>cb_gdb:#0 Loop<swrenderer::DrawWall32TModes::SimpleShade, swrenderer::DrawWall32TModes::NearestFilter> (shade_constants=..., thread=0xaeb4818, this=0x11747390) at C:/DEV/vsqzdoom/src/swrenderer/drawers/r_draw_wall32_sse2.h:92
#1 swrenderer::DrawWall32T<swrenderer::DrawWall32TModes::OpaqueWall>::Execute (this=0x11747390, thread=0xaeb4818) at C:/DEV/vsqzdoom/src/swrenderer/drawers/r_draw_wall32_sse2.h:67
#2 0x00479806 in DrawerThreads::WorkerMain (this=0x12adfe0 <DrawerThreads::Instance()::threads>, thread=0xaeb4818) at C:/DEV/vsqzdoom/src/swrenderer/drawers/r_thread.cpp:129
#3 0x00479964 in DrawerThreads::<lambda()>::operator()(void) const (__closure=0xbf10e38) at C:/DEV/vsqzdoom/src/swrenderer/drawers/r_thread.cpp:159
#4 0x004ab427 in std::_Bind_simple<DrawerThreads::StartThreads()::<lambda()>()>::_M_invoke<>(std::_Index_tuple<>) (this=0xbf10e38) at C:/PROGRA~1/CODEBL~1/MinGW/lib/gcc/mingw32/5.1.0/include/c++/functional:1531
#5 0x004ab346 in std::_Bind_simple<DrawerThreads::StartThreads()::<lambda()>()>::operator()(void) (this=0xbf10e38) at C:/PROGRA~1/CODEBL~1/MinGW/lib/gcc/mingw32/5.1.0/include/c++/functional:1520
#6 0x004ab2ac in std::thread::_Impl<std::_Bind_simple<DrawerThreads::StartThreads()::<lambda()>()> >::_M_run(void) (this=0xbf10e2c) at C:/PROGRA~1/CODEBL~1/MinGW/lib/gcc/mingw32/5.1.0/include/c++/thread:115
#7 0x00a7f700 in execute_native_thread_routine ()
#8 0x070c2c60 in ?? ()
#9 0x00000001 in ?? ()