patches/glibc/2.5/170-alpha-asm_elf.patch
changeset 747 d3e603e7c17c
parent 665 313618c2c185
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/patches/glibc/2.5/170-alpha-asm_elf.patch	Mon Jul 28 21:32:33 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 +