Ian, I made some progress: there was a name conflict between "\Src\Debugger\IO.h" and a same named file in mingw32 system headers. I think during compilation, probably, the former took precedence over the latter in some way and, as a side effect, "_chsize" remained undefined, where usually is defined at system level. Plus many other things consequentially broke.
I resolved all by:
- renaming "IO.cpp" to "DebuggerIO.cpp"
- renaming "IO.h" to "DebuggerIO.h"
- change accordingly every reference to that file.
It remains only a "bug": if I compile with both ENABLE_DEBUGGER and NET_BOARD set then at link time it throws out this:
- Code: Select all
_obj/CPUDebug.o:CPUDebug.cpp:(.text+0x8df): undefined reference to `CThread::CreateMutex()'
_obj/Debugger.o:Debugger.cpp:(.text+0x1408): undefined reference to `CThread::CreateMutex()'
collect2.exe: error: ld returned 1 exit status
make: *** [Makefiles/Makefile.inc:288: _bin/supermodel] Error 1
make: Target 'all' not remade because of errors.
Now it behaves in all aspects like the old makefile, bug included. Probably the changed compile/link order from the older one made a difference.
I'll post the final patch in few minutes, however someone should rename those two files in the repository.