patches/glibc/ports-2.10.1/480-alpha-add-dl-procinfo-support.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Jan 17 23:06:02 2010 +0100 (2010-01-17)
changeset 1740 c57458bb354d
permissions -rw-r--r--
configure: do not require hg when configuring in an hg clone

When configuring in an hg clone, we need hg to compute the version string.
It can happen that users do not have Mercurial (eg. if they got a snapshot
rather that they did a full clone). In this case, we can still run, of
course, so simply fill the version string with a sufficiently explicit
value, that does not require hg. The date is a good candidate.
     1  ports/sysdeps/alpha/dl-machine.h  |   12 ++++++
     2  ports/sysdeps/alpha/dl-procinfo.c |   64 +++++++++++++++++++++++++++++++++++
     3  ports/sysdeps/alpha/dl-procinfo.h |   68 ++++++++++++++++++++++++++++++++++++++
     4  3 files changed, 144 insertions(+)
     5 
     6 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
     7 --- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/alpha/dl-machine.h	2009-05-16 10:36:20.000000000 +0200
     8 +++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/alpha/dl-machine.h	2009-11-13 00:51:02.000000000 +0100
     9 @@ -249,6 +249,18 @@
    10  /* The alpha never uses Elf64_Rel relocations.  */
    11  #define ELF_MACHINE_NO_REL 1
    12  
    13 +/* We define an initialization functions.  This is called very early in
    14 + *    _dl_sysdep_start.  */
    15 +#define DL_PLATFORM_INIT dl_platform_init ()
    16 +
    17 +static inline void __attribute__ ((unused))
    18 +dl_platform_init (void)
    19 +{
    20 +	if (GLRO(dl_platform) != NULL && *GLRO(dl_platform) == '\0')
    21 +	/* Avoid an empty string which would disturb us.  */
    22 +		GLRO(dl_platform) = NULL;
    23 +}
    24 +	
    25  /* Fix up the instructions of a PLT entry to invoke the function
    26     rather than the dynamic linker.  */
    27  static inline Elf64_Addr
    28 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
    29 --- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/alpha/dl-procinfo.c	1970-01-01 01:00:00.000000000 +0100
    30 +++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/alpha/dl-procinfo.c	2009-11-13 00:51:02.000000000 +0100
    31 @@ -0,0 +1,64 @@
    32 +/* Data for Alpha version of processor capability information.
    33 +   Copyright (C) 2007 Free Software Foundation, Inc.
    34 +   This file is part of the GNU C Library.
    35 +   Contributed by Aurelien Jarno <aurelien@aurel32.net>, 2007.
    36 +
    37 +   The GNU C Library is free software; you can redistribute it and/or
    38 +   modify it under the terms of the GNU Lesser General Public
    39 +   License as published by the Free Software Foundation; either
    40 +   version 2.1 of the License, or (at your option) any later version.
    41 +
    42 +   The GNU C Library is distributed in the hope that it will be useful,
    43 +   but WITHOUT ANY WARRANTY; without even the implied warranty of
    44 +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    45 +   Lesser General Public License for more details.
    46 +
    47 +   You should have received a copy of the GNU Lesser General Public
    48 +   License along with the GNU C Library; if not, write to the Free
    49 +   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    50 +   02111-1307 USA.  */
    51 +
    52 +/* This information must be kept in sync with the _DL_PLATFORM_COUNT 
    53 +   definitions in procinfo.h.
    54 +
    55 +   If anything should be added here check whether the size of each string
    56 +   is still ok with the given array size.
    57 +
    58 +   All the #ifdefs in the definitions are quite irritating but
    59 +   necessary if we want to avoid duplicating the information.  There
    60 +   are three different modes:
    61 +
    62 +   - PROCINFO_DECL is defined.  This means we are only interested in
    63 +     declarations.
    64 +
    65 +   - PROCINFO_DECL is not defined:
    66 +
    67 +     + if SHARED is defined the file is included in an array
    68 +       initializer.  The .element = { ... } syntax is needed.
    69 +
    70 +     + if SHARED is not defined a normal array initialization is
    71 +       needed.
    72 +  */
    73 +
    74 +#ifndef PROCINFO_CLASS
    75 +#define PROCINFO_CLASS
    76 +#endif
    77 +
    78 +#if !defined PROCINFO_DECL && defined SHARED
    79 +  ._dl_alpha_platforms
    80 +#else
    81 +PROCINFO_CLASS const char _dl_alpha_platforms[5][5]
    82 +#endif
    83 +#ifndef PROCINFO_DECL
    84 += {
    85 +    "ev4", "ev5", "ev56", "ev6", "ev67"
    86 +  }
    87 +#endif
    88 +#if !defined SHARED || defined PROCINFO_DECL
    89 +;
    90 +#else
    91 +,
    92 +#endif
    93 +
    94 +#undef PROCINFO_DECL
    95 +#undef PROCINFO_CLASS
    96 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
    97 --- glibc-2.10.1.orig/glibc-ports-2.10.1/sysdeps/alpha/dl-procinfo.h	1970-01-01 01:00:00.000000000 +0100
    98 +++ glibc-2.10.1/glibc-ports-2.10.1/sysdeps/alpha/dl-procinfo.h	2009-11-13 00:51:02.000000000 +0100
    99 @@ -0,0 +1,68 @@
   100 +/* Alpha version of processor capability information handling macros.
   101 +   Copyright (C) 2007 Free Software Foundation, Inc.
   102 +   This file is part of the GNU C Library.
   103 +   Contributed by Aurelien Jarno <aurelien@aurel32.net>, 2007.
   104 +
   105 +   The GNU C Library is free software; you can redistribute it and/or
   106 +   modify it under the terms of the GNU Lesser General Public
   107 +   License as published by the Free Software Foundation; either
   108 +   version 2.1 of the License, or (at your option) any later version.
   109 +
   110 +   The GNU C Library is distributed in the hope that it will be useful,
   111 +   but WITHOUT ANY WARRANTY; without even the implied warranty of
   112 +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   113 +   Lesser General Public License for more details.
   114 +
   115 +   You should have received a copy of the GNU Lesser General Public
   116 +   License along with the GNU C Library; if not, write to the Free
   117 +   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
   118 +   02111-1307 USA.  */
   119 +
   120 +#ifndef _DL_PROCINFO_H
   121 +#define _DL_PROCINFO_H	1
   122 +
   123 +#include <ldsodefs.h>
   124 +
   125 +
   126 +/* Mask to filter out platforms.  */
   127 +#define _DL_HWCAP_PLATFORM    (-1ULL)
   128 +
   129 +#define _DL_PLATFORMS_COUNT   5
   130 +
   131 +static inline const char *
   132 +__attribute__ ((unused))
   133 +_dl_platform_string (int idx)
   134 +{
   135 +  return GLRO(dl_alpha_platforms)[idx];
   136 +};
   137 +
   138 +static inline int
   139 +__attribute__ ((unused, always_inline))
   140 +_dl_string_platform (const char *str)
   141 +{
   142 +  int i;
   143 +
   144 +  if (str != NULL)
   145 +    for (i = 0; i < _DL_PLATFORMS_COUNT; ++i)
   146 +      {
   147 +        if (strcmp (str, _dl_platform_string (i)) == 0)
   148 +          return i;
   149 +      }
   150 +  return -1;
   151 +};
   152 +
   153 +/* We cannot provide a general printing function.  */
   154 +#define _dl_procinfo(word) -1
   155 +
   156 +/* There are no hardware capabilities defined.  */
   157 +#define _dl_hwcap_string(idx) ""
   158 +
   159 +/* By default there is no important hardware capability.  */
   160 +#define HWCAP_IMPORTANT (0)
   161 +
   162 +/* We don't have any hardware capabilities.  */
   163 +#define _DL_HWCAP_COUNT	0
   164 +
   165 +#define _dl_string_hwcap(str) (-1)
   166 +
   167 +#endif /* dl-procinfo.h */
   168 diff -durN glibc-2.10.1.orig/ports/sysdeps/alpha/dl-machine.h glibc-2.10.1/ports/sysdeps/alpha/dl-machine.h
   169 diff -durN glibc-2.10.1.orig/ports/sysdeps/alpha/dl-procinfo.c glibc-2.10.1/ports/sysdeps/alpha/dl-procinfo.c
   170 diff -durN glibc-2.10.1.orig/ports/sysdeps/alpha/dl-procinfo.h glibc-2.10.1/ports/sysdeps/alpha/dl-procinfo.h