Add a new patch to glibc to build for Alpha on recent Linux kernels.
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Mon Jul 14 20:43:21 2008 +0000 (2008-07-14)
changeset 665313618c2c185
parent 664 6d151993e980
child 666 7f414d045a37
Add a new patch to glibc to build for Alpha on recent Linux kernels.

/trunk/patches/glibc/2.5.1/260-alpha-asm_elf.patch | 194 194 0 0 ++++++++++++++++++++++++++++
/trunk/patches/glibc/2.5/260-alpha-asm_elf.patch | 194 194 0 0 ++++++++++++++++++++++++++++
/trunk/patches/glibc/2.6.1/200-alpha-asm_elf.patch | 194 194 0 0 ++++++++++++++++++++++++++++
/trunk/patches/glibc/2.6/200-alpha-asm_elf.patch | 194 194 0 0 ++++++++++++++++++++++++++++
/trunk/patches/glibc/2.3.6/270-alpha-asm_elf.patch | 194 194 0 0 ++++++++++++++++++++++++++++
/trunk/patches/glibc/2.7/220-alpha-asm_elf.patch | 194 194 0 0 ++++++++++++++++++++++++++++
6 files changed, 1164 insertions(+)
patches/glibc/2.3.6/270-alpha-asm_elf.patch
patches/glibc/2.5.1/260-alpha-asm_elf.patch
patches/glibc/2.5/260-alpha-asm_elf.patch
patches/glibc/2.6.1/200-alpha-asm_elf.patch
patches/glibc/2.6/200-alpha-asm_elf.patch
patches/glibc/2.7/220-alpha-asm_elf.patch
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/patches/glibc/2.3.6/270-alpha-asm_elf.patch	Mon Jul 14 20:43:21 2008 +0000
     1.3 @@ -0,0 +1,194 @@
     1.4 +since the kernel no longer provides asm/elf.h, the sys/procfs.h from the 
     1.5 +common code, alpha, and sh fail when used.  this should things up.
     1.6 +-mike
     1.7 +
     1.8 +2008-06-07  Mike Frysinger  <vapier@gentoo.org>
     1.9 +
    1.10 +	* sysdeps/unix/sysv/linux/sys/procfs.h: Replace with #error stub.
    1.11 +	* sysdeps/unix/sysv/linux/alpha/sys/procfs.h: Copy some asm/elf.h
    1.12 +	definitions from the kernel header to sys/procfs.h and remove the
    1.13 +	#include of asm/elf.h.
    1.14 +	* sysdeps/unix/sysv/linux/sh/sys/procfs.h: Likewise.
    1.15 +
    1.16 +*Attachment: signature.asc <msg00012/signature.asc>*
    1.17 +/Description:/ This is a digitally signed message part.
    1.18 +
    1.19 +2008-06-07  Mike Frysinger  <vapier@gentoo.org>
    1.20 +
    1.21 +	* sysdeps/unix/sysv/linux/sys/procfs.h: Replace with #error stub.
    1.22 +	* sysdeps/unix/sysv/linux/alpha/sys/procfs.h: Copy some asm/elf.h
    1.23 +	definitions from the kernel header to sys/procfs.h and remove the
    1.24 +	#include of asm/elf.h.
    1.25 +	* sysdeps/unix/sysv/linux/sh/sys/procfs.h: Likewise.
    1.26 +
    1.27 +--- a/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
    1.28 ++++ b/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
    1.29 +@@ -29,10 +29,23 @@
    1.30 + #include <sys/types.h>
    1.31 + #include <sys/ucontext.h>
    1.32 + #include <sys/user.h>
    1.33 +-#include <asm/elf.h>
    1.34 + 
    1.35 + __BEGIN_DECLS
    1.36 + 
    1.37 ++/*
    1.38 ++ * The OSF/1 version of <sys/procfs.h> makes gregset_t 46 entries long.
    1.39 ++ * I have no idea why that is so.  For now, we just leave it at 33
    1.40 ++ * (32 general regs + processor status word).
    1.41 ++ */
    1.42 ++#define ELF_NGREG  33
    1.43 ++#define ELF_NFPREG 32
    1.44 ++
    1.45 ++typedef unsigned long elf_greg_t;
    1.46 ++typedef elf_greg_t elf_gregset_t[ELF_NGREG];
    1.47 ++
    1.48 ++typedef double elf_fpreg_t;
    1.49 ++typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
    1.50 ++
    1.51 + struct elf_siginfo
    1.52 +   {
    1.53 +     int si_signo;			/* Signal number.  */
    1.54 +--- a/sysdeps/unix/sysv/linux/sh/sys/procfs.h
    1.55 ++++ b/sysdeps/unix/sysv/linux/sh/sys/procfs.h
    1.56 +@@ -29,10 +29,19 @@
    1.57 + #include <sys/types.h>
    1.58 + #include <sys/ucontext.h>
    1.59 + #include <sys/user.h>
    1.60 +-#include <asm/elf.h>
    1.61 + 
    1.62 + __BEGIN_DECLS
    1.63 + 
    1.64 ++/*
    1.65 ++ * ELF register definitions...
    1.66 ++ */
    1.67 ++typedef unsigned long elf_greg_t;
    1.68 ++
    1.69 ++#define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t))
    1.70 ++typedef elf_greg_t elf_gregset_t[ELF_NGREG];
    1.71 ++
    1.72 ++typedef struct user_fpu_struct elf_fpregset_t;
    1.73 ++
    1.74 + struct elf_siginfo
    1.75 +   {
    1.76 +     int si_signo;			/* Signal number.  */
    1.77 +--- a/sysdeps/unix/sysv/linux/sys/procfs.h
    1.78 ++++ b/sysdeps/unix/sysv/linux/sys/procfs.h
    1.79 +@@ -1,115 +1,2 @@
    1.80 +-/* Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
    1.81 +-   This file is part of the GNU C Library.
    1.82 +-
    1.83 +-   The GNU C Library is free software; you can redistribute it and/or
    1.84 +-   modify it under the terms of the GNU Lesser General Public
    1.85 +-   License as published by the Free Software Foundation; either
    1.86 +-   version 2.1 of the License, or (at your option) any later version.
    1.87 +-
    1.88 +-   The GNU C Library is distributed in the hope that it will be useful,
    1.89 +-   but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.90 +-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    1.91 +-   Lesser General Public License for more details.
    1.92 +-
    1.93 +-   You should have received a copy of the GNU Lesser General Public
    1.94 +-   License along with the GNU C Library; if not, write to the Free
    1.95 +-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    1.96 +-   02111-1307 USA.  */
    1.97 +-
    1.98 +-#ifndef _SYS_PROCFS_H
    1.99 +-#define _SYS_PROCFS_H	1
   1.100 +-
   1.101 +-/* This is somehow modelled after the file of the same name on SysVr4
   1.102 +-   systems.  It provides a definition of the core file format for ELF
   1.103 +-   used on Linux.  */
   1.104 +-
   1.105 +-#include <features.h>
   1.106 +-#include <signal.h>
   1.107 +-#include <sys/time.h>
   1.108 +-#include <sys/types.h>
   1.109 +-#include <sys/ucontext.h>
   1.110 +-#include <sys/user.h>
   1.111 +-#include <asm/elf.h>
   1.112 +-
   1.113 +-__BEGIN_DECLS
   1.114 +-
   1.115 +-struct elf_siginfo
   1.116 +-  {
   1.117 +-    int si_signo;			/* Signal number.  */
   1.118 +-    int si_code;			/* Extra code.  */
   1.119 +-    int si_errno;			/* Errno.  */
   1.120 +-  };
   1.121 +-
   1.122 +-/* Definitions to generate Intel SVR4-like core files.  These mostly
   1.123 +-   have the same names as the SVR4 types with "elf_" tacked on the
   1.124 +-   front to prevent clashes with linux definitions, and the typedef
   1.125 +-   forms have been avoided.  This is mostly like the SVR4 structure,
   1.126 +-   but more Linuxy, with things that Linux does not support and which
   1.127 +-   gdb doesn't really use excluded.  Fields present but not used are
   1.128 +-   marked with "XXX".  */
   1.129 +-struct elf_prstatus
   1.130 +-  {
   1.131 +-#if 0
   1.132 +-    long int pr_flags;			/* XXX Process flags.  */
   1.133 +-    short int pr_why;			/* XXX Reason for process halt.  */
   1.134 +-    short int pr_what;			/* XXX More detailed reason.  */
   1.135 +-#endif
   1.136 +-    struct elf_siginfo pr_info;		/* Info associated with signal.  */
   1.137 +-    short int pr_cursig;		/* Current signal.  */
   1.138 +-    unsigned long int pr_sigpend;	/* Set of pending signals.  */
   1.139 +-    unsigned long int pr_sighold;	/* Set of held signals.  */
   1.140 +-#if 0
   1.141 +-    struct sigaltstack pr_altstack;	/* Alternate stack info.  */
   1.142 +-    struct sigaction pr_action;		/* Signal action for current sig.  */
   1.143 +-#endif
   1.144 +-    __pid_t pr_pid;
   1.145 +-    __pid_t pr_ppid;
   1.146 +-    __pid_t pr_pgrp;
   1.147 +-    __pid_t pr_sid;
   1.148 +-    struct timeval pr_utime;		/* User time.  */
   1.149 +-    struct timeval pr_stime;		/* System time.  */
   1.150 +-    struct timeval pr_cutime;		/* Cumulative user time.  */
   1.151 +-    struct timeval pr_cstime;		/* Cumulative system time.  */
   1.152 +-#if 0
   1.153 +-    long int pr_instr;			/* Current instruction.  */
   1.154 +-#endif
   1.155 +-    elf_gregset_t pr_reg;		/* GP registers.  */
   1.156 +-    int pr_fpvalid;			/* True if math copro being used.  */
   1.157 +-  };
   1.158 +-
   1.159 +-
   1.160 +-#define ELF_PRARGSZ     (80)    /* Number of chars for args */
   1.161 +-
   1.162 +-struct elf_prpsinfo
   1.163 +-  {
   1.164 +-    char pr_state;			/* Numeric process state.  */
   1.165 +-    char pr_sname;			/* Char for pr_state.  */
   1.166 +-    char pr_zomb;			/* Zombie.  */
   1.167 +-    char pr_nice;			/* Nice val.  */
   1.168 +-    unsigned long int pr_flag;		/* Flags.  */
   1.169 +-    unsigned short int pr_uid;
   1.170 +-    unsigned short int pr_gid;
   1.171 +-    int pr_pid, pr_ppid, pr_pgrp, pr_sid;
   1.172 +-    /* Lots missing */
   1.173 +-    char pr_fname[16];			/* Filename of executable.  */
   1.174 +-    char pr_psargs[ELF_PRARGSZ];	/* Initial part of arg list.  */
   1.175 +-  };
   1.176 +-
   1.177 +-/* Addresses.  */
   1.178 +-typedef void *psaddr_t;
   1.179 +-
   1.180 +-/* Register sets.  Linux has different names.  */
   1.181 +-typedef gregset_t prgregset_t;
   1.182 +-typedef fpregset_t prfpregset_t;
   1.183 +-
   1.184 +-/* We don't have any differences between processes and threads,
   1.185 +-   therefore habe only ine PID type.  */
   1.186 +-typedef __pid_t lwpid_t;
   1.187 +-
   1.188 +-
   1.189 +-typedef struct elf_prstatus prstatus_t;
   1.190 +-typedef struct elf_prpsinfo prpsinfo_t;
   1.191 +-
   1.192 +-__END_DECLS
   1.193 +-
   1.194 +-#endif	/* sys/procfs.h */
   1.195 ++/* sys/procfs.h is architecture specific.  */
   1.196 ++#error "This file must be supplied by every Linux architecture."
   1.197 +
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/patches/glibc/2.5.1/260-alpha-asm_elf.patch	Mon Jul 14 20:43:21 2008 +0000
     2.3 @@ -0,0 +1,194 @@
     2.4 +since the kernel no longer provides asm/elf.h, the sys/procfs.h from the 
     2.5 +common code, alpha, and sh fail when used.  this should things up.
     2.6 +-mike
     2.7 +
     2.8 +2008-06-07  Mike Frysinger  <vapier@gentoo.org>
     2.9 +
    2.10 +	* sysdeps/unix/sysv/linux/sys/procfs.h: Replace with #error stub.
    2.11 +	* sysdeps/unix/sysv/linux/alpha/sys/procfs.h: Copy some asm/elf.h
    2.12 +	definitions from the kernel header to sys/procfs.h and remove the
    2.13 +	#include of asm/elf.h.
    2.14 +	* sysdeps/unix/sysv/linux/sh/sys/procfs.h: Likewise.
    2.15 +
    2.16 +*Attachment: signature.asc <msg00012/signature.asc>*
    2.17 +/Description:/ This is a digitally signed message part.
    2.18 +
    2.19 +2008-06-07  Mike Frysinger  <vapier@gentoo.org>
    2.20 +
    2.21 +	* sysdeps/unix/sysv/linux/sys/procfs.h: Replace with #error stub.
    2.22 +	* sysdeps/unix/sysv/linux/alpha/sys/procfs.h: Copy some asm/elf.h
    2.23 +	definitions from the kernel header to sys/procfs.h and remove the
    2.24 +	#include of asm/elf.h.
    2.25 +	* sysdeps/unix/sysv/linux/sh/sys/procfs.h: Likewise.
    2.26 +
    2.27 +--- a/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
    2.28 ++++ b/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
    2.29 +@@ -29,10 +29,23 @@
    2.30 + #include <sys/types.h>
    2.31 + #include <sys/ucontext.h>
    2.32 + #include <sys/user.h>
    2.33 +-#include <asm/elf.h>
    2.34 + 
    2.35 + __BEGIN_DECLS
    2.36 + 
    2.37 ++/*
    2.38 ++ * The OSF/1 version of <sys/procfs.h> makes gregset_t 46 entries long.
    2.39 ++ * I have no idea why that is so.  For now, we just leave it at 33
    2.40 ++ * (32 general regs + processor status word).
    2.41 ++ */
    2.42 ++#define ELF_NGREG  33
    2.43 ++#define ELF_NFPREG 32
    2.44 ++
    2.45 ++typedef unsigned long elf_greg_t;
    2.46 ++typedef elf_greg_t elf_gregset_t[ELF_NGREG];
    2.47 ++
    2.48 ++typedef double elf_fpreg_t;
    2.49 ++typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
    2.50 ++
    2.51 + struct elf_siginfo
    2.52 +   {
    2.53 +     int si_signo;			/* Signal number.  */
    2.54 +--- a/sysdeps/unix/sysv/linux/sh/sys/procfs.h
    2.55 ++++ b/sysdeps/unix/sysv/linux/sh/sys/procfs.h
    2.56 +@@ -29,10 +29,19 @@
    2.57 + #include <sys/types.h>
    2.58 + #include <sys/ucontext.h>
    2.59 + #include <sys/user.h>
    2.60 +-#include <asm/elf.h>
    2.61 + 
    2.62 + __BEGIN_DECLS
    2.63 + 
    2.64 ++/*
    2.65 ++ * ELF register definitions...
    2.66 ++ */
    2.67 ++typedef unsigned long elf_greg_t;
    2.68 ++
    2.69 ++#define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t))
    2.70 ++typedef elf_greg_t elf_gregset_t[ELF_NGREG];
    2.71 ++
    2.72 ++typedef struct user_fpu_struct elf_fpregset_t;
    2.73 ++
    2.74 + struct elf_siginfo
    2.75 +   {
    2.76 +     int si_signo;			/* Signal number.  */
    2.77 +--- a/sysdeps/unix/sysv/linux/sys/procfs.h
    2.78 ++++ b/sysdeps/unix/sysv/linux/sys/procfs.h
    2.79 +@@ -1,115 +1,2 @@
    2.80 +-/* Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
    2.81 +-   This file is part of the GNU C Library.
    2.82 +-
    2.83 +-   The GNU C Library is free software; you can redistribute it and/or
    2.84 +-   modify it under the terms of the GNU Lesser General Public
    2.85 +-   License as published by the Free Software Foundation; either
    2.86 +-   version 2.1 of the License, or (at your option) any later version.
    2.87 +-
    2.88 +-   The GNU C Library is distributed in the hope that it will be useful,
    2.89 +-   but WITHOUT ANY WARRANTY; without even the implied warranty of
    2.90 +-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    2.91 +-   Lesser General Public License for more details.
    2.92 +-
    2.93 +-   You should have received a copy of the GNU Lesser General Public
    2.94 +-   License along with the GNU C Library; if not, write to the Free
    2.95 +-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    2.96 +-   02111-1307 USA.  */
    2.97 +-
    2.98 +-#ifndef _SYS_PROCFS_H
    2.99 +-#define _SYS_PROCFS_H	1
   2.100 +-
   2.101 +-/* This is somehow modelled after the file of the same name on SysVr4
   2.102 +-   systems.  It provides a definition of the core file format for ELF
   2.103 +-   used on Linux.  */
   2.104 +-
   2.105 +-#include <features.h>
   2.106 +-#include <signal.h>
   2.107 +-#include <sys/time.h>
   2.108 +-#include <sys/types.h>
   2.109 +-#include <sys/ucontext.h>
   2.110 +-#include <sys/user.h>
   2.111 +-#include <asm/elf.h>
   2.112 +-
   2.113 +-__BEGIN_DECLS
   2.114 +-
   2.115 +-struct elf_siginfo
   2.116 +-  {
   2.117 +-    int si_signo;			/* Signal number.  */
   2.118 +-    int si_code;			/* Extra code.  */
   2.119 +-    int si_errno;			/* Errno.  */
   2.120 +-  };
   2.121 +-
   2.122 +-/* Definitions to generate Intel SVR4-like core files.  These mostly
   2.123 +-   have the same names as the SVR4 types with "elf_" tacked on the
   2.124 +-   front to prevent clashes with linux definitions, and the typedef
   2.125 +-   forms have been avoided.  This is mostly like the SVR4 structure,
   2.126 +-   but more Linuxy, with things that Linux does not support and which
   2.127 +-   gdb doesn't really use excluded.  Fields present but not used are
   2.128 +-   marked with "XXX".  */
   2.129 +-struct elf_prstatus
   2.130 +-  {
   2.131 +-#if 0
   2.132 +-    long int pr_flags;			/* XXX Process flags.  */
   2.133 +-    short int pr_why;			/* XXX Reason for process halt.  */
   2.134 +-    short int pr_what;			/* XXX More detailed reason.  */
   2.135 +-#endif
   2.136 +-    struct elf_siginfo pr_info;		/* Info associated with signal.  */
   2.137 +-    short int pr_cursig;		/* Current signal.  */
   2.138 +-    unsigned long int pr_sigpend;	/* Set of pending signals.  */
   2.139 +-    unsigned long int pr_sighold;	/* Set of held signals.  */
   2.140 +-#if 0
   2.141 +-    struct sigaltstack pr_altstack;	/* Alternate stack info.  */
   2.142 +-    struct sigaction pr_action;		/* Signal action for current sig.  */
   2.143 +-#endif
   2.144 +-    __pid_t pr_pid;
   2.145 +-    __pid_t pr_ppid;
   2.146 +-    __pid_t pr_pgrp;
   2.147 +-    __pid_t pr_sid;
   2.148 +-    struct timeval pr_utime;		/* User time.  */
   2.149 +-    struct timeval pr_stime;		/* System time.  */
   2.150 +-    struct timeval pr_cutime;		/* Cumulative user time.  */
   2.151 +-    struct timeval pr_cstime;		/* Cumulative system time.  */
   2.152 +-#if 0
   2.153 +-    long int pr_instr;			/* Current instruction.  */
   2.154 +-#endif
   2.155 +-    elf_gregset_t pr_reg;		/* GP registers.  */
   2.156 +-    int pr_fpvalid;			/* True if math copro being used.  */
   2.157 +-  };
   2.158 +-
   2.159 +-
   2.160 +-#define ELF_PRARGSZ     (80)    /* Number of chars for args */
   2.161 +-
   2.162 +-struct elf_prpsinfo
   2.163 +-  {
   2.164 +-    char pr_state;			/* Numeric process state.  */
   2.165 +-    char pr_sname;			/* Char for pr_state.  */
   2.166 +-    char pr_zomb;			/* Zombie.  */
   2.167 +-    char pr_nice;			/* Nice val.  */
   2.168 +-    unsigned long int pr_flag;		/* Flags.  */
   2.169 +-    unsigned short int pr_uid;
   2.170 +-    unsigned short int pr_gid;
   2.171 +-    int pr_pid, pr_ppid, pr_pgrp, pr_sid;
   2.172 +-    /* Lots missing */
   2.173 +-    char pr_fname[16];			/* Filename of executable.  */
   2.174 +-    char pr_psargs[ELF_PRARGSZ];	/* Initial part of arg list.  */
   2.175 +-  };
   2.176 +-
   2.177 +-/* Addresses.  */
   2.178 +-typedef void *psaddr_t;
   2.179 +-
   2.180 +-/* Register sets.  Linux has different names.  */
   2.181 +-typedef gregset_t prgregset_t;
   2.182 +-typedef fpregset_t prfpregset_t;
   2.183 +-
   2.184 +-/* We don't have any differences between processes and threads,
   2.185 +-   therefore habe only ine PID type.  */
   2.186 +-typedef __pid_t lwpid_t;
   2.187 +-
   2.188 +-
   2.189 +-typedef struct elf_prstatus prstatus_t;
   2.190 +-typedef struct elf_prpsinfo prpsinfo_t;
   2.191 +-
   2.192 +-__END_DECLS
   2.193 +-
   2.194 +-#endif	/* sys/procfs.h */
   2.195 ++/* sys/procfs.h is architecture specific.  */
   2.196 ++#error "This file must be supplied by every Linux architecture."
   2.197 +
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/patches/glibc/2.5/260-alpha-asm_elf.patch	Mon Jul 14 20:43:21 2008 +0000
     3.3 @@ -0,0 +1,194 @@
     3.4 +since the kernel no longer provides asm/elf.h, the sys/procfs.h from the 
     3.5 +common code, alpha, and sh fail when used.  this should things up.
     3.6 +-mike
     3.7 +
     3.8 +2008-06-07  Mike Frysinger  <vapier@gentoo.org>
     3.9 +
    3.10 +	* sysdeps/unix/sysv/linux/sys/procfs.h: Replace with #error stub.
    3.11 +	* sysdeps/unix/sysv/linux/alpha/sys/procfs.h: Copy some asm/elf.h
    3.12 +	definitions from the kernel header to sys/procfs.h and remove the
    3.13 +	#include of asm/elf.h.
    3.14 +	* sysdeps/unix/sysv/linux/sh/sys/procfs.h: Likewise.
    3.15 +
    3.16 +*Attachment: signature.asc <msg00012/signature.asc>*
    3.17 +/Description:/ This is a digitally signed message part.
    3.18 +
    3.19 +2008-06-07  Mike Frysinger  <vapier@gentoo.org>
    3.20 +
    3.21 +	* sysdeps/unix/sysv/linux/sys/procfs.h: Replace with #error stub.
    3.22 +	* sysdeps/unix/sysv/linux/alpha/sys/procfs.h: Copy some asm/elf.h
    3.23 +	definitions from the kernel header to sys/procfs.h and remove the
    3.24 +	#include of asm/elf.h.
    3.25 +	* sysdeps/unix/sysv/linux/sh/sys/procfs.h: Likewise.
    3.26 +
    3.27 +--- a/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
    3.28 ++++ b/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
    3.29 +@@ -29,10 +29,23 @@
    3.30 + #include <sys/types.h>
    3.31 + #include <sys/ucontext.h>
    3.32 + #include <sys/user.h>
    3.33 +-#include <asm/elf.h>
    3.34 + 
    3.35 + __BEGIN_DECLS
    3.36 + 
    3.37 ++/*
    3.38 ++ * The OSF/1 version of <sys/procfs.h> makes gregset_t 46 entries long.
    3.39 ++ * I have no idea why that is so.  For now, we just leave it at 33
    3.40 ++ * (32 general regs + processor status word).
    3.41 ++ */
    3.42 ++#define ELF_NGREG  33
    3.43 ++#define ELF_NFPREG 32
    3.44 ++
    3.45 ++typedef unsigned long elf_greg_t;
    3.46 ++typedef elf_greg_t elf_gregset_t[ELF_NGREG];
    3.47 ++
    3.48 ++typedef double elf_fpreg_t;
    3.49 ++typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
    3.50 ++
    3.51 + struct elf_siginfo
    3.52 +   {
    3.53 +     int si_signo;			/* Signal number.  */
    3.54 +--- a/sysdeps/unix/sysv/linux/sh/sys/procfs.h
    3.55 ++++ b/sysdeps/unix/sysv/linux/sh/sys/procfs.h
    3.56 +@@ -29,10 +29,19 @@
    3.57 + #include <sys/types.h>
    3.58 + #include <sys/ucontext.h>
    3.59 + #include <sys/user.h>
    3.60 +-#include <asm/elf.h>
    3.61 + 
    3.62 + __BEGIN_DECLS
    3.63 + 
    3.64 ++/*
    3.65 ++ * ELF register definitions...
    3.66 ++ */
    3.67 ++typedef unsigned long elf_greg_t;
    3.68 ++
    3.69 ++#define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t))
    3.70 ++typedef elf_greg_t elf_gregset_t[ELF_NGREG];
    3.71 ++
    3.72 ++typedef struct user_fpu_struct elf_fpregset_t;
    3.73 ++
    3.74 + struct elf_siginfo
    3.75 +   {
    3.76 +     int si_signo;			/* Signal number.  */
    3.77 +--- a/sysdeps/unix/sysv/linux/sys/procfs.h
    3.78 ++++ b/sysdeps/unix/sysv/linux/sys/procfs.h
    3.79 +@@ -1,115 +1,2 @@
    3.80 +-/* Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
    3.81 +-   This file is part of the GNU C Library.
    3.82 +-
    3.83 +-   The GNU C Library is free software; you can redistribute it and/or
    3.84 +-   modify it under the terms of the GNU Lesser General Public
    3.85 +-   License as published by the Free Software Foundation; either
    3.86 +-   version 2.1 of the License, or (at your option) any later version.
    3.87 +-
    3.88 +-   The GNU C Library is distributed in the hope that it will be useful,
    3.89 +-   but WITHOUT ANY WARRANTY; without even the implied warranty of
    3.90 +-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    3.91 +-   Lesser General Public License for more details.
    3.92 +-
    3.93 +-   You should have received a copy of the GNU Lesser General Public
    3.94 +-   License along with the GNU C Library; if not, write to the Free
    3.95 +-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    3.96 +-   02111-1307 USA.  */
    3.97 +-
    3.98 +-#ifndef _SYS_PROCFS_H
    3.99 +-#define _SYS_PROCFS_H	1
   3.100 +-
   3.101 +-/* This is somehow modelled after the file of the same name on SysVr4
   3.102 +-   systems.  It provides a definition of the core file format for ELF
   3.103 +-   used on Linux.  */
   3.104 +-
   3.105 +-#include <features.h>
   3.106 +-#include <signal.h>
   3.107 +-#include <sys/time.h>
   3.108 +-#include <sys/types.h>
   3.109 +-#include <sys/ucontext.h>
   3.110 +-#include <sys/user.h>
   3.111 +-#include <asm/elf.h>
   3.112 +-
   3.113 +-__BEGIN_DECLS
   3.114 +-
   3.115 +-struct elf_siginfo
   3.116 +-  {
   3.117 +-    int si_signo;			/* Signal number.  */
   3.118 +-    int si_code;			/* Extra code.  */
   3.119 +-    int si_errno;			/* Errno.  */
   3.120 +-  };
   3.121 +-
   3.122 +-/* Definitions to generate Intel SVR4-like core files.  These mostly
   3.123 +-   have the same names as the SVR4 types with "elf_" tacked on the
   3.124 +-   front to prevent clashes with linux definitions, and the typedef
   3.125 +-   forms have been avoided.  This is mostly like the SVR4 structure,
   3.126 +-   but more Linuxy, with things that Linux does not support and which
   3.127 +-   gdb doesn't really use excluded.  Fields present but not used are
   3.128 +-   marked with "XXX".  */
   3.129 +-struct elf_prstatus
   3.130 +-  {
   3.131 +-#if 0
   3.132 +-    long int pr_flags;			/* XXX Process flags.  */
   3.133 +-    short int pr_why;			/* XXX Reason for process halt.  */
   3.134 +-    short int pr_what;			/* XXX More detailed reason.  */
   3.135 +-#endif
   3.136 +-    struct elf_siginfo pr_info;		/* Info associated with signal.  */
   3.137 +-    short int pr_cursig;		/* Current signal.  */
   3.138 +-    unsigned long int pr_sigpend;	/* Set of pending signals.  */
   3.139 +-    unsigned long int pr_sighold;	/* Set of held signals.  */
   3.140 +-#if 0
   3.141 +-    struct sigaltstack pr_altstack;	/* Alternate stack info.  */
   3.142 +-    struct sigaction pr_action;		/* Signal action for current sig.  */
   3.143 +-#endif
   3.144 +-    __pid_t pr_pid;
   3.145 +-    __pid_t pr_ppid;
   3.146 +-    __pid_t pr_pgrp;
   3.147 +-    __pid_t pr_sid;
   3.148 +-    struct timeval pr_utime;		/* User time.  */
   3.149 +-    struct timeval pr_stime;		/* System time.  */
   3.150 +-    struct timeval pr_cutime;		/* Cumulative user time.  */
   3.151 +-    struct timeval pr_cstime;		/* Cumulative system time.  */
   3.152 +-#if 0
   3.153 +-    long int pr_instr;			/* Current instruction.  */
   3.154 +-#endif
   3.155 +-    elf_gregset_t pr_reg;		/* GP registers.  */
   3.156 +-    int pr_fpvalid;			/* True if math copro being used.  */
   3.157 +-  };
   3.158 +-
   3.159 +-
   3.160 +-#define ELF_PRARGSZ     (80)    /* Number of chars for args */
   3.161 +-
   3.162 +-struct elf_prpsinfo
   3.163 +-  {
   3.164 +-    char pr_state;			/* Numeric process state.  */
   3.165 +-    char pr_sname;			/* Char for pr_state.  */
   3.166 +-    char pr_zomb;			/* Zombie.  */
   3.167 +-    char pr_nice;			/* Nice val.  */
   3.168 +-    unsigned long int pr_flag;		/* Flags.  */
   3.169 +-    unsigned short int pr_uid;
   3.170 +-    unsigned short int pr_gid;
   3.171 +-    int pr_pid, pr_ppid, pr_pgrp, pr_sid;
   3.172 +-    /* Lots missing */
   3.173 +-    char pr_fname[16];			/* Filename of executable.  */
   3.174 +-    char pr_psargs[ELF_PRARGSZ];	/* Initial part of arg list.  */
   3.175 +-  };
   3.176 +-
   3.177 +-/* Addresses.  */
   3.178 +-typedef void *psaddr_t;
   3.179 +-
   3.180 +-/* Register sets.  Linux has different names.  */
   3.181 +-typedef gregset_t prgregset_t;
   3.182 +-typedef fpregset_t prfpregset_t;
   3.183 +-
   3.184 +-/* We don't have any differences between processes and threads,
   3.185 +-   therefore habe only ine PID type.  */
   3.186 +-typedef __pid_t lwpid_t;
   3.187 +-
   3.188 +-
   3.189 +-typedef struct elf_prstatus prstatus_t;
   3.190 +-typedef struct elf_prpsinfo prpsinfo_t;
   3.191 +-
   3.192 +-__END_DECLS
   3.193 +-
   3.194 +-#endif	/* sys/procfs.h */
   3.195 ++/* sys/procfs.h is architecture specific.  */
   3.196 ++#error "This file must be supplied by every Linux architecture."
   3.197 +
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/patches/glibc/2.6.1/200-alpha-asm_elf.patch	Mon Jul 14 20:43:21 2008 +0000
     4.3 @@ -0,0 +1,194 @@
     4.4 +since the kernel no longer provides asm/elf.h, the sys/procfs.h from the 
     4.5 +common code, alpha, and sh fail when used.  this should things up.
     4.6 +-mike
     4.7 +
     4.8 +2008-06-07  Mike Frysinger  <vapier@gentoo.org>
     4.9 +
    4.10 +	* sysdeps/unix/sysv/linux/sys/procfs.h: Replace with #error stub.
    4.11 +	* sysdeps/unix/sysv/linux/alpha/sys/procfs.h: Copy some asm/elf.h
    4.12 +	definitions from the kernel header to sys/procfs.h and remove the
    4.13 +	#include of asm/elf.h.
    4.14 +	* sysdeps/unix/sysv/linux/sh/sys/procfs.h: Likewise.
    4.15 +
    4.16 +*Attachment: signature.asc <msg00012/signature.asc>*
    4.17 +/Description:/ This is a digitally signed message part.
    4.18 +
    4.19 +2008-06-07  Mike Frysinger  <vapier@gentoo.org>
    4.20 +
    4.21 +	* sysdeps/unix/sysv/linux/sys/procfs.h: Replace with #error stub.
    4.22 +	* sysdeps/unix/sysv/linux/alpha/sys/procfs.h: Copy some asm/elf.h
    4.23 +	definitions from the kernel header to sys/procfs.h and remove the
    4.24 +	#include of asm/elf.h.
    4.25 +	* sysdeps/unix/sysv/linux/sh/sys/procfs.h: Likewise.
    4.26 +
    4.27 +--- a/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
    4.28 ++++ b/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
    4.29 +@@ -29,10 +29,23 @@
    4.30 + #include <sys/types.h>
    4.31 + #include <sys/ucontext.h>
    4.32 + #include <sys/user.h>
    4.33 +-#include <asm/elf.h>
    4.34 + 
    4.35 + __BEGIN_DECLS
    4.36 + 
    4.37 ++/*
    4.38 ++ * The OSF/1 version of <sys/procfs.h> makes gregset_t 46 entries long.
    4.39 ++ * I have no idea why that is so.  For now, we just leave it at 33
    4.40 ++ * (32 general regs + processor status word).
    4.41 ++ */
    4.42 ++#define ELF_NGREG  33
    4.43 ++#define ELF_NFPREG 32
    4.44 ++
    4.45 ++typedef unsigned long elf_greg_t;
    4.46 ++typedef elf_greg_t elf_gregset_t[ELF_NGREG];
    4.47 ++
    4.48 ++typedef double elf_fpreg_t;
    4.49 ++typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
    4.50 ++
    4.51 + struct elf_siginfo
    4.52 +   {
    4.53 +     int si_signo;			/* Signal number.  */
    4.54 +--- a/sysdeps/unix/sysv/linux/sh/sys/procfs.h
    4.55 ++++ b/sysdeps/unix/sysv/linux/sh/sys/procfs.h
    4.56 +@@ -29,10 +29,19 @@
    4.57 + #include <sys/types.h>
    4.58 + #include <sys/ucontext.h>
    4.59 + #include <sys/user.h>
    4.60 +-#include <asm/elf.h>
    4.61 + 
    4.62 + __BEGIN_DECLS
    4.63 + 
    4.64 ++/*
    4.65 ++ * ELF register definitions...
    4.66 ++ */
    4.67 ++typedef unsigned long elf_greg_t;
    4.68 ++
    4.69 ++#define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t))
    4.70 ++typedef elf_greg_t elf_gregset_t[ELF_NGREG];
    4.71 ++
    4.72 ++typedef struct user_fpu_struct elf_fpregset_t;
    4.73 ++
    4.74 + struct elf_siginfo
    4.75 +   {
    4.76 +     int si_signo;			/* Signal number.  */
    4.77 +--- a/sysdeps/unix/sysv/linux/sys/procfs.h
    4.78 ++++ b/sysdeps/unix/sysv/linux/sys/procfs.h
    4.79 +@@ -1,115 +1,2 @@
    4.80 +-/* Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
    4.81 +-   This file is part of the GNU C Library.
    4.82 +-
    4.83 +-   The GNU C Library is free software; you can redistribute it and/or
    4.84 +-   modify it under the terms of the GNU Lesser General Public
    4.85 +-   License as published by the Free Software Foundation; either
    4.86 +-   version 2.1 of the License, or (at your option) any later version.
    4.87 +-
    4.88 +-   The GNU C Library is distributed in the hope that it will be useful,
    4.89 +-   but WITHOUT ANY WARRANTY; without even the implied warranty of
    4.90 +-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    4.91 +-   Lesser General Public License for more details.
    4.92 +-
    4.93 +-   You should have received a copy of the GNU Lesser General Public
    4.94 +-   License along with the GNU C Library; if not, write to the Free
    4.95 +-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    4.96 +-   02111-1307 USA.  */
    4.97 +-
    4.98 +-#ifndef _SYS_PROCFS_H
    4.99 +-#define _SYS_PROCFS_H	1
   4.100 +-
   4.101 +-/* This is somehow modelled after the file of the same name on SysVr4
   4.102 +-   systems.  It provides a definition of the core file format for ELF
   4.103 +-   used on Linux.  */
   4.104 +-
   4.105 +-#include <features.h>
   4.106 +-#include <signal.h>
   4.107 +-#include <sys/time.h>
   4.108 +-#include <sys/types.h>
   4.109 +-#include <sys/ucontext.h>
   4.110 +-#include <sys/user.h>
   4.111 +-#include <asm/elf.h>
   4.112 +-
   4.113 +-__BEGIN_DECLS
   4.114 +-
   4.115 +-struct elf_siginfo
   4.116 +-  {
   4.117 +-    int si_signo;			/* Signal number.  */
   4.118 +-    int si_code;			/* Extra code.  */
   4.119 +-    int si_errno;			/* Errno.  */
   4.120 +-  };
   4.121 +-
   4.122 +-/* Definitions to generate Intel SVR4-like core files.  These mostly
   4.123 +-   have the same names as the SVR4 types with "elf_" tacked on the
   4.124 +-   front to prevent clashes with linux definitions, and the typedef
   4.125 +-   forms have been avoided.  This is mostly like the SVR4 structure,
   4.126 +-   but more Linuxy, with things that Linux does not support and which
   4.127 +-   gdb doesn't really use excluded.  Fields present but not used are
   4.128 +-   marked with "XXX".  */
   4.129 +-struct elf_prstatus
   4.130 +-  {
   4.131 +-#if 0
   4.132 +-    long int pr_flags;			/* XXX Process flags.  */
   4.133 +-    short int pr_why;			/* XXX Reason for process halt.  */
   4.134 +-    short int pr_what;			/* XXX More detailed reason.  */
   4.135 +-#endif
   4.136 +-    struct elf_siginfo pr_info;		/* Info associated with signal.  */
   4.137 +-    short int pr_cursig;		/* Current signal.  */
   4.138 +-    unsigned long int pr_sigpend;	/* Set of pending signals.  */
   4.139 +-    unsigned long int pr_sighold;	/* Set of held signals.  */
   4.140 +-#if 0
   4.141 +-    struct sigaltstack pr_altstack;	/* Alternate stack info.  */
   4.142 +-    struct sigaction pr_action;		/* Signal action for current sig.  */
   4.143 +-#endif
   4.144 +-    __pid_t pr_pid;
   4.145 +-    __pid_t pr_ppid;
   4.146 +-    __pid_t pr_pgrp;
   4.147 +-    __pid_t pr_sid;
   4.148 +-    struct timeval pr_utime;		/* User time.  */
   4.149 +-    struct timeval pr_stime;		/* System time.  */
   4.150 +-    struct timeval pr_cutime;		/* Cumulative user time.  */
   4.151 +-    struct timeval pr_cstime;		/* Cumulative system time.  */
   4.152 +-#if 0
   4.153 +-    long int pr_instr;			/* Current instruction.  */
   4.154 +-#endif
   4.155 +-    elf_gregset_t pr_reg;		/* GP registers.  */
   4.156 +-    int pr_fpvalid;			/* True if math copro being used.  */
   4.157 +-  };
   4.158 +-
   4.159 +-
   4.160 +-#define ELF_PRARGSZ     (80)    /* Number of chars for args */
   4.161 +-
   4.162 +-struct elf_prpsinfo
   4.163 +-  {
   4.164 +-    char pr_state;			/* Numeric process state.  */
   4.165 +-    char pr_sname;			/* Char for pr_state.  */
   4.166 +-    char pr_zomb;			/* Zombie.  */
   4.167 +-    char pr_nice;			/* Nice val.  */
   4.168 +-    unsigned long int pr_flag;		/* Flags.  */
   4.169 +-    unsigned short int pr_uid;
   4.170 +-    unsigned short int pr_gid;
   4.171 +-    int pr_pid, pr_ppid, pr_pgrp, pr_sid;
   4.172 +-    /* Lots missing */
   4.173 +-    char pr_fname[16];			/* Filename of executable.  */
   4.174 +-    char pr_psargs[ELF_PRARGSZ];	/* Initial part of arg list.  */
   4.175 +-  };
   4.176 +-
   4.177 +-/* Addresses.  */
   4.178 +-typedef void *psaddr_t;
   4.179 +-
   4.180 +-/* Register sets.  Linux has different names.  */
   4.181 +-typedef gregset_t prgregset_t;
   4.182 +-typedef fpregset_t prfpregset_t;
   4.183 +-
   4.184 +-/* We don't have any differences between processes and threads,
   4.185 +-   therefore habe only ine PID type.  */
   4.186 +-typedef __pid_t lwpid_t;
   4.187 +-
   4.188 +-
   4.189 +-typedef struct elf_prstatus prstatus_t;
   4.190 +-typedef struct elf_prpsinfo prpsinfo_t;
   4.191 +-
   4.192 +-__END_DECLS
   4.193 +-
   4.194 +-#endif	/* sys/procfs.h */
   4.195 ++/* sys/procfs.h is architecture specific.  */
   4.196 ++#error "This file must be supplied by every Linux architecture."
   4.197 +
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/patches/glibc/2.6/200-alpha-asm_elf.patch	Mon Jul 14 20:43:21 2008 +0000
     5.3 @@ -0,0 +1,194 @@
     5.4 +since the kernel no longer provides asm/elf.h, the sys/procfs.h from the 
     5.5 +common code, alpha, and sh fail when used.  this should things up.
     5.6 +-mike
     5.7 +
     5.8 +2008-06-07  Mike Frysinger  <vapier@gentoo.org>
     5.9 +
    5.10 +	* sysdeps/unix/sysv/linux/sys/procfs.h: Replace with #error stub.
    5.11 +	* sysdeps/unix/sysv/linux/alpha/sys/procfs.h: Copy some asm/elf.h
    5.12 +	definitions from the kernel header to sys/procfs.h and remove the
    5.13 +	#include of asm/elf.h.
    5.14 +	* sysdeps/unix/sysv/linux/sh/sys/procfs.h: Likewise.
    5.15 +
    5.16 +*Attachment: signature.asc <msg00012/signature.asc>*
    5.17 +/Description:/ This is a digitally signed message part.
    5.18 +
    5.19 +2008-06-07  Mike Frysinger  <vapier@gentoo.org>
    5.20 +
    5.21 +	* sysdeps/unix/sysv/linux/sys/procfs.h: Replace with #error stub.
    5.22 +	* sysdeps/unix/sysv/linux/alpha/sys/procfs.h: Copy some asm/elf.h
    5.23 +	definitions from the kernel header to sys/procfs.h and remove the
    5.24 +	#include of asm/elf.h.
    5.25 +	* sysdeps/unix/sysv/linux/sh/sys/procfs.h: Likewise.
    5.26 +
    5.27 +--- a/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
    5.28 ++++ b/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
    5.29 +@@ -29,10 +29,23 @@
    5.30 + #include <sys/types.h>
    5.31 + #include <sys/ucontext.h>
    5.32 + #include <sys/user.h>
    5.33 +-#include <asm/elf.h>
    5.34 + 
    5.35 + __BEGIN_DECLS
    5.36 + 
    5.37 ++/*
    5.38 ++ * The OSF/1 version of <sys/procfs.h> makes gregset_t 46 entries long.
    5.39 ++ * I have no idea why that is so.  For now, we just leave it at 33
    5.40 ++ * (32 general regs + processor status word).
    5.41 ++ */
    5.42 ++#define ELF_NGREG  33
    5.43 ++#define ELF_NFPREG 32
    5.44 ++
    5.45 ++typedef unsigned long elf_greg_t;
    5.46 ++typedef elf_greg_t elf_gregset_t[ELF_NGREG];
    5.47 ++
    5.48 ++typedef double elf_fpreg_t;
    5.49 ++typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
    5.50 ++
    5.51 + struct elf_siginfo
    5.52 +   {
    5.53 +     int si_signo;			/* Signal number.  */
    5.54 +--- a/sysdeps/unix/sysv/linux/sh/sys/procfs.h
    5.55 ++++ b/sysdeps/unix/sysv/linux/sh/sys/procfs.h
    5.56 +@@ -29,10 +29,19 @@
    5.57 + #include <sys/types.h>
    5.58 + #include <sys/ucontext.h>
    5.59 + #include <sys/user.h>
    5.60 +-#include <asm/elf.h>
    5.61 + 
    5.62 + __BEGIN_DECLS
    5.63 + 
    5.64 ++/*
    5.65 ++ * ELF register definitions...
    5.66 ++ */
    5.67 ++typedef unsigned long elf_greg_t;
    5.68 ++
    5.69 ++#define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t))
    5.70 ++typedef elf_greg_t elf_gregset_t[ELF_NGREG];
    5.71 ++
    5.72 ++typedef struct user_fpu_struct elf_fpregset_t;
    5.73 ++
    5.74 + struct elf_siginfo
    5.75 +   {
    5.76 +     int si_signo;			/* Signal number.  */
    5.77 +--- a/sysdeps/unix/sysv/linux/sys/procfs.h
    5.78 ++++ b/sysdeps/unix/sysv/linux/sys/procfs.h
    5.79 +@@ -1,115 +1,2 @@
    5.80 +-/* Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
    5.81 +-   This file is part of the GNU C Library.
    5.82 +-
    5.83 +-   The GNU C Library is free software; you can redistribute it and/or
    5.84 +-   modify it under the terms of the GNU Lesser General Public
    5.85 +-   License as published by the Free Software Foundation; either
    5.86 +-   version 2.1 of the License, or (at your option) any later version.
    5.87 +-
    5.88 +-   The GNU C Library is distributed in the hope that it will be useful,
    5.89 +-   but WITHOUT ANY WARRANTY; without even the implied warranty of
    5.90 +-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    5.91 +-   Lesser General Public License for more details.
    5.92 +-
    5.93 +-   You should have received a copy of the GNU Lesser General Public
    5.94 +-   License along with the GNU C Library; if not, write to the Free
    5.95 +-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    5.96 +-   02111-1307 USA.  */
    5.97 +-
    5.98 +-#ifndef _SYS_PROCFS_H
    5.99 +-#define _SYS_PROCFS_H	1
   5.100 +-
   5.101 +-/* This is somehow modelled after the file of the same name on SysVr4
   5.102 +-   systems.  It provides a definition of the core file format for ELF
   5.103 +-   used on Linux.  */
   5.104 +-
   5.105 +-#include <features.h>
   5.106 +-#include <signal.h>
   5.107 +-#include <sys/time.h>
   5.108 +-#include <sys/types.h>
   5.109 +-#include <sys/ucontext.h>
   5.110 +-#include <sys/user.h>
   5.111 +-#include <asm/elf.h>
   5.112 +-
   5.113 +-__BEGIN_DECLS
   5.114 +-
   5.115 +-struct elf_siginfo
   5.116 +-  {
   5.117 +-    int si_signo;			/* Signal number.  */
   5.118 +-    int si_code;			/* Extra code.  */
   5.119 +-    int si_errno;			/* Errno.  */
   5.120 +-  };
   5.121 +-
   5.122 +-/* Definitions to generate Intel SVR4-like core files.  These mostly
   5.123 +-   have the same names as the SVR4 types with "elf_" tacked on the
   5.124 +-   front to prevent clashes with linux definitions, and the typedef
   5.125 +-   forms have been avoided.  This is mostly like the SVR4 structure,
   5.126 +-   but more Linuxy, with things that Linux does not support and which
   5.127 +-   gdb doesn't really use excluded.  Fields present but not used are
   5.128 +-   marked with "XXX".  */
   5.129 +-struct elf_prstatus
   5.130 +-  {
   5.131 +-#if 0
   5.132 +-    long int pr_flags;			/* XXX Process flags.  */
   5.133 +-    short int pr_why;			/* XXX Reason for process halt.  */
   5.134 +-    short int pr_what;			/* XXX More detailed reason.  */
   5.135 +-#endif
   5.136 +-    struct elf_siginfo pr_info;		/* Info associated with signal.  */
   5.137 +-    short int pr_cursig;		/* Current signal.  */
   5.138 +-    unsigned long int pr_sigpend;	/* Set of pending signals.  */
   5.139 +-    unsigned long int pr_sighold;	/* Set of held signals.  */
   5.140 +-#if 0
   5.141 +-    struct sigaltstack pr_altstack;	/* Alternate stack info.  */
   5.142 +-    struct sigaction pr_action;		/* Signal action for current sig.  */
   5.143 +-#endif
   5.144 +-    __pid_t pr_pid;
   5.145 +-    __pid_t pr_ppid;
   5.146 +-    __pid_t pr_pgrp;
   5.147 +-    __pid_t pr_sid;
   5.148 +-    struct timeval pr_utime;		/* User time.  */
   5.149 +-    struct timeval pr_stime;		/* System time.  */
   5.150 +-    struct timeval pr_cutime;		/* Cumulative user time.  */
   5.151 +-    struct timeval pr_cstime;		/* Cumulative system time.  */
   5.152 +-#if 0
   5.153 +-    long int pr_instr;			/* Current instruction.  */
   5.154 +-#endif
   5.155 +-    elf_gregset_t pr_reg;		/* GP registers.  */
   5.156 +-    int pr_fpvalid;			/* True if math copro being used.  */
   5.157 +-  };
   5.158 +-
   5.159 +-
   5.160 +-#define ELF_PRARGSZ     (80)    /* Number of chars for args */
   5.161 +-
   5.162 +-struct elf_prpsinfo
   5.163 +-  {
   5.164 +-    char pr_state;			/* Numeric process state.  */
   5.165 +-    char pr_sname;			/* Char for pr_state.  */
   5.166 +-    char pr_zomb;			/* Zombie.  */
   5.167 +-    char pr_nice;			/* Nice val.  */
   5.168 +-    unsigned long int pr_flag;		/* Flags.  */
   5.169 +-    unsigned short int pr_uid;
   5.170 +-    unsigned short int pr_gid;
   5.171 +-    int pr_pid, pr_ppid, pr_pgrp, pr_sid;
   5.172 +-    /* Lots missing */
   5.173 +-    char pr_fname[16];			/* Filename of executable.  */
   5.174 +-    char pr_psargs[ELF_PRARGSZ];	/* Initial part of arg list.  */
   5.175 +-  };
   5.176 +-
   5.177 +-/* Addresses.  */
   5.178 +-typedef void *psaddr_t;
   5.179 +-
   5.180 +-/* Register sets.  Linux has different names.  */
   5.181 +-typedef gregset_t prgregset_t;
   5.182 +-typedef fpregset_t prfpregset_t;
   5.183 +-
   5.184 +-/* We don't have any differences between processes and threads,
   5.185 +-   therefore habe only ine PID type.  */
   5.186 +-typedef __pid_t lwpid_t;
   5.187 +-
   5.188 +-
   5.189 +-typedef struct elf_prstatus prstatus_t;
   5.190 +-typedef struct elf_prpsinfo prpsinfo_t;
   5.191 +-
   5.192 +-__END_DECLS
   5.193 +-
   5.194 +-#endif	/* sys/procfs.h */
   5.195 ++/* sys/procfs.h is architecture specific.  */
   5.196 ++#error "This file must be supplied by every Linux architecture."
   5.197 +
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/patches/glibc/2.7/220-alpha-asm_elf.patch	Mon Jul 14 20:43:21 2008 +0000
     6.3 @@ -0,0 +1,194 @@
     6.4 +since the kernel no longer provides asm/elf.h, the sys/procfs.h from the 
     6.5 +common code, alpha, and sh fail when used.  this should things up.
     6.6 +-mike
     6.7 +
     6.8 +2008-06-07  Mike Frysinger  <vapier@gentoo.org>
     6.9 +
    6.10 +	* sysdeps/unix/sysv/linux/sys/procfs.h: Replace with #error stub.
    6.11 +	* sysdeps/unix/sysv/linux/alpha/sys/procfs.h: Copy some asm/elf.h
    6.12 +	definitions from the kernel header to sys/procfs.h and remove the
    6.13 +	#include of asm/elf.h.
    6.14 +	* sysdeps/unix/sysv/linux/sh/sys/procfs.h: Likewise.
    6.15 +
    6.16 +*Attachment: signature.asc <msg00012/signature.asc>*
    6.17 +/Description:/ This is a digitally signed message part.
    6.18 +
    6.19 +2008-06-07  Mike Frysinger  <vapier@gentoo.org>
    6.20 +
    6.21 +	* sysdeps/unix/sysv/linux/sys/procfs.h: Replace with #error stub.
    6.22 +	* sysdeps/unix/sysv/linux/alpha/sys/procfs.h: Copy some asm/elf.h
    6.23 +	definitions from the kernel header to sys/procfs.h and remove the
    6.24 +	#include of asm/elf.h.
    6.25 +	* sysdeps/unix/sysv/linux/sh/sys/procfs.h: Likewise.
    6.26 +
    6.27 +--- a/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
    6.28 ++++ b/sysdeps/unix/sysv/linux/alpha/sys/procfs.h
    6.29 +@@ -29,10 +29,23 @@
    6.30 + #include <sys/types.h>
    6.31 + #include <sys/ucontext.h>
    6.32 + #include <sys/user.h>
    6.33 +-#include <asm/elf.h>
    6.34 + 
    6.35 + __BEGIN_DECLS
    6.36 + 
    6.37 ++/*
    6.38 ++ * The OSF/1 version of <sys/procfs.h> makes gregset_t 46 entries long.
    6.39 ++ * I have no idea why that is so.  For now, we just leave it at 33
    6.40 ++ * (32 general regs + processor status word).
    6.41 ++ */
    6.42 ++#define ELF_NGREG  33
    6.43 ++#define ELF_NFPREG 32
    6.44 ++
    6.45 ++typedef unsigned long elf_greg_t;
    6.46 ++typedef elf_greg_t elf_gregset_t[ELF_NGREG];
    6.47 ++
    6.48 ++typedef double elf_fpreg_t;
    6.49 ++typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
    6.50 ++
    6.51 + struct elf_siginfo
    6.52 +   {
    6.53 +     int si_signo;			/* Signal number.  */
    6.54 +--- a/sysdeps/unix/sysv/linux/sh/sys/procfs.h
    6.55 ++++ b/sysdeps/unix/sysv/linux/sh/sys/procfs.h
    6.56 +@@ -29,10 +29,19 @@
    6.57 + #include <sys/types.h>
    6.58 + #include <sys/ucontext.h>
    6.59 + #include <sys/user.h>
    6.60 +-#include <asm/elf.h>
    6.61 + 
    6.62 + __BEGIN_DECLS
    6.63 + 
    6.64 ++/*
    6.65 ++ * ELF register definitions...
    6.66 ++ */
    6.67 ++typedef unsigned long elf_greg_t;
    6.68 ++
    6.69 ++#define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t))
    6.70 ++typedef elf_greg_t elf_gregset_t[ELF_NGREG];
    6.71 ++
    6.72 ++typedef struct user_fpu_struct elf_fpregset_t;
    6.73 ++
    6.74 + struct elf_siginfo
    6.75 +   {
    6.76 +     int si_signo;			/* Signal number.  */
    6.77 +--- a/sysdeps/unix/sysv/linux/sys/procfs.h
    6.78 ++++ b/sysdeps/unix/sysv/linux/sys/procfs.h
    6.79 +@@ -1,115 +1,2 @@
    6.80 +-/* Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
    6.81 +-   This file is part of the GNU C Library.
    6.82 +-
    6.83 +-   The GNU C Library is free software; you can redistribute it and/or
    6.84 +-   modify it under the terms of the GNU Lesser General Public
    6.85 +-   License as published by the Free Software Foundation; either
    6.86 +-   version 2.1 of the License, or (at your option) any later version.
    6.87 +-
    6.88 +-   The GNU C Library is distributed in the hope that it will be useful,
    6.89 +-   but WITHOUT ANY WARRANTY; without even the implied warranty of
    6.90 +-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    6.91 +-   Lesser General Public License for more details.
    6.92 +-
    6.93 +-   You should have received a copy of the GNU Lesser General Public
    6.94 +-   License along with the GNU C Library; if not, write to the Free
    6.95 +-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    6.96 +-   02111-1307 USA.  */
    6.97 +-
    6.98 +-#ifndef _SYS_PROCFS_H
    6.99 +-#define _SYS_PROCFS_H	1
   6.100 +-
   6.101 +-/* This is somehow modelled after the file of the same name on SysVr4
   6.102 +-   systems.  It provides a definition of the core file format for ELF
   6.103 +-   used on Linux.  */
   6.104 +-
   6.105 +-#include <features.h>
   6.106 +-#include <signal.h>
   6.107 +-#include <sys/time.h>
   6.108 +-#include <sys/types.h>
   6.109 +-#include <sys/ucontext.h>
   6.110 +-#include <sys/user.h>
   6.111 +-#include <asm/elf.h>
   6.112 +-
   6.113 +-__BEGIN_DECLS
   6.114 +-
   6.115 +-struct elf_siginfo
   6.116 +-  {
   6.117 +-    int si_signo;			/* Signal number.  */
   6.118 +-    int si_code;			/* Extra code.  */
   6.119 +-    int si_errno;			/* Errno.  */
   6.120 +-  };
   6.121 +-
   6.122 +-/* Definitions to generate Intel SVR4-like core files.  These mostly
   6.123 +-   have the same names as the SVR4 types with "elf_" tacked on the
   6.124 +-   front to prevent clashes with linux definitions, and the typedef
   6.125 +-   forms have been avoided.  This is mostly like the SVR4 structure,
   6.126 +-   but more Linuxy, with things that Linux does not support and which
   6.127 +-   gdb doesn't really use excluded.  Fields present but not used are
   6.128 +-   marked with "XXX".  */
   6.129 +-struct elf_prstatus
   6.130 +-  {
   6.131 +-#if 0
   6.132 +-    long int pr_flags;			/* XXX Process flags.  */
   6.133 +-    short int pr_why;			/* XXX Reason for process halt.  */
   6.134 +-    short int pr_what;			/* XXX More detailed reason.  */
   6.135 +-#endif
   6.136 +-    struct elf_siginfo pr_info;		/* Info associated with signal.  */
   6.137 +-    short int pr_cursig;		/* Current signal.  */
   6.138 +-    unsigned long int pr_sigpend;	/* Set of pending signals.  */
   6.139 +-    unsigned long int pr_sighold;	/* Set of held signals.  */
   6.140 +-#if 0
   6.141 +-    struct sigaltstack pr_altstack;	/* Alternate stack info.  */
   6.142 +-    struct sigaction pr_action;		/* Signal action for current sig.  */
   6.143 +-#endif
   6.144 +-    __pid_t pr_pid;
   6.145 +-    __pid_t pr_ppid;
   6.146 +-    __pid_t pr_pgrp;
   6.147 +-    __pid_t pr_sid;
   6.148 +-    struct timeval pr_utime;		/* User time.  */
   6.149 +-    struct timeval pr_stime;		/* System time.  */
   6.150 +-    struct timeval pr_cutime;		/* Cumulative user time.  */
   6.151 +-    struct timeval pr_cstime;		/* Cumulative system time.  */
   6.152 +-#if 0
   6.153 +-    long int pr_instr;			/* Current instruction.  */
   6.154 +-#endif
   6.155 +-    elf_gregset_t pr_reg;		/* GP registers.  */
   6.156 +-    int pr_fpvalid;			/* True if math copro being used.  */
   6.157 +-  };
   6.158 +-
   6.159 +-
   6.160 +-#define ELF_PRARGSZ     (80)    /* Number of chars for args */
   6.161 +-
   6.162 +-struct elf_prpsinfo
   6.163 +-  {
   6.164 +-    char pr_state;			/* Numeric process state.  */
   6.165 +-    char pr_sname;			/* Char for pr_state.  */
   6.166 +-    char pr_zomb;			/* Zombie.  */
   6.167 +-    char pr_nice;			/* Nice val.  */
   6.168 +-    unsigned long int pr_flag;		/* Flags.  */
   6.169 +-    unsigned short int pr_uid;
   6.170 +-    unsigned short int pr_gid;
   6.171 +-    int pr_pid, pr_ppid, pr_pgrp, pr_sid;
   6.172 +-    /* Lots missing */
   6.173 +-    char pr_fname[16];			/* Filename of executable.  */
   6.174 +-    char pr_psargs[ELF_PRARGSZ];	/* Initial part of arg list.  */
   6.175 +-  };
   6.176 +-
   6.177 +-/* Addresses.  */
   6.178 +-typedef void *psaddr_t;
   6.179 +-
   6.180 +-/* Register sets.  Linux has different names.  */
   6.181 +-typedef gregset_t prgregset_t;
   6.182 +-typedef fpregset_t prfpregset_t;
   6.183 +-
   6.184 +-/* We don't have any differences between processes and threads,
   6.185 +-   therefore habe only ine PID type.  */
   6.186 +-typedef __pid_t lwpid_t;
   6.187 +-
   6.188 +-
   6.189 +-typedef struct elf_prstatus prstatus_t;
   6.190 +-typedef struct elf_prpsinfo prpsinfo_t;
   6.191 +-
   6.192 +-__END_DECLS
   6.193 +-
   6.194 +-#endif	/* sys/procfs.h */
   6.195 ++/* sys/procfs.h is architecture specific.  */
   6.196 ++#error "This file must be supplied by every Linux architecture."
   6.197 +