This is the mail archive of the gdb@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: building GDB on Cygwin fails



> Now I want to build GDB as well to debug my remote target.

Do you want to build a GDB executable to be run on the DOS target, to
debug the programs natively?  Or do you want to build GDB that will
run on a Windows machine and debug programs on the DOS target
remotely?

A native DJGPP build of GDB only supports the former.  For the latter,
you will need some kind of communications channel between the host and
the target.  I don't know if the current version of GDB supports
debugging a DOS target from a Cygwin host; if not, you will need to
hack around a bit.

> I installed the latest
> GDB (gdb-20000305.tar.gz). Configure works without any
> problem.

Please tell me how did you configure GDB.  That is, what was the
command line you used to invoke the configure script.

> When I try to build everything I get the
> following error while building the folder GDB :
> 
> 
> bash-2.02$ make
> 
> rm -f gdb.exe
> gcc -g        -o gdb.exe main.o libgdb.a   
> ../bfd/libbfd.a ../readline/libreadline.a
> ../opcodes/libopcodes.a ./../intl/libintl.a
> ../libiberty/libiberty.a `if test -r
> ../libtermcap/libtermcap.a; then echo
> ../libtermcap/libtermcap.a; else echo -ltermcap; fi`  
>   -lm  ../libiberty/libiberty.a -luser32 

There's something strange here: you are building a DJGPP binary, but
linking against libuser32.a, which is a Windows library.  Why?

> libgdb.a(stack.o): In function `frame_info':
> /djgpp/cross/gdb2000/gdb/../../gdb-20000305/gdb/stack.c:952:
> undefined reference to `sigtramp_saved_pc'

The undefined references to sigtramp_saved_pc is a known bug in GDB
when building a native DJGPP version.  In fact, the DJGPP support in
current snapshots of GDB is broken, and these errors is one of the
symptoms of that breakage.  I have patches to fix that, but I didn't
yet commit them to the GDB CVS tree.  I will probably do that in the
next few days.

But since I'm not sure how did you configure GDB and why does
libuser32.a get linked in, I cannot guarantee that those patches will
solve your problems.

> /cygdrive/c/CYGNUS/CYGWIN~1/H-I586~1/BIN/../lib/gcc-lib/i586-cygwin32/2.95.2/../../../libtermcap.a(tputs.o):
> In function `tputs':
> /home/noer/src/b20/comp-tools/devo/libtermcap/tputs.c:72:
> undefined reference to `_ctype_'

I'm guessing that the configure script found libtermcap.a on your
system and is trying to link it in.  You get undefined references
because that libtermcap.a was compiled with Cygwin, not with DJGPP.
If my guess is correct, you need to move libtermcap.a out of
configure's sight.  (The DJGPP version of GDB doesn't need and doesn't
use any termcap library.)

> I really don't know where to search for the error. It
> only says ***[gdb.exe] Error

All the messages you sent me are the errors it is complaining about.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]