Re: build/955: build failure with GDB-5.3: sparc-nat.c structure redefinition errors with sparc64-linux, glibc-2.2.x

Nix <[email protected]>
Newsgroups gmane.linux.aurora.devel,gmane.comp.gdb.bugs.discuss
Message-ID <[email protected]>
On Sun, 27 Apr 2003, Christian Jönsson spake:
> http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&databas
> e=gdb&pr=955
> 
> Is *anything* happening on this issue in gdb cvs HEAD?

My apologies for not following up; this patch, abstracted from Debian
(where fading memory tells me it is due to Daniel Jacobowitz), fixes it,
but is probably too ugly to go in; the incompatibility test should
really be done by configure:

Index: gdb/gdb/sparc-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/sparc-nat.c,v
retrieving revision 1.13.12.1
diff -u -r1.13.12.1 sparc-nat.c
--- gdb/gdb/sparc-nat.c	3 Dec 2002 22:35:49 -0000	1.13.12.1
+++ gdb/gdb/sparc-nat.c	27 Apr 2003 14:39:53 -0000
@@ -33,6 +33,13 @@
 #include <sys/ptrace.h>
 #include <sys/wait.h>
 #ifdef __linux__
+/* Sadly, <sys/ucontext.h> conflicts with <asm/reg.h> on Linux.  And
+   -D_GNU_SOURCE brings in <sys/ucontext.h> implicitly with <signal.h>.
+   Hack around this.  */
+#undef FPU_REGS_TYPE
+#define fpu asm_reg_fpu
+#define fq asm_reg_fq
+#define fpq asm_reg_fpq
 #include <asm/reg.h>
 #else
 #include <machine/reg.h>


-- 
`It is an unfortunate coincidence that the date locarchive.h was
 written (in hex) matches Ritchie's birthday (in octal).'
               -- Roland McGrath on the libc-alpha list
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.