Page 1 of 1

trouble compiling gdb

Posted: Tue May 10, 2005 11:54 am
by srg
Hi

I wan't to compile an i386-pc-elf targeted gdb to go with my cross compiler and to eventually use for remote debugging of my kernel.

Trouble is that I can't get the darn thing to compile (I'm using Cygwin BTW). First I tried the sources that come with cygwin, but it said it couldn't find tcl or tk headers (odd for a commandline program ??? ). I'm now trying to compile the gdb-6.3 sources downloaded from the gnu.org ftp. The trouble with this is that I get this error:

elif [ -f ada-lex.c ]; then \
echo "Warning: ada-lex.c older than ada-lex.l and flex not available."; \
else \
echo "ada-lex.c missing and flex not available."; \
false; \
fi
flex: can't open /usr/src/gdb-6.3/gdb/ada-lex.l
make[1]: *** [ada-lex.c] Error 1
make[1]: Leaving directory `/usr/cross/i386-elf-gdb/gdb'
make: *** [all-gdb] Error 2

I don't get this as the file is there, but it can't open it, just this one file.

any idea's what I'm doing wrong.

srg

Re:trouble compiling gdb

Posted: Tue May 10, 2005 12:42 pm
by srg
by compiling it in the source directory, I get almost all the way ther but:

make[1]: *** No rule to make target `../intl/libintl.a', needed by `gdb.exe'. Stop.
make[1]: Leaving directory `/usr/src/gdb-6.3/gdb-6.3/gdb'
make: *** [all-gdb] Error 2

srg

Re:trouble compiling gdb

Posted: Wed May 11, 2005 5:13 am
by srg
I've got version 6.1 to work, but not 6.2.1 or 6.3, I'll stick with that.

srg

Re:trouble compiling gdb

Posted: Wed May 11, 2005 5:51 am
by Solar
It is very difficult to tell what's wrong since you do not give the options you passed to [tt]configure[/tt], so it's impossible to check your modus operandi against the GDB docs (Appendix B "Installing GDB") or reproducing the problem.

As v6.1 is pretty dated, I'd continue trying to get 6.3 to work.

Re:trouble compiling gdb

Posted: Thu May 12, 2005 3:55 am
by srg
Solar wrote: It is very difficult to tell what's wrong since you do not give the options you passed to [tt]configure[/tt], so it's impossible to check your modus operandi against the GDB docs (Appendix B "Installing GDB") or reproducing the problem.

As v6.1 is pretty dated, I'd continue trying to get 6.3 to work.
oops sorry

is used --target=i386-elf --prefix=/usr/cross/i386-elf-gdb

that's it.

I did subscribe to the gdb mailing list and send a message but it never appeared, strange, must have dome something wrong.

srg

srg

Re:trouble compiling gdb

Posted: Thu May 12, 2005 6:06 am
by Solar
A target is a triplet of architecture-vendor-os. Configuring e.g. GCC for a "naked" cross-compiling target (as i386-elf) as done in OS development works only because we're compiling without included startup files etc. anyway, and write our own linker scripts.

I am not at all sure whether GDB can successfully be built for a "naked" target.

That being said, try to run configure from a directory of its own:

Code: Select all

$> mkdir build-gdb
$> cd build-gdb
$> ../gdb-6.3/configure ...
$> make && make install
That might solve your problem.

Other than that, I'm more or less clueless. I haven't compiled a cross-compiler GDB yet.

Re:trouble compiling gdb

Posted: Thu May 12, 2005 9:07 am
by srg
hmm

I've just now tried this but no joy.

There is a translation script with gdb that interprets the target you give it.

i386-elf becomes i386-pc-elf
m68k-elf becomes m68k-unknown-elf

The WinAVR package that is a binary installation of the GCC toolchain for the AVR 8-bit microcontroller on windows (it was compiled on cygwin) does have gdb 6.1 and Insight 6.1 compiled as for the target avr. This is also "naked", gdb is also know to be fine for embedded work like this.

Winavr was the reason I tried 6.1 (which worked), I never got insight to work (BTW I tried ddd as a front end. It compiles and installs but I just get an exception error 0x00000005 on startup).

srg