public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* gdbserver cross compile
@ 2003-05-05 21:30 Harris, Jeff
  2003-05-05 21:35 ` Daniel Jacobowitz
  0 siblings, 1 reply; 7+ messages in thread
From: Harris, Jeff @ 2003-05-05 21:30 UTC (permalink / raw)
  To: gdb

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?  

Thanks,
Jeff

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: gdbserver cross compile
  2003-05-05 21:30 gdbserver cross compile Harris, Jeff
@ 2003-05-05 21:35 ` Daniel Jacobowitz
  0 siblings, 0 replies; 7+ messages in thread
From: Daniel Jacobowitz @ 2003-05-05 21:35 UTC (permalink / raw)
  To: Harris, Jeff; +Cc: gdb

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: GdbServer cross compile
  2015-05-20 16:36 GdbServer " Uladzimir Kryvian
@ 2015-05-20 16:51 ` Stan Shebs
  0 siblings, 0 replies; 7+ messages in thread
From: Stan Shebs @ 2015-05-20 16:51 UTC (permalink / raw)
  To: Uladzimir Kryvian; +Cc: gdb

On Wed, May 20, 2015 at 11:36 AM, Uladzimir Kryvian
<newinferno@gmail.com> wrote:
> Hello!
> I want compile gdb server for AmigaOS. It uses m68k processor.
> I've compiled "https://github.com/cahirwpz/m68k-amigaos-toolchain" and
> want to use it in gdbserver compilation.
> But I don't know how to do that?
>
> Can you help me with cross-compiling gdbserver for it?

This is going to be disappointing I'm afraid - gdbserver is not a
general-purpose stub.  It expects to call a variety of OS system
facilities to do its process control and such, and there is no AmigaOS
port.  Existing ports are Linux, Neutrino, and Win32; the Win32 port
might be the simplest starting point for a port, but to finish will
need some in-depth understanding of the Exec kernel and its API/ABI.

Stan

^ permalink raw reply	[flat|nested] 7+ messages in thread

* GdbServer cross compile
@ 2015-05-20 16:36 Uladzimir Kryvian
  2015-05-20 16:51 ` Stan Shebs
  0 siblings, 1 reply; 7+ messages in thread
From: Uladzimir Kryvian @ 2015-05-20 16:36 UTC (permalink / raw)
  To: gdb

Hello!
I want compile gdb server for AmigaOS. It uses m68k processor.
I've compiled "https://github.com/cahirwpz/m68k-amigaos-toolchain" and
want to use it in gdbserver compilation.
But I don't know how to do that?

Can you help me with cross-compiling gdbserver for it?

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: gdbserver cross compile
@ 2003-05-05 22:06 Harris, Jeff
  0 siblings, 0 replies; 7+ messages in thread
From: Harris, Jeff @ 2003-05-05 22:06 UTC (permalink / raw)
  To: 'Daniel Jacobowitz', Harris, Jeff; +Cc: gdb

That's what I was planning on doing.  It does appear to work.

-----Original Message-----
From: Daniel Jacobowitz [mailto:drow@mvista.com] 
Sent: Monday, May 05, 2003 5:53 PM
To: Harris, Jeff
Cc: gdb@sources.redhat.com
Subject: Re: gdbserver cross compile


To be honest, I don't remember how I solved this in our local
environment... you could just rebuild that one configure file locally
with 2.5x if that works.  I think it's simple enough to work in both. 
Most other configure files in the source are not.

On Mon, May 05, 2003 at 05:46:16PM -0400, Harris, Jeff wrote:
> I tried setting both cross_compiling and ac_cv_prog_cc_cross environment
> variables to "yes" before running configure.  Neither seemed to stop it
from
> running its program and overriding my values.
> 
> In thinking about setting ac_cv_header_stdc to yes, this also won't help
> since the problem program, the one which checks ctype macros, will still
be
> run unless I can get cross_compiling to be set to "yes".
> 
> Jeff
> -----Original Message-----
> From: Daniel Jacobowitz [mailto:drow@mvista.com] 
> Sent: Monday, May 05, 2003 5:35 PM
> To: Harris, Jeff
> Cc: gdb@sources.redhat.com
> Subject: Re: gdbserver cross compile
> 
> 
> 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
> 

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: gdbserver cross compile
  2003-05-05 21:47 Harris, Jeff
@ 2003-05-05 21:53 ` Daniel Jacobowitz
  0 siblings, 0 replies; 7+ messages in thread
From: Daniel Jacobowitz @ 2003-05-05 21:53 UTC (permalink / raw)
  To: Harris, Jeff; +Cc: gdb

To be honest, I don't remember how I solved this in our local
environment... you could just rebuild that one configure file locally
with 2.5x if that works.  I think it's simple enough to work in both. 
Most other configure files in the source are not.

On Mon, May 05, 2003 at 05:46:16PM -0400, Harris, Jeff wrote:
> I tried setting both cross_compiling and ac_cv_prog_cc_cross environment
> variables to "yes" before running configure.  Neither seemed to stop it from
> running its program and overriding my values.
> 
> In thinking about setting ac_cv_header_stdc to yes, this also won't help
> since the problem program, the one which checks ctype macros, will still be
> run unless I can get cross_compiling to be set to "yes".
> 
> Jeff
> -----Original Message-----
> From: Daniel Jacobowitz [mailto:drow@mvista.com] 
> Sent: Monday, May 05, 2003 5:35 PM
> To: Harris, Jeff
> Cc: gdb@sources.redhat.com
> Subject: Re: gdbserver cross compile
> 
> 
> 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
> 

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: gdbserver cross compile
@ 2003-05-05 21:47 Harris, Jeff
  2003-05-05 21:53 ` Daniel Jacobowitz
  0 siblings, 1 reply; 7+ messages in thread
From: Harris, Jeff @ 2003-05-05 21:47 UTC (permalink / raw)
  To: 'Daniel Jacobowitz'; +Cc: gdb

I tried setting both cross_compiling and ac_cv_prog_cc_cross environment
variables to "yes" before running configure.  Neither seemed to stop it from
running its program and overriding my values.

In thinking about setting ac_cv_header_stdc to yes, this also won't help
since the problem program, the one which checks ctype macros, will still be
run unless I can get cross_compiling to be set to "yes".

Jeff
-----Original Message-----
From: Daniel Jacobowitz [mailto:drow@mvista.com] 
Sent: Monday, May 05, 2003 5:35 PM
To: Harris, Jeff
Cc: gdb@sources.redhat.com
Subject: Re: gdbserver cross compile


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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-05-20 16:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-05 21:30 gdbserver cross compile Harris, Jeff
2003-05-05 21:35 ` Daniel Jacobowitz
2003-05-05 21:47 Harris, Jeff
2003-05-05 21:53 ` Daniel Jacobowitz
2003-05-05 22:06 Harris, Jeff
2015-05-20 16:36 GdbServer " Uladzimir Kryvian
2015-05-20 16:51 ` Stan Shebs

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).