Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Re: Patch for arm-linux gdbserver
@ 2002-01-31  9:36 William A. Gatliff
       [not found] ` <4.1.20020131181535.00b40f00@mhsun1.maidenhead.arm.com>
  0 siblings, 1 reply; 9+ messages in thread
From: William A. Gatliff @ 2002-01-31  9:36 UTC (permalink / raw)
  To: gdb

Keith:


Regarding this:

http://sources.redhat.com/ml/gdb-patches/2001-12/msg00137.html


Do you have a quick recipe for building gdbserver?

I have an arm-linux toolchain installed, but I'm having to do a lot of
editing in the Makefile for gdbserver after configuring, to get my
search paths right.  I haven't had a successful build yet.

This makes me suspicious that I'm doing something wrong...


Thanks!


b.g.

-- 
Bill Gatliff
bgat@billgatliff.com


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

* Re: Patch for arm-linux gdbserver
       [not found] ` <4.1.20020131181535.00b40f00@mhsun1.maidenhead.arm.com>
@ 2002-01-31 13:36   ` William A. Gatliff
  2002-01-31 15:10     ` Daniel Jacobowitz
  0 siblings, 1 reply; 9+ messages in thread
From: William A. Gatliff @ 2002-01-31 13:36 UTC (permalink / raw)
  To: Keith.Walker; +Cc: crossgcc, gdb

Keith:


[root@venus gdbserver]# make
arm-linux-gcc -c -g    -I/home/bgat/Intrinsyc/include -I. -I.. -I../../gdb/gdbserver -I../../gdb/gdbserver/.. -I../../gdb/gdbserver/../config -I../../gdb/gdbserver/../../include -I../../bfd -I../../gdb/gdbserver/../../bfd -DGDBSERVER ../../gdb/gdbserver/low-linux.c
../../gdb/gdbserver/low-linux.c:42: sys/reg.h: No such file or directory
make: *** [low-linux.o] Error 1

[root@venus gdbserver]# find ~/Intrinsyc/ -name reg.h
/root/Intrinsyc/arm-linux/sys-include/asm-mips/reg.h
/root/Intrinsyc/arm-linux/sys-include/asm-alpha/reg.h
/root/Intrinsyc/arm-linux/sys-include/asm-sparc/reg.h
/root/Intrinsyc/arm-linux/sys-include/asm-sparc64/reg.h
/root/Intrinsyc/arm-linux/sys-include/asm-mips64/reg.h


I'm using a prebuilt toolchain from Intrinsyc.  I'm thinking there's
something wrong about it, but I can't quite put my finger on it...

Where is your reg.h?

What versions of arm-linux tools are you using?  I may just have to
start from scratch here...


b.g.



On Thu, Jan 31, 2002 at 06:50:13PM +0000, Keith.Walker wrote:
> >Regarding this:
> >
> >http://sources.redhat.com/ml/gdb-patches/2001-12/msg00137.html
> >
> >
> >Do you have a quick recipe for building gdbserver?
> >
> >I have an arm-linux toolchain installed, but I'm having to do a lot of
> >editing in the Makefile for gdbserver after configuring, to get my
> >search paths right.  I haven't had a successful build yet.
> >
> >This makes me suspicious that I'm doing something wrong...
> 
> What host & target are you specifying when building gdb?
> 
> If you are just building gdb to run on your (Intel?) linux box but targeted
> at ARM (i.e. you have just built gdb using configure --target=arm-linux
> ......) then try the following ......
> 
> In the gdbserver build directory:
> 
>    change the symbolic link xm.h to point to
> <SRCDIR>/gdb/config/arm/xm-linux.h.
>    create the symbolic link nm.h to point to
> <SRCDIR>/gdb/config/arm/nm-linux.h.
>    edit ../config.h and change the line:
> 	/* #undef GDB_NM_FILE */
>       to
> 	#define GDB_NM_FILE config/arm/tm-linux.h
> 
>   set the environment variable CC to point to your arm-linux compiler, e.g.
> 	CC=arm-linux-gcc
> 	export CC
>   and finally run make.
> 
> This is a bit of a hack, but it saves you having to cross-build all of gdb
> just to get gdbserver built for your target system.
> 
> 
> Keith
> Keith Walker		keith.walker@arm.com		Tel:+44 (1628) 427732
> ARM Ltd		http://www.arm.com
> 

