This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Cross compiling GDB for ARM
- From: Robert Schwebel <robert at schwebel dot de>
- To: gdb at sources dot redhat dot com
- Date: Thu, 26 Feb 2004 11:47:33 +0100
- Subject: Cross compiling GDB for ARM
Hi,
gdb-6.0 does not cross compile correctly for me (cross-compiling as in
compiling a native gdb for ARM on x86, not a cross-gdb); I've managed to
make everything compile with a few tweeks, but the linker stage fails:
----------8<----------
rm -f gdb
arm-unknown-linux-gnu-gcc -O -I/tmp/ptxdist-local-innokom/arm-unknown-linux-gnu/include \
-o gdb gdb.o main.o cli-dump.o cli-decode.o cli-script.o cli-cmds.o cli-setshow.o cli-utils.o cli-logging.o cli-interp.o mi-out.o mi-console.o mi-cmds.o mi-cmd-env.o mi-cmd-var.o mi-cmd-break.o mi-cmd-stack.o mi-cmd-file.o mi-cmd-disas.o mi-symbol-cmds.o mi-interp.o mi-main.o mi-parse.o mi-getopt.o libgdb.a \
../bfd/libbfd.a ../readline/libreadline.a ../opcodes/libopcodes.a ../libiberty/libiberty.a -ltermcap -lm ../libiberty/libiberty.a -ldl -rdynamic
/opt/ptxdist/arm-linux-3.3.2_old/bin/../lib/gcc-lib/arm-unknown-linux-gnu/3.3.2/../../../../arm-unknown-linux-gnu/bin/ld: cannot find -ltermcap
collect2: ld returned 1 exit status
make[2]: *** [gdb] Error 1
make[2]: Leaving directory `/ptx/work/cvs-rsc/ptxdist-innokom/build/gdb-6.0-build/gdb'
make[1]: *** [all-gdb] Error 2
make[1]: Leaving directory `/ptx/work/cvs-rsc/ptxdist-innokom/build/gdb-6.0-build'
make: *** [/ptx/work/cvs-rsc/ptxdist-innokom/state/gdb.compile] Error 2
----------8<----------
The Makefile builds the linker commandline from $(INTERNAL_LDFLAGS) which
consists of something else, plus the correct $(LDFLAGS) which contains the -L
path. The problem is that $(LDFLAGS) seems to be overwritten somehow: it is set
explicitly further up in the Makefile, but when I echo it out at the position
it is used it is empty. Adding a target like this one:
print-%:
@echo $* is $($*)
and running 'make print-LDFLAGS' on the other hand gives the correct result. It
seems like the content of the variable is choked somehow between the definition
and the place where the variable is actually expanded.
Robert
--
Dipl.-Ing. Robert Schwebel | http://www.pengutronix.de
Pengutronix - Linux Solutions for Science and Industry
Handelsregister: Amtsgericht Hildesheim, HRA 2686
Hornemannstraße 12, 31137 Hildesheim, Germany
Phone: +49-5121-28619-0 | Fax: +49-5121-28619-4