Re: GDB/Mingw make problem

Andrew STUBBS
2008-01-15T11:07:00Z

Gerrit van Niekerk wrote:
> On 14 Jan 2008 at 16:12, DJ Delorie wrote:
>
>>> ?? I'd expect --target=djgpp do that automatically (it's a
>>> cross-compilation, right?)
>> It's the difference between a cygwin-x-djgpp cross compiler and a
>> mingw-x-djgpp cross compiler. If --host is mingw, you're actually
>> doing a canadian (although configure doesn't realize it, so it's not
>> the traditional build/host/target canadian), so you need to ensure
>> that CC is set right.
>>
>> Otherwise, in the example given, you're trying to build cygwin
>> programs using mingw headers, or something like that. Subtle bugs
>> ensue.
>
> The idea is to get a cross debugger to debug a remote DJGPP system using a MinGw GDB and a TCP/IP
> connection. The stock MinGW GDB works fine, except that it expects a PE target and fails to do
> address to symbol conversions correctly. The other way round works fine and one can do debugging,
> but a backtrace gives completely wrong results.
>
> I have managed to move on from the last reported problem which was caused by configure/make
> specifying the wrong include path for libintl.h. I solved that one by copying libintl.h to the
> specified directory. Now I am having a problem with conflicts between winsock2.h and unistd.h both
> declaring Winsock functions like gethostname(). It seems that the makefile uses Cygwin headers
> rather than MinGW headers.

If you don't use -mno-cygwin then gcc *will* use cygwin headers.
Otherwise, if you do use -mno-cygwin, then it still might - the search
paths are not quite right - but usually only as a fall back if there
isn't a mingw header of that name.

Andrew