-- 
Bill Gatliff
bgat@billgatliff.com


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

* Re: Patch for arm-linux gdbserver
  2002-01-31 13:36   ` William A. Gatliff
@ 2002-01-31 15:10     ` Daniel Jacobowitz
  2002-01-31 15:21       ` Peter Barada
  0 siblings, 1 reply; 9+ messages in thread
From: Daniel Jacobowitz @ 2002-01-31 15:10 UTC (permalink / raw)
  To: William A. Gatliff; +Cc: Keith.Walker, crossgcc, gdb

On Thu, Jan 31, 2002 at 03:36:27PM -0600, William A. Gatliff wrote:
> Keith:
> 
> 
> [root@venus gdbserver]# make
> arm-linux-gcc -c -g    -I/home/bgat/Intrinsyc/include -I. -I.. -I../../gdb/gdbserver -I../../gdb/gdbserver/.. -I../../gdb/gdbserver/../config -I../../gdb/gdbserver/../../include -I../../bfd -I../../gdb/gdbserver/../../bfd -DGDBSERVER ../../gdb/gdbserver/low-linux.c
> ../../gdb/gdbserver/low-linux.c:42: sys/reg.h: No such file or directory
> make: *** [low-linux.o] Error 1
> 
> [root@venus gdbserver]# find ~/Intrinsyc/ -name reg.h
> /root/Intrinsyc/arm-linux/sys-include/asm-mips/reg.h
> /root/Intrinsyc/arm-linux/sys-include/asm-alpha/reg.h
> /root/Intrinsyc/arm-linux/sys-include/asm-sparc/reg.h
> /root/Intrinsyc/arm-linux/sys-include/asm-sparc64/reg.h
> /root/Intrinsyc/arm-linux/sys-include/asm-mips64/reg.h
> 
> 
> I'm using a prebuilt toolchain from Intrinsyc.  I'm thinking there's
> something wrong about it, but I can't quite put my finger on it...
> 
> Where is your reg.h?
> 
> What versions of arm-linux tools are you using?  I may just have to
> start from scratch here...

ARM should not have sys/reg.h.  That means you mis-ran configure.

You can't build gdbserver inside a cross-gdb tree.  It has to be a
_target_ _native_ gdb tree (i.e. --host).

I don't think ARM gdbserver builds at the moment, though.  If it does
I'll be pleasantly surprised.

What Keith said about configury won't work.  However, you don't need to
run make in the gdb dir, just configure.


-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer


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

* Re: Patch for arm-linux gdbserver
  2002-01-31 15:10     ` Daniel Jacobowitz
@ 2002-01-31 15:21       ` Peter Barada
  2002-02-01  7:36         ` Daniel Jacobowitz
  0 siblings, 1 reply; 9+ messages in thread
From: Peter Barada @ 2002-01-31 15:21 UTC (permalink / raw)
  To: drow; +Cc: bgat, Keith.Walker, crossgcc, gdb


>You can't build gdbserver inside a cross-gdb tree.  It has to be a
>_target_ _native_ gdb tree (i.e. --host).

What is the correct 'configure' to get a buildable gdbserver from
gdb-5.1 for powerpc-linux, while building on a x86 linux machine?
What are the complete steps?

TIA

-- 
Peter Barada                                   Peter.Barada@motorola.com
Wizard                                         781-852-2768 (direct)
WaveMark Solutions(wholly owned by Motorola)   781-270-0193 (fax)


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

* Re: Patch for arm-linux gdbserver
  2002-01-31 15:21       ` Peter Barada
@ 2002-02-01  7:36         ` Daniel Jacobowitz
  2002-02-01 10:34           ` Peter Barada
  0 siblings, 1 reply; 9+ messages in thread
From: Daniel Jacobowitz @ 2002-02-01  7:36 UTC (permalink / raw)
  To: Peter Barada; +Cc: bgat, Keith.Walker, crossgcc, gdb

On Thu, Jan 31, 2002 at 06:21:20PM -0500, Peter Barada wrote:
> 
> >You can't build gdbserver inside a cross-gdb tree.  It has to be a
> >_target_ _native_ gdb tree (i.e. --host).
> 
> What is the correct 'configure' to get a buildable gdbserver from
> gdb-5.1 for powerpc-linux, while building on a x86 linux machine?
> What are the complete steps?

Simply configure with --host=powerpc-linux.  Then run configure
separately in the gdbserver directory if it did not get done, and make.

Note that to do that first step $CC must be a cross compiler.

Also note that PPC support for gdbserver is not currently available,
and may go in in a few days depending on some other factors.

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer


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

* Re: Patch for arm-linux gdbserver
  2002-02-01  7:36         ` Daniel Jacobowitz
