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>
Tue May 08 17:48:32 2007 +0000 (2007-05-08)
changeset 78 c3868084d81a
permissions -rw-r--r--
Huge fixes to glibc build, so that we can build at least (and at last):
- use ports addon even when installing headers,
- use optimisation (-O) when installing headers, to avoid unnecessary warnings (thanks Robert P. J. DAY for pointing this out!),
- lowest kernel version to use is only X.Y.Z, not X.Y.Z.T,
- a bit of preparations for NPTL (RSN I hope),
- fix fixing the linker scripts (changing the backup file is kind of useless and stupid);

Shut uClibc finish step: there really is nothing to do;

Add a patch for glibc-2.3.6 weak aliases handling on some archs (ARM and ALPHA at least);

Did not catch the make errors: fixed the pattern matching in scripts/functions;

Introduce a new log level, ALL:
- send components' build messages there,
- DEBUG log level is destined only for crosstool-NG debug messages,
- migrate sub-actions to use appropriate log levels;

Update the armeb-unknown-linux-gnu sample:
- it builds!
- uses gcc-4.0.4 and glibc-2.3.6,
- updated to latest config options set.
yann@1
     1
Fixes
yann@1
     2
yann@1
     3
In file included from strcoll.c:101:
yann@1
     4
../locale/weight.h: In function 'strcoll':
yann@1
     5
../locale/weight.h:23: error: invalid storage class for function 'findidx'
yann@1
     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
yann@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'
yann@1
     8
make[1]: *** [string/subdir_lib] Error 2
yann@1
     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'
yann@1
    10
make: *** [all] Error 2
yann@1
    11
yann@1
    12
Discussed here
yann@1
    13
http://sources.redhat.com/ml/libc-hacker/2004-09/msg00015.html
yann@1
    14
the fix checked in to cvs seems to be
yann@1
    15
http://sources.redhat.com/ml/glibc-cvs/2004-q3/msg01071.html
yann@1
    16
but that fix doesn't support older gcc's, so I can't use it directly.
yann@1
    17
yann@1
    18
Here's a fix the does work with older versions of gcc:
yann@1
    19
yann@1
    20
--- glibc-2.2.5/locale/weight.h.old	2001-07-05 21:55:33.000000000 -0700
yann@1
    21
+++ glibc-2.2.5/locale/weight.h	2005-03-10 16:07:46.669579888 -0800
yann@1
    22
@@ -18,7 +18,12 @@
yann@1
    23
    02111-1307 USA.  */
yann@1
    24
 
yann@1
    25
 /* Find index of weight.  */
yann@1
    26
+#if __GNUC__ >= 4
yann@1
    27
+auto inline int32_t
yann@1
    28
+__attribute ((always_inline))
yann@1
    29
+#else
yann@1
    30
 static inline int32_t
yann@1
    31
+#endif
yann@1
    32
 findidx (const unsigned char **cpp)
yann@1
    33
 {
yann@1
    34
   int_fast32_t i = table[*(*cpp)++];
yann@1
    35
--- glibc-2.2.5/locale/weightwc.h.old	2001-08-06 21:26:15.000000000 -0700
yann@1
    36
+++ glibc-2.2.5/locale/weightwc.h	2005-03-10 16:13:08.651631176 -0800
yann@1
    37
@@ -18,7 +18,12 @@
yann@1
    38
    02111-1307 USA.  */
yann@1
    39
 
yann@1
    40
 /* Find index of weight.  */
yann@1
    41
+#if __GNUC__ >= 4
yann@1
    42
+auto inline int32_t
yann@1
    43
+__attribute ((always_inline))
yann@1
    44
+#else
yann@1
    45
 static inline int32_t
yann@1
    46
+#endif
yann@1
    47
 findidx (const wint_t **cpp)
yann@1
    48
 {
yann@1
    49
   int32_t i;