Re: Re: Can't build gdb-5.3: redefinition of `struct fpq', `struct fq', and `struct fpu'

[email protected]
Newsgroups gmane.linux.aurora.devel
Message-ID <[email protected]>
On Thu, Feb 27, 2003 at 04:11:21PM +0100, Christian Joensson wrote:
> On Thu, Feb 27, 2003 at 04:13:07PM +0100, T. Ribbrock wrote:
> > On Thu, Feb 27, 2003 at 01:40:13PM +0100, Christian Joensson wrote:
> > > Aurora SPARC Linux 1.0 (Ansel) SS20 dual SuperSparc-(II) sun4m:
> > [...]
> > >  /usr/local/include
> > >  /usr/lib/gcc-lib/sparc64-redhat-linux/2.96/include
> > [...]
> > > A similar situation occurs for gdb cvs trunk and also for target
> > > sparc64-linux.
> > 
> > Just so I'm understanding you correctly: Are you trying to build 64bit
> > on a 32bit machine or am I misunderstanding something here?
> 
> No, I just unpacked the gdb-5.3 sources in /home/chj/gdb-5.3, then in
> a separate objdir, /home/chj/objdir-gdb-5.3, I did the configure,
> nothing special set, and then tried a build.
> 
> Here's the config.status: 
> 
> #!/bin/sh
> # This file was generated automatically by configure.  Do not edit.
> # This directory was configured as follows:
> /home/chj/gdb-5.3/configure --host=sparc-linux --enable-prefix=/usr/local/gcc-binutils --enable-shared --enable-threads --norecursion 
> #  using "mt-frag"
> 
> That's what came out of it. It's quite easy to try... :-)
> 

Aurora SPARC Linux 1.0 (Ansel) Ultra1 single UltraSparc I sun4u:

