patches/glibc/2.2.5/glibc-2.2.5-allow-gcc-4.0-locale.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sat Jul 28 21:34:41 2007 +0000 (2007-07-28)
changeset 301 2be7232a73ac
permissions -rw-r--r--
Bump version to 0.2.2.
     1 Fixes
     2 
     3 In file included from strcoll.c:101:
     4 ../locale/weight.h: In function 'strcoll':
     5 ../locale/weight.h:23: error: invalid storage class for function 'findidx'
     6 make[2]: *** [/home/dank/queue/jobdir.fast2/crosstool-dev/build/i686-unknown-linux-gnu/gcc-4.0-20050305-glibc-2.2.5/build-glibc/string/strcoll.o] Error 1
     7 make[2]: Leaving directory `/home/dank/queue/jobdir.fast2/crosstool-dev/build/i686-unknown-linux-gnu/gcc-4.0-20050305-glibc-2.2.5/glibc-2.2.5/string'
     8 make[1]: *** [string/subdir_lib] Error 2
     9 make[1]: Leaving directory `/home/dank/queue/jobdir.fast2/crosstool-dev/build/i686-unknown-linux-gnu/gcc-4.0-20050305-glibc-2.2.5/glibc-2.2.5'
    10 make: *** [all] Error 2
    11 
    12 Discussed here
    13 http://sources.redhat.com/ml/libc-hacker/2004-09/msg00015.html
    14 the fix checked in to cvs seems to be
    15 http://sources.redhat.com/ml/glibc-cvs/2004-q3/msg01071.html
    16 but that fix doesn't support older gcc's, so I can't use it directly.
    17 
    18 Here's a fix the does work with older versions of gcc:
    19 
    20 --- glibc-2.2.5/locale/weight.h.old	2001-07-05 21:55:33.000000000 -0700
    21 +++ glibc-2.2.5/locale/weight.h	2005-03-10 16:07:46.669579888 -0800
    22 @@ -18,7 +18,12 @@
    23     02111-1307 USA.  */
    24  
    25  /* Find index of weight.  */
    26 +#if __GNUC__ >= 4
    27 +auto inline int32_t
    28 +__attribute ((always_inline))
    29 +#else
    30  static inline int32_t
    31 +#endif
    32  findidx (const unsigned char **cpp)
    33  {
    34    int_fast32_t i = table[*(*cpp)++];
    35 --- glibc-2.2.5/locale/weightwc.h.old	2001-08-06 21:26:15.000000000 -0700
    36 +++ glibc-2.2.5/locale/weightwc.h	2005-03-10 16:13:08.651631176 -0800
    37 @@ -18,7 +18,12 @@
    38     02111-1307 USA.  */
    39  
    40  /* Find index of weight.  */
    41 +#if __GNUC__ >= 4
    42 +auto inline int32_t
    43 +__attribute ((always_inline))
    44 +#else
    45  static inline int32_t
    46 +#endif
    47  findidx (const wint_t **cpp)
    48  {
    49    int32_t i;