Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Francisco Cuesta <ndarkness@gmail.com>
Cc: gdb@sourceware.org
Subject: Re: Cross-compilation shows>error: no termcap library found, why?
Date: Tue, 11 Jun 2013 09:03:00 -0000	[thread overview]
Message-ID: <51B6E7EC.7080509@redhat.com> (raw)
In-Reply-To: <CANMvdA8gMqUeQ6=1Ez870RzJ=o1uPHqPN1os49+h3E4bvTpH3Q@mail.gmail.com>

On 06/07/2013 03:30 PM, Francisco Cuesta wrote:
> Hi Pedro,
> 
> I don't understand, I have the gdb server running in the target, this
> is all arm archietecture. On the other hand I have my pc, which is x86
> architecture, but for debugging in eclipse I have to point to the dbg
> client (on the pc) which is going to connect to the dbg server on the
> target. SO, both gdb client and gdbserver have to be compiled in arm,
> that is correct or I missunderstand something?

GDB and GDBserver are separate programs.  Applying the terms quoted
below (build/host/target), you get:

For GDB:
You need a GDB that _runs_ on x86.  You use --host to specify where
the program runs.  E.g., --host=i686-unknown-linux-gnu.  However, if
the program is meant to be run on the same system you are building
from, then the --host's default will pick the right option for you
automatically.  You need a GDB that understands how to debug ARM programs.
And you specify that with the --target option, like e.g.,
--target=arm-mv5sft-linux-gnueabi.  (If you don't specify --target,
then the build system defaults --target to the same system as
the one you're building on, which would be x86).

For GDBserver:
You need a GDBserver that _runs_ on the ARM machine.  Again, you use --host
to specify where the program runs.  In this case, GDBserver will run on
ARM, so specify --host=arm-mv5sft-linux-gnueabi.  GDBserver is not a "cross"
tool -- it knows how to debug the programs on its own system.  It's no different
from most other programs running on the ARM system, like grep, sed, etc,
so you build it just like all other autoconf programs.

So again, configure GDB with --target=arm-mv5sft-linux-gnueabi.  Run
the toplevel configure for that (src/configure).

Configure GDBserver with --host=arm-mv5sft-linux-gnueabi.
Run GDBserver's configure for that.  (src/gdb/gdbserver/configure).

Better start from scratch than reuse the same build tree.

I recommend building on a separate build directory from the sources.
Like,

Sources in gdb/src/
Build directory for gdb in gdb/build-gdb/
Build directory for gdbserver in gdb/build-gdbserver/

Cd into gdb/build-gdb/, and do '../src/configure ...'
Cd into gdb/build-gdbserver/, and do '../src/gdb/gdbserver/configure ...'

At any time you want to do a build from scratch, you just need
to wipe build directories.

> 
> Thanks in advance,
> 
> Ps: what's more,  I have done what you suggested and if I did that on
> top level directory of gdb I get the error related to termcap... I
> guess in that directory is where I need to crosscompile the gdb
> client, though.

You don't need to cross compile gdb.  That's a red herring.
Try building a gdb for the local system (just configure with no
options) just to make sure you have all the necessary build
dependencies installed, and you most probably will get the same error.
You'll need to sort that out first.

-- 
Pedro Alves


  reply	other threads:[~2013-06-11  9:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-06 15:03 Francisco Cuesta
2013-06-06 16:03 ` Pedro Alves
2013-06-07  6:00   ` Francisco Cuesta
2013-06-07  9:52   ` Francisco Cuesta
2013-06-07 10:20     ` Pedro Alves
2013-06-07 14:30       ` Francisco Cuesta
2013-06-11  9:03         ` Pedro Alves [this message]
2013-06-11 15:43           ` cross building gdb/gdbserver howto in the wiki (Re: Cross-compilation shows>error: no termcap library found, why?) Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51B6E7EC.7080509@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb@sourceware.org \
    --cc=ndarkness@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox