Cross-gdb not built with XML support causing issues

Thomas Petazzoni
Mon Jul 25 10:07:00 GMT 2011


Again, I've used ct-ng last week, and I had some issues with cross-gdb
and gdbserver (version 7.1). When cross-gdb connects to the gdbserver,
it says "Remote g packet too long", with a dump of the packet. After a
bit of research, it seems to be caused by the fact that the cross-gdb
was build without XML support and therefore does not know some details
about the target architecture.

My understanding is that ct-ng relies on the host providing the expat
library to build the cross-gdb with XML support. On this machine, the
host system was a Ubuntu 10.04 32 bits, with libexpat1-dev installed.

The build.log.bz2 says :

[ALL  ]    checking for libexpat... no
[ALL  ]    configure: WARNING: expat is missing or unusable; some features may be unavailable.

And the cross-gdb config.log says :

configure:9374: gcc -static -o conftest -g -O2     conftest.c -ltermcap -lm    -lexpat >&5
conftest.c:53:19: error: expat.h: No such file or directory
conftest.c: In function 'main':
conftest.c:57: error: 'XML_Parser' undeclared (first use in this function)
conftest.c:57: error: (Each undeclared identifier is reported only once
conftest.c:57: error: for each function it appears in.)
conftest.c:57: error: expected ';' before 'p'
configure:9374: $? = 1

However, libexpat is installed on the host, including development
files. Here is a sample test:

/tmp$ cat test.c 
#include "expat.h"

int main(void) {}

/tmp$ gcc -static -o test test.c -lexpat

On another Ubuntu 11.04 host with libexpat1-dev installed, the
cross-gdb was correctly built with XML support and the "Remote g packet
too long" error did not appear and the debugging session could work


Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.

For unsubscribe information see

More information about the crossgcc mailing list