@ 2002-02-01 10:34           ` Peter Barada
  2002-02-01 11:03             ` William A. Gatliff
  2002-02-01 11:30             ` Daniel Jacobowitz
  0 siblings, 2 replies; 9+ messages in thread
From: Peter Barada @ 2002-02-01 10:34 UTC (permalink / raw)
  To: drow; +Cc: bgat, Keith.Walker, crossgcc, gdb


>Simply configure with --host=powerpc-linux.  Then run configure
>separately in the gdbserver directory if it did not get done, and make.
>
>Note that to do that first step $CC must be a cross compiler.
>
>Also note that PPC support for gdbserver is not currently available,
>and may go in in a few days depending on some other factors.

Ok, I built a m68k-linux compiler, and attempted:

CC=m68k-linux-gcc AR=m68k-linux-ar RANLIB=m68k-linux-ranlib LD=m68k-linux-ld /home/pbarada/work/cvs-wavemark/cross-linux-tools/gdb-5.0.93/configure --host=m68k-linux

To configure a m68k-linux version of gdbserver to be built on my x86
box.  Unfortunately configure fails.  From gleaning over the output, I
see two things, the first I'm not sure about and the second is a problem:

Created "Makefile" in /home/pbarada/work/cvs-wavemark/cross-linux-tools/obj-crap-linux/m68k-linux/build-gdb using "mt-frag"
/home/pbarada/work/cvs-wavemark/cross-linux-tools/gdb-5.0.93/configure: ./if1747: cannot execute binary file
Configuring intl...
creating cache ../config.cache

I don't think configure should try to run a cross-compiled
executable...

checking compiler warning flags...  -Wimplicit -Wreturn-type -Wcomment -Wtrigraphs -Wformat -Wparentheses -Wpointer-arith -Wuninitialized
checking for cygwin... no
checking for tgetent in -lncurses... (cached) no
checking for tgetent in -lHcurses... no
checking for tgetent in -ltermlib... no
checking for tgetent in -ltermcap... (cached) no
checking for tgetent in -lcurses... (cached) no
checking for tgetent in -lterminfo... no
configure: error: Could not find a term library
Configure in /home/pbarada/work/cvs-wavemark/cross-linux-tools/obj-crap-linux/m68k-linux/build-gdb/gdb failed, exiting.

Since I'm not trying to run *gdb* on the target, but just *gdbserver*,
how can I get configure to ignore the missing term library and produce
a proper configuration?  This is the problem I had the last time I did
this, and ended up resorting to configureing it by *hand*.

-- 
Peter Barada                                   Peter.Barada@motorola.com
Wizard                                         781-852-2768 (direct)
WaveMark Solutions(wholly owned by Motorola)   781-270-0193 (fax)


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

* Re: Patch for arm-linux gdbserver
  2002-02-01 10:34           ` Peter Barada
@ 2002-02-01 11:03             ` William A. Gatliff
  2002-02-01 11:30             ` Daniel Jacobowitz
  1 sibling, 0 replies; 9+ messages in thread
From: William A. Gatliff @ 2002-02-01 11:03 UTC (permalink / raw)
  To: Peter Barada; +Cc: crossgcc, gdb

Peter:


After I built my arm-linux toolchain, I built ncurses:


$ BUILD_CC=gcc CXX=arm-linux-g++ CC=arm-linux-gcc ../ncurses-5.2/configure --host=arm-linux --build=i386-linux --prefix=/home/bgat/H-arm-cerfpod-linux-gnu
$ make all install

It dies when it runs "tic" during installation, for the obvious
reason: tic is a target executable, not a build one.  No problem, you
get libtermcap anyway.  :^)

I also built bfd, using a similar command, so that gdb would find a bfd.h.

Then I successfully configured gdb (cvs), like this:

$ ../gdb/configure --host=arm-linux --build=i386-linux --prefix=/home/bgat/H-arm-cerfpod-linux-gnu

So far, so far... :^)


b.g.


On Fri, Feb 01, 2002 at 01:33:50PM -0500, Peter Barada wrote:
> 
> >Simply configure with --host=powerpc-linux.  Then run configure
> >separately in the gdbserver directory if it did not get done, and make.
> >
> >Note that to do that first step $CC must be a cross compiler.
> >
> >Also note that PPC support for gdbserver is not currently available,
> >and may go in in a few days depending on some other factors.
> 
> Ok, I built a m68k-linux compiler, and attempted:
> 
> CC=m68k-linux-gcc AR=m68k-linux-ar RANLIB=m68k-linux-ranlib LD=m68k-linux-ld /home/pbarada/work/cvs-wavemark/cross-linux-tools/gdb-5.0.93/configure --host=m68k-linux
> 
> To configure a m68k-linux version of gdbserver to be built on my x86
> box.  Unfortunately configure fails.  From gleaning over the output, I
> see two things, the first I'm not sure about and the second is a problem:
> 
> Created "Makefile" in /home/pbarada/work/cvs-wavemark/cross-linux-tools/obj-crap-linux/m68k-linux/build-gdb using "mt-frag"
> /home/pbarada/work/cvs-wavemark/cross-linux-tools/gdb-5.0.93/configure: ./if1747: cannot execute binary file
> Configuring intl...
> creating cache ../config.cache
> 
> I don't think configure should try to run a cross-compiled
> executable...
> 
> checking compiler warning flags...  -Wimplicit -Wreturn-type -Wcomment -Wtrigraphs -Wformat -Wparentheses -Wpointer-arith -Wuninitialized
> checking for cygwin... no
> checking for tgetent in -lncurses... (cached) no
> checking for tgetent in -lHcurses... no
> checking for tgetent in -ltermlib... no
> checking for tgetent in -ltermcap... (cached) no
> checking for tgetent in -lcurses... (cached) no
> checking for tgetent in -lterminfo... no
> configure: error: Could not find a term library
> Configure in /home/pbarada/work/cvs-wavemark/cross-linux-tools/obj-crap-linux/m68k-linux/build-gdb/gdb failed, exiting.
> 
> Since I'm not trying to run *gdb* on the target, but just *gdbserver*,
> how can I get configure to ignore the missing term library and produce
> a proper configuration?  This is the problem I had the last time I did
> this, and ended up resorting to configureing it by *hand*.
> 
> -- 
> Peter Barada                                   Peter.Barada@motorola.com
> Wizard                                         781-852-2768 (direct)
> WaveMark Solutions(wholly owned by Motorola)   781-270-0193 (fax)
> 

-- 
Bill Gatliff
bgat@billgatliff.com


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

* Re: Patch for arm-linux gdbserver
  2002-02-01 10:34           ` Peter Barada
  2002-02-01 11:03             ` William A. Gatliff
@ 2002-02-01 11:30             ` Daniel Jacobowitz
  2002-02-01 12:02               ` William A. Gatliff
  1 sibling, 1 reply; 9+ messages in thread
From: Daniel Jacobowitz @ 2002-02-01 11:30 UTC (permalink / raw)
  To: Peter Barada; +Cc: bgat, Keith.Walker, crossgcc, gdb

On Fri, Feb 01, 2002 at 01:33:50PM -0500, Peter Barada wrote:
> 
> >Simply configure with --host=powerpc-linux.  Then run configure
> >separately in the gdbserver directory if it did not get done, and make.
> >
> >Note that to do that first step $CC must be a cross compiler.
> >
> >Also note that PPC support for gdbserver is not currently available,
> >and may go in in a few days depending on some other factors.
> 
> Ok, I built a m68k-linux compiler, and attempted:
> 
> CC=m68k-linux-gcc AR=m68k-linux-ar RANLIB=m68k-linux-ranlib LD=m68k-linux-ld /home/pbarada/work/cvs-wavemark/cross-linux-tools/gdb-5.0.93/configure --host=m68k-linux
> 
> To configure a m68k-linux version of gdbserver to be built on my x86
> box.  Unfortunately configure fails.  From gleaning over the output, I
> see two things, the first I'm not sure about and the second is a problem:
> 
> Created "Makefile" in /home/pbarada/work/cvs-wavemark/cross-linux-tools/obj-crap-linux/m68k-linux/build-gdb using "mt-frag"
> /home/pbarada/work/cvs-wavemark/cross-linux-tools/gdb-5.0.93/configure: ./if1747: cannot execute binary file
> Configuring intl...
> creating cache ../config.cache
> 
> I don't think configure should try to run a cross-compiled
> executable...

That's normal.  I think more recent autoconf suppresses the message,
but I'm not sure.

> checking compiler warning flags...  -Wimplicit -Wreturn-type -Wcomment -Wtrigraphs -Wformat -Wparentheses -Wpointer-arith -Wuninitialized
> checking for cygwin... no
> checking for tgetent in -lncurses... (cached) no
> checking for tgetent in -lHcurses... no
> checking for tgetent in -ltermlib... no
> checking for tgetent in -ltermcap... (cached) no
> checking for tgetent in -lcurses... (cached) no
> checking for tgetent in -lterminfo... no
> configure: error: Could not find a term library
> Configure in /home/pbarada/work/cvs-wavemark/cross-linux-tools/obj-crap-linux/m68k-linux/build-gdb/gdb failed, exiting.
> 
> Since I'm not trying to run *gdb* on the target, but just *gdbserver*,
> how can I get configure to ignore the missing term library and produce
> a proper configuration?  This is the problem I had the last time I did
> this, and ended up resorting to configureing it by *hand*.

Basically, this is because we abuse gdb's configure quite badly.  I
recommend that you build a small curses library or grab one from an
m68k disribution or what-have-you, and ignore the problem for now. 
I'll see about fixing this a little down the road.

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer


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

* Re: Patch for arm-linux gdbserver
  2002-02-01 11:30             ` Daniel Jacobowitz
@ 2002-02-01 12:02               ` William A. Gatliff
  0 siblings, 0 replies; 9+ messages in thread
From: William A. Gatliff @ 2002-02-01 12:02 UTC (permalink / raw)
  To: crossgcc, gdb

Guys:


Got it!  Well, it *builds* anyway.  My arm-linux target is so messed
up right now, it'll be a few hours before I can run it.

See previous posts on building ncurses and bfd, and configuring gdb
for --host=arm-linux...  Here's where I hacked next.

After configuring gdb, edit <builddir>/gdbserver/Makefile:

I changed BFD_CFLAGS to this:

BFD_CFLAGS = -I$(BFD_DIR) -I$(BFD_SRC) \
    -I/home/bgat/H-arm-cerfpod-linux-gnu/include

Because that's where my bfd.h is.  Next, I added this to INCLUDE_CFLAGS:

-I /home/bgat/H-arm-cerfpod-linux-gnu/arm-linux/include

because that's where I put my target-specific toolchain, in particular
my configured linux kernel headers (including all the symlinks).

Then I created a bogus include/sys dir and reg.h:

mkdir -p /home/bgat/H-arm-cerfpod-linux-gnu/arm-linux/include/sys
touch /home/bgat/H-arm-cerfpod-linux-gnu/arm-linux/include/sys/reg.h

I couldn't figure out the right way to unset the #define in
low-linux.c, so I figured why not...

Finally, I added -static to GLOBAL_CFLAGS.

Then it's:

$  CC=arm-linux-gcc make
$  file gdbserver
gdbserver: ELF 32-bit LSB executable, ARM, version 1, statically linked, not stripped


But does the resulting executable *work*?  I'll know in a bit.


> Basically, this is because we abuse gdb's configure quite badly.  I
> recommend that you build a small curses library or grab one from an
> m68k disribution or what-have-you, and ignore the problem for now. 
> I'll see about fixing this a little down the road.

Yea, we're doing a number on it here.  :^)



b.g.
-- 
Bill Gatliff
bgat@billgatliff.com


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

end of thread, other threads:[~2002-02-01 20:02 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-31  9:36 Patch for arm-linux gdbserver William A. Gatliff
     [not found] ` <4.1.20020131181535.00b40f00@mhsun1.maidenhead.arm.com>
2002-01-31 13:36   ` William A. Gatliff
2002-01-31 15:10     ` Daniel Jacobowitz
2002-01-31 15:21       ` Peter Barada
2002-02-01  7:36         ` Daniel Jacobowitz
2002-02-01 10:34           ` Peter Barada
2002-02-01 11:03             ` William A. Gatliff
2002-02-01 11:30             ` Daniel Jacobowitz
2002-02-01 12:02               ` William A. Gatliff

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox