patches/glibc/ports-2.10.1/480-alpha-add-dl-procinfo-support.patch
changeset 1625 fde082da9813
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/patches/glibc/ports-2.10.1/480-alpha-add-dl-procinfo-support.patch	Fri Nov 13 21:37:18 2009 +0100
     1.3 @@ -0,0 +1,170 @@
     1.4 + ports/sysdeps/alpha/dl-machine.h  |   12 ++++++
     1.5 + ports/sysdeps/alpha/dl-procinfo.c |   64 +++++++++++++++++++++++++++++++++++
     1.6 + ports/sysdeps/alpha/dl-procinfo.h |   68 ++++++++++++++++++++++++++++++++++++++
     1.7 + 3 files changed, 144 insertions(+)
     1.8 +
     1.9 +diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/alpha/dl-machine.h glibc-2.10.1/glibc-ports-2.10.1/sysdeps/alpha/dl-machine.h
    1.10 +--- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/alpha/dl-machine.h	2009-05-16 10:36:20.000000000 +0200
    1.11 ++++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/alpha/dl-machine.h	2009-11-13 00:51:02.000000000 +0100
    1.12 +@@ -249,6 +249,18 @@
    1.13 + /* The alpha never uses Elf64_Rel relocations.  */
    1.14 + #define ELF_MACHINE_NO_REL 1
    1.15 + 
    1.16 ++/* We define an initialization functions.  This is called very early in
    1.17 ++ *    _dl_sysdep_start.  */
    1.18 ++#define DL_PLATFORM_INIT dl_platform_init ()
    1.19 ++
    1.20 ++static inline void __attribute__ ((unused))
    1.21 ++dl_platform_init (void)
    1.22 ++{
    1.23 ++	if (GLRO(dl_platform) != NULL && *GLRO(dl_platform) == '\0')
    1.24 ++	/* Avoid an empty string which would disturb us.  */
    1.25 ++		GLRO(dl_platform) = NULL;
    1.26 ++}
    1.27 ++	
    1.28 + /* Fix up the instructions of a PLT entry to invoke the function
    1.29 +    rather than the dynamic linker.  */
    1.30 + static inline Elf64_Addr
    1.31 +diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/alpha/dl-procinfo.c glibc-2.10.1/glibc-ports-2.10.1/sysdeps/alpha/dl-procinfo.c
    1.32 +--- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/alpha/dl-procinfo.c	1970-01-01 01:00:00.000000000 +0100
    1.33 ++++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/alpha/dl-procinfo.c	2009-11-13 00:51:02.000000000 +0100
    1.34 +@@ -0,0 +1,64 @@
    1.35 ++/* Data for Alpha version of processor capability information.
    1.36 ++   Copyright (C) 2007 Free Software Foundation, Inc.
    1.37 ++   This file is part of the GNU C Library.
    1.38 ++   Contributed by Aurelien Jarno <aurelien@aurel32.net>, 2007.
    1.39 ++
    1.40 ++   The GNU C Library is free software; you can redistribute it and/or
    1.41 ++   modify it under the terms of the GNU Lesser General Public
    1.42 ++   License as published by the Free Software Foundation; either
    1.43 ++   version 2.1 of the License, or (at your option) any later version.
    1.44 ++
    1.45 ++   The GNU C Library is distributed in the hope that it will be useful,
    1.46 ++   but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.47 ++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    1.48 ++   Lesser General Public License for more details.
    1.49 ++
    1.50 ++   You should have received a copy of the GNU Lesser General Public
    1.51 ++   License along with the GNU C Library; if not, write to the Free
    1.52 ++   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    1.53 ++   02111-1307 USA.  */
    1.54 ++
    1.55 ++/* This information must be kept in sync with the _DL_PLATFORM_COUNT 
    1.56 ++   definitions in procinfo.h.
    1.57 ++
    1.58 ++   If anything should be added here check whether the size of each string
    1.59 ++   is still ok with the given array size.
    1.60 ++
    1.61 ++   All the #ifdefs in the definitions are quite irritating but
    1.62 ++   necessary if we want to avoid duplicating the information.  There
    1.63 ++   are three different modes:
    1.64 ++
    1.65 ++   - PROCINFO_DECL is defined.  This means we are only interested in
    1.66 ++     declarations.
    1.67 ++
    1.68 ++   - PROCINFO_DECL is not defined:
    1.69 ++
    1.70 ++     + if SHARED is defined the file is included in an array
    1.71 ++       initializer.  The .element = { ... } syntax is needed.
    1.72 ++
    1.73 ++     + if SHARED is not defined a normal array initialization is
    1.74 ++       needed.
    1.75 ++  */
    1.76 ++
    1.77 ++#ifndef PROCINFO_CLASS
    1.78 ++#define PROCINFO_CLASS
    1.79 ++#endif
    1.80 ++
    1.81 ++#if !defined PROCINFO_DECL && defined SHARED
    1.82 ++  ._dl_alpha_platforms
    1.83 ++#else
    1.84 ++PROCINFO_CLASS const char _dl_alpha_platforms[5][5]
    1.85 ++#endif
    1.86 ++#ifndef PROCINFO_DECL
    1.87 ++= {
    1.88 ++    "ev4", "ev5", "ev56", "ev6", "ev67"
    1.89 ++  }
    1.90 ++#endif
    1.91 ++#if !defined SHARED || defined PROCINFO_DECL
    1.92 ++;
    1.93 ++#else
    1.94 ++,
    1.95 ++#endif
    1.96 ++
    1.97 ++#undef PROCINFO_DECL
    1.98 ++#undef PROCINFO_CLASS
    1.99 +diff -durN glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/alpha/dl-procinfo.h glibc-2.10.1/glibc-ports-2.10.1/sysdeps/alpha/dl-procinfo.h
   1.100 +--- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/alpha/dl-procinfo.h	1970-01-01 01:00:00.000000000 +0100
   1.101 ++++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/alpha/dl-procinfo.h	2009-11-13 00:51:02.000000000 +0100
   1.102 +@@ -0,0 +1,68 @@
   1.103 ++/* Alpha version of processor capability information handling macros.
   1.104 ++   Copyright (C) 2007 Free Software Foundation, Inc.
   1.105 ++   This file is part of the GNU C Library.
   1.106 ++   Contributed by Aurelien Jarno <aurelien@aurel32.net>, 2007.
   1.107 ++
   1.108 ++   The GNU C Library is free software; you can redistribute it and/or
   1.109 ++   modify it under the terms of the GNU Lesser General Public
   1.110 ++   License as published by the Free Software Foundation; either
   1.111 ++   version 2.1 of the License, or (at your option) any later version.
   1.112 ++
   1.113 ++   The GNU C Library is distributed in the hope that it will be useful,
   1.114 ++   but WITHOUT ANY WARRANTY; without even the implied warranty of
   1.115 ++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   1.116 ++   Lesser General Public License for more details.
   1.117 ++
   1.118 ++   You should have received a copy of the GNU Lesser General Public
   1.119 ++   License along with the GNU C Library; if not, write to the Free
   1.120 ++   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
   1.121 ++   02111-1307 USA.  */
   1.122 ++
   1.123 ++#ifndef _DL_PROCINFO_H
   1.124 ++#define _DL_PROCINFO_H	1
   1.125 ++
   1.126 ++#include <ldsodefs.h>
   1.127 ++
   1.128 ++
   1.129 ++/* Mask to filter out platforms.  */
   1.130 ++#define _DL_HWCAP_PLATFORM    (-1ULL)
   1.131 ++
   1.132 ++#define _DL_PLATFORMS_COUNT   5
   1.133 ++
   1.134 ++static inline const char *
   1.135 ++__attribute__ ((unused))
   1.136 ++_dl_platform_string (int idx)
   1.137 ++{
   1.138 ++  return GLRO(dl_alpha_platforms)[idx];
   1.139 ++};
   1.140 ++
   1.141 ++static inline int
   1.142 ++__attribute__ ((unused, always_inline))
   1.143 ++_dl_string_platform (const char *str)
   1.144 ++{
   1.145 ++  int i;
   1.146 ++
   1.147 ++  if (str != NULL)
   1.148 ++    for (i = 0; i < _DL_PLATFORMS_COUNT; ++i)
   1.149 ++      {
   1.150 ++        if (strcmp (str, _dl_platform_string (i)) == 0)
   1.151 ++          return i;
   1.152 ++      }
   1.153 ++  return -1;
   1.154 ++};
   1.155 ++
   1.156 ++/* We cannot provide a general printing function.  */
   1.157 ++#define _dl_procinfo(word) -1
   1.158 ++
   1.159 ++/* There are no hardware capabilities defined.  */
   1.160 ++#define _dl_hwcap_string(idx) ""
   1.161 ++
   1.162 ++/* By default there is no important hardware capability.  */
   1.163 ++#define HWCAP_IMPORTANT (0)
   1.164 ++
   1.165 ++/* We don't have any hardware capabilities.  */
   1.166 ++#define _DL_HWCAP_COUNT	0
   1.167 ++
   1.168 ++#define _dl_string_hwcap(str) (-1)
   1.169 ++
   1.170 ++#endif /* dl-procinfo.h */
   1.171 +diff -durN glibc-2.10.1.orig/ports/sysdeps/alpha/dl-machine.h glibc-2.10.1/ports/sysdeps/alpha/dl-machine.h
   1.172 +diff -durN glibc-2.10.1.orig/ports/sysdeps/alpha/dl-procinfo.c glibc-2.10.1/ports/sysdeps/alpha/dl-procinfo.c
   1.173 +diff -durN glibc-2.10.1.orig/ports/sysdeps/alpha/dl-procinfo.h glibc-2.10.1/ports/sysdeps/alpha/dl-procinfo.h