gdbserver cross compile
Daniel Jacobowitz
drow@mvista.com
Mon May 5 21:35:00 GMT 2003
On Mon, May 05, 2003 at 05:29:48PM -0400, Harris, Jeff wrote:
> I was having problems with getting gdbserver to correctly detect whether it
> is being built with a cross-compiler or not. I was trying to cross-compile
> from i386 (RedHat 7.2) to i386(gcc 3.2.3 and glibc 2.3.2). The configure
> script for gdbserver looks to have been created with an old version of
> autoconf (2.13 I believe). The mechanism it uses to detect a cross compiler
> simply tries to compile a simple program and run it. If it runs, it decides
> it isn't cross-compiling otherwise it is cross-compiling.
>
> My problem was that while this program runs with the cross-compiler, the
> program to detect whether standard C headers are used does not run. As a
> result, the STDC_HEADERS #define is not set and ultimately a compile error
> to occur.
>
> There doesn't seem to be a way to override the configure script's detection
> mechanism. However, if I rerun autoconf (version 2.53) in the gdbserver
> directory, the resulting configure script is updated to include better
> logic. Basically, it compares the build and host options to configure to
> determine its cross-compile state. This mechanism works for me since I have
> different values for these options.
>
> Is an updated version of configure something that would be considered for
> GDB 5.4?
Sadly, no. You can't use autoconf 2.5x with the current source tree,
in general; the conversion process is still being talked about.
It's pretty easy to fake out the 2.13 logic for this case. I don't
remember exactly what the magic was, since I can't find any specific
reference to it in our cross build scripts; but all you should need to
do is preload one of the configure script's cache variables with
something that says no, don't run programs.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
More information about the Gdb
mailing list