This is the mail archive of the libc-ports@sources.redhat.com mailing list for the libc-ports project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH][RFC] Fix MIPS struct sigcontext redefinition


Hi,

While compiling strace package for mips, I got below error:
error: redefinition of 'struct sigcontext'

Toolchain I used was gcc-4.1.1 / glibc-2.5 / binutils-2.17.50.0.6.

Below is reduced sample:

$ cat sigtest.c 
#include <signal.h>
#include <asm/sigcontext.h>
$ mips-unknown-linux-gcc sigtest.c -c
In file included from sigtest.c:2:
/usr/local/mips-unknown-linux/devel/target/usr/include/asm/sigcontext.h:20: error: redefinition of 'struct sigcontext'

Below is the patch to fix the problem. Is this patch fine?
_ASM_SIGCONTEXT_H was defined in glibc-2.3.6, and I mimiced that.

Best Regards,

(Hiroki Kaminaga)
t
--


Index: glibc-ports-2.5/ChangeLog.mips
===================================================================
--- glibc-ports-2.5.orig/ChangeLog.mips
+++ glibc-ports-2.5/ChangeLog.mips
@@ -1,3 +1,7 @@
+2006-12-22 Hiroki Kaminaga <kaminaga@sm.sony.co.jp>
+
+	* sysdeps/unix/sysv/linux/mips/bits/sigcontext.h Add _ASM_SIGCONTEXT_H
+
 2006-09-22  Richard Sandiford  <richard@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/mips/xstatconv.c: Remove STAT_IS_KERNEL_STAT
Index: glibc-ports-2.5/sysdeps/unix/sysv/linux/mips/bits/sigcontext.h
===================================================================
--- glibc-ports-2.5.orig/sysdeps/unix/sysv/linux/mips/bits/sigcontext.h
+++ glibc-ports-2.5/sysdeps/unix/sysv/linux/mips/bits/sigcontext.h
@@ -27,6 +27,9 @@
 
 #if _MIPS_SIM == _ABIO32
 
+#ifndef _ASM_SIGCONTEXT_H
+#define _ASM_SIGCONTEXT_H
+
 /* Certain unused fields were replaced with new ones in 2.6.12-rc4.
    The changes were as follows:
 
@@ -59,8 +62,11 @@ struct sigcontext {
   unsigned long sc_lo3;
 };
 
+#endif /* _ASM_SIGCONTEXT_H */
 #else
 
+#ifndef _ASM_SIGCONTEXT_H
+#define _ASM_SIGCONTEXT_H
 /* This structure changed in 2.6.12-rc4 when DSP support was added.  */
 struct sigcontext {
   unsigned long long sc_regs[32];
@@ -80,5 +86,6 @@ struct sigcontext {
   unsigned int sc_reserved;
 };
 
+#endif /* _ASM_SIGCONTEXT_H */
 #endif /* _MIPS_SIM != _ABIO32 */
 #endif


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]