binutils 2.13.90 20030212 sparc64-linux
bison-1.35-1
dejagnu-1.4.2-10 (ftp://ftp.redhat.com/pub/redhat/linux/rawhide/SRPMS/SRPMS)
expect-5.32.2-67
gcc-2.96-113
glibc-2.2.5-42
glibc-kernheaders-2.4-7.16sparc
glibc64-2.2.5-42
kernel-2.4.19-1.2sparc (from Aurora SPARC Linux 0.42)
tcl-8.3.3-67

This is how it looks like on this machine, yes, I have a few
sparcs..., (using sparc32 and then for target sparc-linux):

#!/bin/sh
# This file was generated automatically by configure.  Do not edit.
# This directory was configured as follows:
/home/chj/gdb-5.3/configure --host=sparc-linux --prefix=/usr/local/gcc-binutils --enable-shared --enable-threads --norecursion 
#  using "mt-frag"

make: Entering directory `/home/chj/objdir-gdb-5.3-sparc64/gdb'
gcc -v -save-tempsà -c -O2 -m32 -mtune=ultrasparc    -I. -I/home/chj/gdb-5.3/gdb -I/home/chj/gdb-5.3/gdb/config -DLOCALEDIR="\"/usr/local/gcc-binutils/share/locale\"" -DHAVE_CONFIG_H -I/home/chj/gdb-5.3/gdb/../include/opcode -I/home/chj/gdb-5.3/gdb/../readline/.. -I../bfd -I/home/chj/gdb-5.3/gdb/../bfd  -I/home/chj/gdb-5.3/gdb/../include -I../intl -I/home/chj/gdb-5.3/gdb/../intl -D_BSD_SOURCE -D_XOPEN_SOURCE=500 -D_LARGEFILE64_SOURCE  -DMI_OUT=1 -DUI_OUT=1 -Wimplicit -Wreturn-type -Wcomment -Wtrigraphs -Wformat -Wparentheses -Wpointer-arith -Wuninitialized  /home/chj/gdb-5.3/gdb/sparc-nat.c
Reading specs from /usr/lib/gcc-lib/sparc64-redhat-linux/2.96/specs
gcc: unrecognized option `-save-tempsÃ'
gcc version 2.96 20000731 (Red Hat Linux 7.3 2.96-113)
 /usr/lib/gcc-lib/sparc64-redhat-linux/2.96/cpp0 -lang-c -v -I. -I/home/chj/gdb-5.3/gdb -I/home/chj/gdb-5.3/gdb/config -I/home/chj/gdb-5.3/gdb/../include/opcode -I/home/chj/gdb-5.3/gdb/../readline/.. -I../bfd -I/home/chj/gdb-5.3/gdb/../bfd -I/home/chj/gdb-5.3/gdb/../include -I../intl -I/home/chj/gdb-5.3/gdb/../intl -D__GNUC__=2 -D__GNUC_MINOR__=96 -D__GNUC_PATCHLEVEL__=0 -D__ELF__ -Dunix -D_LONGLONG -D__sparc__ -Dlinux -D__ELF__ -D__unix__ -D_LONGLONG -D__sparc__ -D__linux__ -D__unix -D__linux -Asystem(unix) -Asystem(posix) -D__OPTIMIZE__ -Wimplicit -Wreturn-type -Wcomment -Wtrigraphs -Wformat -Wparentheses -Wpointer-arith -Wuninitialized -D__SIZE_TYPE__=unsigned int -D__PTRDIFF_TYPE__=int -D__GCC_NEW_VARARGS__ -Acpu(sparc) -Amachine(sparc) -DLOCALEDIR="/usr/local/gcc-binutils/share/locale" -DHAVE_CONFIG_H -D_BSD_SOURCE -D_XOPEN_SOURCE=500 -D_LARGEFILE64_SOURCE -DMI_OUT=1 -DUI_OUT=1 /home/chj/gdb-5.3/gdb/sparc-nat.c /tmp/ccMApI7P.i
GNU CPP version 2.96 20000731 (Red Hat Linux 7.3 2.96-113) (cpplib) (sparc64 GNU/Linux with ELF)
ignoring nonexistent directory "/usr/sparc64-redhat-linux/include"
#include "..." search starts here:
#include <...> search starts here:
 .
 /home/chj/gdb-5.3/gdb
 /home/chj/gdb-5.3/gdb/config
 /home/chj/gdb-5.3/include/opcode
 /home/chj/gdb-5.3/
 ../bfd
 /home/chj/gdb-5.3/bfd
 /home/chj/gdb-5.3/include
 ../intl
 /home/chj/gdb-5.3/intl
 /usr/local/include
 /usr/lib/gcc-lib/sparc64-redhat-linux/2.96/include
 /usr/include
End of search list.
 /usr/lib/gcc-lib/sparc-redhat-linux/2.96/cc1 /tmp/ccMApI7P.i -quiet -dumpbase sparc-nat.c -m32 -mtune=ultrasparc -O2 -Wimplicit -Wreturn-type -Wcomment -Wtrigraphs -Wformat -Wparentheses -Wpointer-arith -Wuninitialized -version -o /tmp/ccjCbT3g.s
GNU C version 2.96 20000731 (Red Hat Linux 7.3 2.96-113) (sparc-redhat-linux) compiled by GNU C version 2.96 20000731 (Red Hat Linux 7.3 2.96-113).
In file included from /usr/include/asm/reg.h:6,
                 from /home/chj/gdb-5.3/gdb/sparc-nat.c:36:
/usr/include/asm-sparc/reg.h:40: redefinition of `struct fpq'
/usr/include/asm-sparc/reg.h:45: redefinition of `struct fq'
/usr/include/asm-sparc/reg.h:75: redefinition of `struct fpu'
/home/chj/gdb-5.3/gdb/sparc-nat.c: In function `fetch_inferior_registers':
/home/chj/gdb-5.3/gdb/sparc-nat.c:103: warning: implicit declaration of function `memcpy'
make: *** [sparc-nat.o] Error 1
make: Leaving directory `/home/chj/objdir-gdb-5.3-sparc64/gdb'

and this is how it looks on this sun4u for target sparc64-linux (using
a local install of binutils and ncurses, built for target
sparc64-linux):

#!/bin/sh
# This file was generated automatically by configure.  Do not edit.
# This directory was configured as follows:
/home/chj/gdb-5.3/configure --host=sparc64-linux --prefix=/usr/local/gcc-binutils --norecursion 
#  using "mt-frag"

make: Entering directory `/home/chj/objdir-gdb-5.3-sparc64-64/gdb'
gcc -v -save-temps -c -O2 -m64 -mtune=ultrasparc    -I. -I/home/chj/gdb-5.3/gdb -I/home/chj/gdb-5.3/gdb/config -DLOCALEDIR="\"/usr/local/gcc-binutils/share/locale\"" -DHAVE_CONFIG_H -I/home/chj/gdb-5.3/gdb/../include/opcode -I/home/chj/gdb-5.3/gdb/../readline/.. -I../bfd -I/home/chj/gdb-5.3/gdb/../bfd  -I/home/chj/gdb-5.3/gdb/../include -I../intl -I/home/chj/gdb-5.3/gdb/../intl -D_BSD_SOURCE -D_XOPEN_SOURCE=500 -D_LARGEFILE64_SOURCE  -DMI_OUT=1 -DUI_OUT=1 -Wimplicit -Wreturn-type -Wcomment -Wtrigraphs -Wformat -Wparentheses -Wpointer-arith -Wuninitialized  /home/chj/gdb-5.3/gdb/sparc-nat.c
Reading specs from /usr/lib/gcc-lib/sparc64-redhat-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.3 2.96-113)
 /usr/lib/gcc-lib/sparc64-redhat-linux/2.96/cpp0 -lang-c -v -I. -I/home/chj/gdb-5.3/gdb -I/home/chj/gdb-5.3/gdb/config -I/home/chj/gdb-5.3/gdb/../include/opcode -I/home/chj/gdb-5.3/gdb/../readline/.. -I../bfd -I/home/chj/gdb-5.3/gdb/../bfd -I/home/chj/gdb-5.3/gdb/../include -I../intl -I/home/chj/gdb-5.3/gdb/../intl -D__GNUC__=2 -D__GNUC_MINOR__=96 -D__GNUC_PATCHLEVEL__=0 -D__ELF__ -Dunix -D_LONGLONG -D__sparc__ -Dlinux -D__ELF__ -D__unix__ -D_LONGLONG -D__sparc__ -D__linux__ -D__unix -D__linux -Asystem(unix) -Asystem(posix) -D__OPTIMIZE__ -Wimplicit -Wreturn-type -Wcomment -Wtrigraphs -Wformat -Wparentheses -Wpointer-arith -Wuninitialized -D__SIZE_TYPE__=long unsigned int -D__PTRDIFF_TYPE__=long int -D__arch64__ -Acpu(sparc64) -Amachine(sparc64) -DLOCALEDIR="/usr/local/gcc-binutils/share/locale" -DHAVE_CONFIG_H -D_BSD_SOURCE -D_XOPEN_SOURCE=500 -D_LARGEFILE64_SOURCE -DMI_OUT=1 -DUI_OUT=1 /home/chj/gdb-5.3/gdb/sparc-nat.c sparc-nat.i
GNU CPP version 2.96 20000731 (Red Hat Linux 7.3 2.96-113) (cpplib) (sparc64 GNU/Linux with ELF)
ignoring nonexistent directory "/usr/sparc64-redhat-linux/include"
#include "..." search starts here:
#include <...> search starts here:
 .
 /home/chj/gdb-5.3/gdb
 /home/chj/gdb-5.3/gdb/config
 /home/chj/gdb-5.3/include/opcode
 /home/chj/gdb-5.3/
 ../bfd
 /home/chj/gdb-5.3/bfd
 /home/chj/gdb-5.3/include
 ../intl
 /home/chj/gdb-5.3/intl
 /usr/local/include
 /usr/lib/gcc-lib/sparc64-redhat-linux/2.96/include
 /usr/include
End of search list.
 /usr/lib/gcc-lib/sparc64-redhat-linux/2.96/cc1 sparc-nat.i -mptr64 -mstack-bias -mlong-double-128 -mcpu=ultrasparc -mvis -quiet -dumpbase sparc-nat.c -m64 -mtune=ultrasparc -O2 -Wimplicit -Wreturn-type -Wcomment -Wtrigraphs -Wformat -Wparentheses -Wpointer-arith -Wuninitialized -version -o sparc-nat.s
GNU C version 2.96 20000731 (Red Hat Linux 7.3 2.96-113) (sparc64-redhat-linux) compiled by GNU C version 2.96 20000731 (Red Hat Linux 7.3 2.96-113).
In file included from /usr/include/asm/reg.h:4,
                 from /home/chj/gdb-5.3/gdb/sparc-nat.c:36:
/usr/include/asm-sparc64/reg.h:49: redefinition of `struct fpu'
/home/chj/gdb-5.3/gdb/sparc-nat.c: In function `fetch_inferior_registers':
/home/chj/gdb-5.3/gdb/sparc-nat.c:99: warning: cast from pointer to integer of different size
/home/chj/gdb-5.3/gdb/sparc-nat.c:103: warning: implicit declaration of function `memcpy'
/home/chj/gdb-5.3/gdb/sparc-nat.c:105: structure has no member named `r_ps'
/home/chj/gdb-5.3/gdb/sparc-nat.c:106: structure has no member named `r_pc'
/home/chj/gdb-5.3/gdb/sparc-nat.c:107: structure has no member named `r_npc'
/home/chj/gdb-5.3/gdb/sparc-nat.c:129: warning: cast from pointer to integer of different size
/home/chj/gdb-5.3/gdb/sparc-nat.c: In function `store_inferior_registers':
/home/chj/gdb-5.3/gdb/sparc-nat.c:254: structure has no member named `r_ps'
/home/chj/gdb-5.3/gdb/sparc-nat.c:256: structure has no member named `r_pc'
/home/chj/gdb-5.3/gdb/sparc-nat.c:258: structure has no member named `r_npc'
/home/chj/gdb-5.3/gdb/sparc-nat.c:264: warning: cast from pointer to integer of different size
/home/chj/gdb-5.3/gdb/sparc-nat.c:278: warning: cast from pointer to integer of different size
/home/chj/gdb-5.3/gdb/sparc-nat.c: In function `fetch_core_registers':
/home/chj/gdb-5.3/gdb/sparc-nat.c:312: structure has no member named `r_ps'
/home/chj/gdb-5.3/gdb/sparc-nat.c:313: structure has no member named `r_pc'
/home/chj/gdb-5.3/gdb/sparc-nat.c:314: structure has no member named `r_npc'
make: *** [sparc-nat.o] Error 1
make: Leaving directory `/home/chj/objdir-gdb-5.3-sparc64-64/gdb'

Attached is the saved sparc-nat.i.sparc32.gz and
sparc-nat.i.sparc64.gz for the respective target cases.

Cheers,

/ChJ

(Anyone else tried this to confirm my findings or to tell me what a
fool I am enlighten me on how to debug sparc64 binaries... )
sparc-nat.i.sparc32.gz (application/x-gzip, 53.7 KB) - not displayed
sparc-nat.i.sparc64.gz (application/x-gzip, 53.9 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.