* x86-linux -> x86-pe GDB will not configure
@ 2001-07-11 15:50 Stephen Smith
2001-07-13 12:22 ` GDB for PE/Cywin target won't build on linux Stephen Smith
0 siblings, 1 reply; 9+ messages in thread
From: Stephen Smith @ 2001-07-11 15:50 UTC (permalink / raw)
To: GDB
I am trying to build a redhat 7.1 hosted i686-pc-pe targeted gdb debugger. I currently
have build a powerpc-motorola-elf targeted version hosted on the redhat box.
If I set target=i686-pc-pe, the insight configure works until it gets to the gdb
directory and then gives me the Error: "GDB does not support the target i686-pc-pe"
I then looked at the gdb/configure.in file and concluded 1139 to 1148 that if I did the followin everything would work:
# At least as of the 20010502 snapshot, most of the packages support the
# i386-pc-pe format except for gdb which supports i386-pc-cygwin and not
# visversa ... so we need to let get know that the two are the same.
# cd $curdir/insight-${insight_version}/gdb/config/i386
if [ ! -f pe.mh -a -f cygwin.mh ] ; then cp -p cygwin.mh pe.mh; fi
if [ ! -f pe.mt -a -f cygwin.mt ] ; then cp -p cygwin.mt pe.mt; fi
if [ ! -f tm-pe.h -a -f tm-cygwin.h ] ; then cp -p tm-cygwin.h tm-pe.h; fi
if [ ! -f xm-pe.h -a -f xm-cygwin.h ] ; then cp -p xm-cygwin.h xm-pe.mh; fi
# Also, the 485, 586, and 686 CPUs aren't mentioned at all.
cd ..
if [ ! -d i486 -a ! -L i486 -a ! -e i486 ] ; then ln -s i386 i486; fi
if [ ! -d i586 -a ! -L i586 -a ! -e i586 ] ; then ln -s i386 i586; fi
if [ ! -d i686 -a ! -L i686 -a ! -e i686 ] ; then ln -s i386 i686; fi
It still doesn't work.
Does anyone have a suggestion?
sps
^ permalink raw reply [flat|nested] 9+ messages in thread
* GDB for PE/Cywin target won't build on linux
2001-07-11 15:50 x86-linux -> x86-pe GDB will not configure Stephen Smith
@ 2001-07-13 12:22 ` Stephen Smith
2001-07-13 14:41 ` DJ Delorie
0 siblings, 1 reply; 9+ messages in thread
From: Stephen Smith @ 2001-07-13 12:22 UTC (permalink / raw)
To: GDB
I have tried several options. Is there anyone who can help.
I have even looked at the configure scripts, Changed what I believed needed changing and it still doesn't build.
sps
Stephen Smith wrote:
> I am trying to build a redhat 7.1 hosted i686-pc-pe targeted gdb debugger. I currently
> have build a powerpc-motorola-elf targeted version hosted on the redhat box.
>
> If I set target=i686-pc-pe, the insight configure works until it gets to the gdb
> directory and then gives me the Error: "GDB does not support the target i686-pc-pe"
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: GDB for PE/Cywin target won't build on linux
2001-07-13 12:22 ` GDB for PE/Cywin target won't build on linux Stephen Smith
@ 2001-07-13 14:41 ` DJ Delorie
2001-07-13 15:02 ` Stephen Smith
0 siblings, 1 reply; 9+ messages in thread
From: DJ Delorie @ 2001-07-13 14:41 UTC (permalink / raw)
To: ischis2; +Cc: gdb
If you're targetting Cygwin, the correct target is i686-pc-cygwin.
There are other systems that are not Cygwin but are PE (Interix,
MinGW, WinCE), but may not be supported by as many modules (such as
gdb) as Cygwin itself is. The reason is that, perhaps, Cygwin
provides additional APIs that are needed for the gdb (or whatever)
port.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: GDB for PE/Cywin target won't build on linux
2001-07-13 14:41 ` DJ Delorie
@ 2001-07-13 15:02 ` Stephen Smith
[not found] ` <200107132206.SAA27799@greed.delorie.com>
2001-07-16 11:49 ` Stephen Smith
0 siblings, 2 replies; 9+ messages in thread
From: Stephen Smith @ 2001-07-13 15:02 UTC (permalink / raw)
To: DJ Delorie; +Cc: gdb
No, I'm not targeting cygwin, but an embedded OS that uses the PE executable format. There are a bunch of us
Linux geeks here that would prefer to ditch NT/Cygwin for Linux.
Currently I cross compile GCC/GDB for x86-cygwin -> powerpc-motorola-elf,
x86-linux -> powerpc-motorola-elf, x86-linux -> x86-pc-pe (gcc only).
DJ Delorie wrote:
> If you're targetting Cygwin, the correct target is i686-pc-cygwin.
> There are other systems that are not Cygwin but are PE (Interix,
> MinGW, WinCE), but may not be supported by as many modules (such as
> gdb) as Cygwin itself is. The reason is that, perhaps, Cygwin
> provides additional APIs that are needed for the gdb (or whatever)
> port.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: GDB for PE/Cywin target won't build on linux
[not found] ` <200107132206.SAA27799@greed.delorie.com>
@ 2001-07-13 15:26 ` Stephen Smith
0 siblings, 0 replies; 9+ messages in thread
From: Stephen Smith @ 2001-07-13 15:26 UTC (permalink / raw)
To: DJ Delorie; +Cc: GDB
Hmm ... I guess that I will learn alot. However, if I compile insight/gdb natively on a
Windows NT/Cygwin box, I have no trouble debugging my embedded machine so maybe
it won't be too bad.
DJ Delorie wrote:
> FYI gdb is one of those things that usually needs to be customized for
> each new type of embedded thingy. The existing cygwin config, for
> example, assumes it's native on a Win32 platform.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: GDB for PE/Cywin target won't build on linux
2001-07-13 15:02 ` Stephen Smith
[not found] ` <200107132206.SAA27799@greed.delorie.com>
@ 2001-07-16 11:49 ` Stephen Smith
2001-07-16 12:33 ` Kevin Buettner
1 sibling, 1 reply; 9+ messages in thread
From: Stephen Smith @ 2001-07-16 11:49 UTC (permalink / raw)
To: DJ Delorie, gdb, Kevin Buettner
Since the embedded target OS is close to windows/cygwin in functionality, I choose to
try the config/i386/cygwin.mt file.
Therefore, I added the following line to configure.tgt
i[3456]86-*-pe*) gdb_target=cygwin ;;
I then did the usual configure/make step and recieved the following error sequence. The wierd pard is that the missing
symbols are in gdb/win32-nat.c which isn't getting compiled. The file is listed in the ALLDEPFILES, but isn't listed
in TSOBS, COMMON_OBS, or ADD_FILES.
Am I correct in assuming that it needs to be listed somewhere else? Is there a gdb way, or should I do what looks good.
--------------------- error trace -----------------------
make[1]: Entering directory `/usr/local/cross-compilers/cross-source/build-insight-i686-pc-pe/gdb'
rm -f gdb
gcc -g -O2 -o gdb \
main.o libgdb.a cli-decode.o cli-script.o cli-cmds.o cli-setshow.o cli-utils.o gdbtk.o gdbtk-cmds.o gdbtk-hooks.o gdbtk-
varobj.o gdbtk-wrapper.o ../bfd/libbfd.a ../readline/libreadline.a ../opcodes/libopcodes.a ../libiberty/libiberty.a
-lncurses ../libgui/src/libgui.a -L/usr/local/cross-compilers/cross-source/build-insight-i686-pc-pe/itcl/itcl/unix -l
itcl3.0 -L/usr/local/cross-compilers/cross-source/build-insight-i686-pc-pe/itcl/itk/unix -litk3.0 -L/usr/local/cross-com
pilers/cross-source/build-insight-i686-pc-pe/tix/unix/tk8.0 -ltix4.1.8.0 -L/usr/local/cross-compilers/cross-source/build
-insight-i686-pc-pe/tk/unix -ltk8.0 -L/usr/local/cross-compilers/cross-source/build-insight-i686-pc-pe/tcl/unix -ltcl8.0
-L/usr/X11R6/lib -lX11 -ldl -lieee -lm -lm ../libiberty/libiberty.a \
-ldl -rdynamic
/usr/local/cross-compilers/cross-source/build-insight-i686-pc-pe/tcl/unix/libtcl8.0.a(tclUnixPipe.o): In function
`TclpCreateTempFile':
/usr/local/cross-compilers/cross-source/build-insight-i686-pc-pe/tcl/unix/../../../insight-20010502/tcl/unix/tclUnixPipe.c:188:
the use of `tmpnam' is dangerous, better use `mkstemp'
libgdb.a(symfile.o): In function `add_shared_symbol_files_command':
/usr/local/cross-compilers/cross-source/build-insight-i686-pc-pe/gdb/../../insight-20010502/gdb/symfile.c:1559:
undefined reference to `dll_symbol_command'
libgdb.a(infcmd.o): In function `attach_command':
/usr/local/cross-compilers/cross-source/build-insight-i686-pc-pe/gdb/../../insight-20010502/gdb/infcmd.c:1716: undefined
reference to `child_solib_add'
libgdb.a(infrun.o): In function `handle_inferior_event':
/usr/local/cross-compilers/cross-source/build-insight-i686-pc-pe/gdb/../../insight-20010502/gdb/infrun.c:1558: undefined
reference to `child_solib_add'
/usr/local/cross-compilers/cross-source/build-insight-i686-pc-pe/gdb/../../insight-20010502/gdb/infrun.c:2479: undefined
reference to `child_solib_add'
libgdb.a(breakpoint.o): In function `bpstat_get_triggered_catchpoints':
/usr/local/cross-compilers/cross-source/build-insight-i686-pc-pe/gdb/../../insight-20010502/gdb/breakpoint.c:3037:
undefined reference to `child_solib_loaded_library_pathname'
collect2: ld returned 1 exit status
make[1]: *** [gdb] Error 1
make[1]: Leaving directory `/usr/local/cross-compilers/cross-source/build-insight-i686-pc-pe/gdb'
make: *** [install-gdb] Error 2
[ssmith@az75-linuxbox cross-source]$
Kevin Buettner wrote:
>
> You shouldn't need a *.mh file. You might try using
> config/i386/embed.mt
> and config/i386/tm-embed.h. I.e, just add
>
> i[3456]86-*-pe*) gdb_target=embed ;;
>
> to configure.tgt and see where that gets you.
>
> Kevin
Stephen Smith wrote:
> No, I'm not targeting cygwin, but an embedded OS that uses the PE executable format. There are a bunch of us
> Linux geeks here that would prefer to ditch NT/Cygwin for Linux.
>
> Currently I cross compile GCC/GDB for x86-cygwin -> powerpc-motorola-elf,
> x86-linux -> powerpc-motorola-elf, x86-linux -> x86-pc-pe (gcc only).
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: GDB for PE/Cywin target won't build on linux
2001-07-16 11:49 ` Stephen Smith
@ 2001-07-16 12:33 ` Kevin Buettner
2001-07-16 12:52 ` DJ Delorie
2001-07-16 14:27 ` Stephen Smith
0 siblings, 2 replies; 9+ messages in thread
From: Kevin Buettner @ 2001-07-16 12:33 UTC (permalink / raw)
To: Stephen Smith, DJ Delorie, gdb, Kevin Buettner
On Jul 16, 11:49am, Stephen Smith wrote:
> Since the embedded target OS is close to windows/cygwin in
> functionality, I choose to try the config/i386/cygwin.mt file.
>
> Therefore, I added the following line to configure.tgt
> i[3456]86-*-pe*) gdb_target=cygwin ;;
I'm not convinced this was the best idea, but it was certainly
worth a try.
> I then did the usual configure/make step and recieved the following
> error sequence. The wierd pard is that the missing symbols are in
> gdb/win32-nat.c which isn't getting compiled. The file is listed in
> the ALLDEPFILES, but isn't listed in TSOBS, COMMON_OBS, or
> ADD_FILES.
It appears to me that you can't build a cross debugger where cygwin
is the target. This is unfortunate, but it appears that the shared
library support requires that you run a native GDB.
> Am I correct in assuming that it needs to be listed somewhere else?
> Is there a gdb way, or should I do what looks good.
I think you should abandon the ``gdb_target=cygwin'' approach. The
shared library support in win32-nat.c will not do what you want for a
cross debugger. I've glanced over the code and it does not look easy
to fix it for your purposes either. This is why it's in win32-nat.c
instead of somewhere else. Ideally though, I think it would be a
good idea for the solib support to be migrated to solib-win32 or somesuch.
That way it could make use of the existing (common) solib machinery,
though it would still not support cross debugging without some
significant rewriting and cooperation from gdbserver.
For your purposes, I think it'd be better to just use ``gdb_target=embed''.
You'll avoid the shared library nightmares that way. If you find that
you need some sort of shared library support, you'll have to implement
it separately. (This'll likely mean creating a new *.mt file, a new
tm-*.h file, and a new solib-*.c file which'll have the shared library
support that you need.)
Kevin
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: GDB for PE/Cywin target won't build on linux
2001-07-16 12:33 ` Kevin Buettner
@ 2001-07-16 12:52 ` DJ Delorie
2001-07-16 14:27 ` Stephen Smith
1 sibling, 0 replies; 9+ messages in thread
From: DJ Delorie @ 2001-07-16 12:52 UTC (permalink / raw)
To: kevinb; +Cc: ischis2, gdb, kevinb
> I think you should abandon the ``gdb_target=cygwin'' approach. The
> shared library support in win32-nat.c will not do what you want for a
> cross debugger.
Perhaps the wince.c stuff would be a better starting point? That's a
PE system that isn't a native windows debugger.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: GDB for PE/Cywin target won't build on linux
2001-07-16 12:33 ` Kevin Buettner
2001-07-16 12:52 ` DJ Delorie
@ 2001-07-16 14:27 ` Stephen Smith
1 sibling, 0 replies; 9+ messages in thread
From: Stephen Smith @ 2001-07-16 14:27 UTC (permalink / raw)
To: Kevin Buettner; +Cc: DJ Delorie, gdb
Once I added the the following patch to configure.tgt everything worked. Thanks for your help.
I will now be working on submitting the patches (for this and the re-submit from before).
[ssmith@az75-linuxbox gdb]$ diff -c -w -b -B configure.tgt.orig configure.tgt
*** configure.tgt.orig Tue Apr 17 14:20:48 2001
--- configure.tgt Mon Jul 16 14:00:00 2001
***************
*** 122,127 ****
--- 122,128 ----
configdirs="${configdirs} nlm" ;;
i[3456]86-*-osf1mk*) gdb_target=i386mk ;;
i[3456]86-*-cygwin*) gdb_target=cygwin ;;
+ i[3456]86-*-pe*) gdb_target=embed ;;
i[3456]86-*-vxworks*) gdb_target=vxworks ;;
i960-*-bout*) gdb_target=vxworks960 ;;
Kevin Buettner wrote:
> On Jul 16, 11:49am, Stephen Smith wrote:
> For your purposes, I think it'd be better to just use ``gdb_target=embed''.
> You'll avoid the shared library nightmares that way. If you find that
> you need some sort of shared library support, you'll have to implement
> it separately. (This'll likely mean creating a new *.mt file, a new
> tm-*.h file, and a new solib-*.c file which'll have the shared library
> support that you need.)
>
> Kevin
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2001-07-16 14:27 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-11 15:50 x86-linux -> x86-pe GDB will not configure Stephen Smith
2001-07-13 12:22 ` GDB for PE/Cywin target won't build on linux Stephen Smith
2001-07-13 14:41 ` DJ Delorie
2001-07-13 15:02 ` Stephen Smith
[not found] ` <200107132206.SAA27799@greed.delorie.com>
2001-07-13 15:26 ` Stephen Smith
2001-07-16 11:49 ` Stephen Smith
2001-07-16 12:33 ` Kevin Buettner
2001-07-16 12:52 ` DJ Delorie
2001-07-16 14:27 ` Stephen Smith
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox