This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [SH][PATCH] fix headers for new kernel headers
At 09:38 09/02/17 +0900, Kaz Kojima <kkojima@rr.iij4u.or.jp> wrote:
>
>Did you see the thread
>
>http://sourceware.org/ml/libc-alpha/2009-02/msg00004.html
>
>? Does Andrew's patch fix your problem?
>
Thanks for the reply.
I tried Andrew's patch. It worked for compiling glibc itself, but
'struct user' is needed for compile native gdb. So I modified the patch as follows
and then succeeded.
/glibc
* sysdeps/unix/sysv/linux/sh/sys/procfs.h: Don't include signal.h,
sys/ucontext.h, and asm/elf.h.
(elf_greg_t, ELF_NGREG, elf_gregset_t): Copy from linux asm-sh/elf.h.
* sysdeps/unix/sysv/linux/sh/sys/user.h: Don't include features.h and
asm/user.h.
Don't undef start_thread.
elf_fpregset_t: Copy from linux asm-sh/elf.h.
(user_fpu_struct, user): Copy from linux asm-sh/elf.h.
Index: sysdeps/unix/sysv/linux/sh/sys/procfs.h
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/sh/sys/procfs.h,v
retrieving revision 1.1
diff -u -r1.1 procfs.h
--- sysdeps/unix/sysv/linux/sh/sys/procfs.h 20 Nov 2004 17:56:16 -0000 1.1
+++ sysdeps/unix/sysv/linux/sh/sys/procfs.h 17 Feb 2009 04:35:09 -0000
@@ -24,15 +24,17 @@
used on Linux. */
#include <features.h>
-#include <signal.h>
#include <sys/time.h>
#include <sys/types.h>
-#include <sys/ucontext.h>
#include <sys/user.h>
-#include <asm/elf.h>
__BEGIN_DECLS
+typedef unsigned long elf_greg_t;
+
+#define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t))
+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
+
struct elf_siginfo
{
int si_signo; /* Signal number. */
Index: sysdeps/unix/sysv/linux/sh/sys/user.h
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/sh/sys/user.h,v
retrieving revision 1.4
diff -u -r1.4 user.h
--- sysdeps/unix/sysv/linux/sh/sys/user.h 8 Feb 2003 02:32:42 -0000 1.4
+++ sysdeps/unix/sysv/linux/sh/sys/user.h 17 Feb 2009 04:35:09 -0000
@@ -19,10 +19,31 @@
#ifndef _SYS_USER_H
#define _SYS_USER_H 1
-#include <features.h>
+#include <asm/ptrace.h>
-#include <asm/user.h>
-
-#undef start_thread
+struct user_fpu_struct {
+ unsigned long fp_regs[16];
+ unsigned long xfp_regs[16];
+ unsigned long fpscr;
+ unsigned long fpul;
+};
+typedef struct user_fpu_struct elf_fpregset_t;
+
+struct user {
+ struct pt_regs regs; /* entire machine state */
+ struct user_fpu_struct fpu; /* Math Co-processor registers */
+ int u_fpvalid; /* True if math co-processor being used */
+ size_t u_tsize; /* text size (pages) */
+ size_t u_dsize; /* data size (pages) */
+ size_t u_ssize; /* stack size (pages) */
+ unsigned long start_code; /* text starting address */
+ unsigned long start_data; /* data starting address */
+ unsigned long start_stack; /* stack starting address */
+ long int signal; /* signal causing core dump */
+ unsigned long u_ar0; /* help gdb find registers */
+ struct user_fpu_struct *u_fpstate; /* Math Co-processor pointer */
+ unsigned long magic; /* identifies a core file */
+ char u_comm[32]; /* user command name */
+};
#endif /* sys/user.h */
SUGIOKA Toshinobu