* Cross-compilation shows>error: no termcap library found, why?
@ 2013-06-06 15:03 Francisco Cuesta
2013-06-06 16:03 ` Pedro Alves
0 siblings, 1 reply; 8+ messages in thread
From: Francisco Cuesta @ 2013-06-06 15:03 UTC (permalink / raw)
To: gdb
I'm experiencing a frustrating error trying to cross-compile gdbserver
for arm. I've downloaded and crosscompiled termcap with this command
export CC="/bin/arm-mv5sft-linux-gnueabi-gcc"
export CXX="/bin/arm-mv5sft-linux-gnueabi-g++"
export AR="/bin/arm-mv5sft-linux-gnueabi-ar"
CONFOPTS+="--target=arm-linux --host=arm-linux
--build=i686-pc-linux-gnu --prefix=/usr --exec-prefix=/usr
--enable-static"
./configure ${CONFOPTS}
make &&
make DESTDIR=~/gdb-7.6/toInst install
Being such crosscompilation successful since I wasn't prompted any
error, I got the libtermcap.a which is arm, as you can see below, and
located on ~/termcap/
:$ file *.o
termcap.o: ELF 32-bit LSB relocatable, ARM, version 1 (SYSV), not stripped
tparam.o: ELF 32-bit LSB relocatable, ARM, version 1 (SYSV), not stripped
version.o: ELF 32-bit LSB relocatable, ARM, version 1 (SYSV), not strippe
However, if I try to do the same for cross-compiling gdbserver for
arm, with the same options and calling the cross compiled lib
export CC="/bin/arm-mv5sft-linux-gnueabi-gcc"
export CXX="/bin/arm-mv5sft-linux-gnueabi-g++"
export AR="/bin/arm-mv5sft-linux-gnueabi-ar"
CONFOPTS+="--target=arm-linux --host=arm-linux
--build=i686-pc-linux-gnu --prefix=/usr --exec-prefix=/usr
--sysconfdir=/etc --enable-static
--with-termcap=~/termcap/libtermcap.a"
./configure ${CONFOPTS} $@
make &&
make DESTDIR=~/gdb-7.6/toInst install
I get this
checking for library containing waddstr... no
configure: WARNING: no enhanced curses library found; disabling TUI
checking for library containing tgetent... no
configure: error: no termcap library found
make[1]: *** [configure-gdb] Error 1
make[1]: Leaving directory `~/gdb-7.6'
make: *** [all] Error 2
I have found several sites on the internet suggesting installing the
library libncurses5-dev, but have I already installed!
$ sudo apt-get install libncurses5-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libncurses5-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 67 not upgraded.
SO, I don't know what can I do to crosscompile gdbserver, please help!
Thanks in advance!!
regards
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: Cross-compilation shows>error: no termcap library found, why? 2013-06-06 15:03 Cross-compilation shows>error: no termcap library found, why? Francisco Cuesta @ 2013-06-06 16:03 ` Pedro Alves 2013-06-07 6:00 ` Francisco Cuesta 2013-06-07 9:52 ` Francisco Cuesta 0 siblings, 2 replies; 8+ messages in thread From: Pedro Alves @ 2013-06-06 16:03 UTC (permalink / raw) To: Francisco Cuesta; +Cc: gdb It sounds like you're running the top level's configure instead of gdbserver's. If you just want to build gdbserver, run the configure in gdb/gdbserver/. -- Pedro Alves ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Cross-compilation shows>error: no termcap library found, why? 2013-06-06 16:03 ` Pedro Alves @ 2013-06-07 6:00 ` Francisco Cuesta 2013-06-07 9:52 ` Francisco Cuesta 1 sibling, 0 replies; 8+ messages in thread From: Francisco Cuesta @ 2013-06-07 6:00 UTC (permalink / raw) To: Pedro Alves; +Cc: gdb Hi Pedro, Thanks for replying that seems to work!! I have been able to crosscompile gdbserver, from its directory with my cross options. regards! 2013/6/6 Pedro Alves <palves@redhat.com>: > It sounds like you're running the top level's configure > instead of gdbserver's. If you just want to build > gdbserver, run the configure in gdb/gdbserver/. > > -- > Pedro Alves > ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Cross-compilation shows>error: no termcap library found, why? 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 1 sibling, 1 reply; 8+ messages in thread From: Francisco Cuesta @ 2013-06-07 9:52 UTC (permalink / raw) To: Pedro Alves; +Cc: gdb But now I have another doubt, if I want to crooscompile the gdb "client" which is going to connect to the gdbserver, how can I do it? Then, I will have to crosscompile the whole gdb suite right? regards! 2013/6/6 Pedro Alves <palves@redhat.com>: > It sounds like you're running the top level's configure > instead of gdbserver's. If you just want to build > gdbserver, run the configure in gdb/gdbserver/. > > -- > Pedro Alves > ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Cross-compilation shows>error: no termcap library found, why? 2013-06-07 9:52 ` Francisco Cuesta @ 2013-06-07 10:20 ` Pedro Alves 2013-06-07 14:30 ` Francisco Cuesta 0 siblings, 1 reply; 8+ messages in thread From: Pedro Alves @ 2013-06-07 10:20 UTC (permalink / raw) To: Francisco Cuesta; +Cc: gdb On 06/07/2013 10:52 AM, Francisco Cuesta wrote: > But now I have another doubt, if I want to crooscompile the gdb > "client" which is going to connect to the gdbserver, how can I do it? > Then, I will have to crosscompile the whole gdb suite right? Assuming gdb will run on your host non-ARM machine, no. Here's the chapter everyone building cross tools should read (do click the right arrow): http://www.sourceware.org/autobook/autobook/autobook_258.html And also, simplified from: http://www.flameeyes.eu/autotools-mythbuster/autoconf/canonical.html " When using autoconf, there are three system definitions (or machine definitions) that are used to identify the “actors” in the build process; (...) These three definitions are: host The system that is going to run the software once it is built. Once the software has been built, it will execute on this particular system. build The system where the build process is being executed. For most uses this would be the same as the host system, but in case of cross-compilation the two obviously differ. target The system against which the software being built will run on. This only exists, or rather has a meaning, when the software being built may interact specifically with a system that differs from the one it's being executed on (our host). This is the case for compilers, debuggers, profilers and analyzers and other tools in general. " So configure GDB with --target=arm-mv5sft-linux-gnueabi, and GDBserver with --host=arm-mv5sft-linux-gnueabi. > > regards! > > 2013/6/6 Pedro Alves <palves@redhat.com>: >> It sounds like you're running the top level's configure >> instead of gdbserver's. If you just want to build >> gdbserver, run the configure in gdb/gdbserver/. >> >> -- >> Pedro Alves >> -- Pedro Alves ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Cross-compilation shows>error: no termcap library found, why? 2013-06-07 10:20 ` Pedro Alves @ 2013-06-07 14:30 ` Francisco Cuesta 2013-06-11 9:03 ` Pedro Alves 0 siblings, 1 reply; 8+ messages in thread From: Francisco Cuesta @ 2013-06-07 14:30 UTC (permalink / raw) To: Pedro Alves; +Cc: gdb 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? 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. 2013/6/7 Pedro Alves <palves@redhat.com>: > On 06/07/2013 10:52 AM, Francisco Cuesta wrote: >> But now I have another doubt, if I want to crooscompile the gdb >> "client" which is going to connect to the gdbserver, how can I do it? >> Then, I will have to crosscompile the whole gdb suite right? > > Assuming gdb will run on your host non-ARM machine, no. > > Here's the chapter everyone building cross tools should read (do > click the right arrow): > > http://www.sourceware.org/autobook/autobook/autobook_258.html > > And also, simplified from: > > http://www.flameeyes.eu/autotools-mythbuster/autoconf/canonical.html > > " > When using autoconf, there are three system definitions (or machine definitions) > that are used to identify the “actors” in the build process; (...) These three definitions are: > > host > > The system that is going to run the software once it is built. Once the software > has been built, it will execute on this particular system. > > build > > The system where the build process is being executed. For most uses this > would be the same as the host system, but in case of cross-compilation > the two obviously differ. > > target > > The system against which the software being built will run on. This only exists, or rather > has a meaning, when the software being built may interact specifically with a > system that differs from the one it's being executed on (our host). This is the case > for compilers, debuggers, profilers and analyzers and other tools in general. > " > > So configure GDB with --target=arm-mv5sft-linux-gnueabi, > and GDBserver with --host=arm-mv5sft-linux-gnueabi. > >> >> regards! >> >> 2013/6/6 Pedro Alves <palves@redhat.com>: >>> It sounds like you're running the top level's configure >>> instead of gdbserver's. If you just want to build >>> gdbserver, run the configure in gdb/gdbserver/. >>> >>> -- >>> Pedro Alves >>> > > > -- > Pedro Alves ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Cross-compilation shows>error: no termcap library found, why? 2013-06-07 14:30 ` Francisco Cuesta @ 2013-06-11 9:03 ` Pedro Alves 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 0 siblings, 1 reply; 8+ messages in thread From: Pedro Alves @ 2013-06-11 9:03 UTC (permalink / raw) To: Francisco Cuesta; +Cc: gdb 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 ^ permalink raw reply [flat|nested] 8+ messages in thread
* cross building gdb/gdbserver howto in the wiki (Re: Cross-compilation shows>error: no termcap library found, why?) 2013-06-11 9:03 ` Pedro Alves @ 2013-06-11 15:43 ` Pedro Alves 0 siblings, 0 replies; 8+ messages in thread From: Pedro Alves @ 2013-06-11 15:43 UTC (permalink / raw) To: Pedro Alves; +Cc: Francisco Cuesta, gdb I've put all this in <http://sourceware.org/gdb/wiki/BuildingCrossGDBandGDBserver>, linked from the wiki's main page. Could probably use some copy/editing to make it clearer, but it's a start. :-) -- Pedro Alves ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2013-06-11 15:43 UTC | newest] Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2013-06-06 15:03 Cross-compilation shows>error: no termcap library found, why? 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 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
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox