patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-posix.patch
changeset 1 eeea35fbf182
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-posix.patch	Sat Feb 24 11:00:05 2007 +0000
     1.3 @@ -0,0 +1,77 @@
     1.4 +Fixes errors
     1.5 +
     1.6 +regcomp.c: In function 'parse_bracket_exp':
     1.7 +regcomp.c:2724: error: invalid storage class for function 'seek_collating_symbol_entry'
     1.8 +regcomp.c:2757: error: invalid storage class for function 'lookup_collation_sequence_value'
     1.9 +regcomp.c:2826: error: invalid storage class for function 'build_range_exp'
    1.10 +regcomp.c:2913: error: invalid storage class for function 'build_collating_symbol'
    1.11 +...
    1.12 +make[2]: *** [/home/dank/queue/jobdir.fast/crosstool-dev/build/x86_64-unknown-linux-gnu/gcc-4.0-20050305-glibc-2.3.3/build-glibc/posix/regex.o] Error 1
    1.13 +
    1.14 +See also http://sources.redhat.com/ml/glibc-cvs/2004-q3/msg01071.html
    1.15 +That fix requires gcc-4.0, but the fix proposed here works with older compilers, too
    1.16 +
    1.17 +--- glibc-2.3.3/posix/regcomp.c.old	2005-03-16 11:40:55.000000000 -0800
    1.18 ++++ glibc-2.3.3/posix/regcomp.c	2005-03-16 11:50:31.000000000 -0800
    1.19 +@@ -2718,8 +2718,14 @@
    1.20 +      Seek the collating symbol entry correspondings to NAME.
    1.21 +      Return the index of the symbol in the SYMB_TABLE.  */
    1.22 + 
    1.23 ++#if __GNUC__ >= 4
    1.24 ++  auto inline int32_t
    1.25 ++#else
    1.26 +   static inline int32_t
    1.27 ++#endif
    1.28 ++#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
    1.29 +   __attribute ((always_inline))
    1.30 ++#endif
    1.31 +   seek_collating_symbol_entry (name, name_len)
    1.32 + 	 const unsigned char *name;
    1.33 + 	 size_t name_len;
    1.34 +@@ -2751,8 +2757,14 @@
    1.35 +      Look up the collation sequence value of BR_ELEM.
    1.36 +      Return the value if succeeded, UINT_MAX otherwise.  */
    1.37 + 
    1.38 ++#if __GNUC__ >= 4
    1.39 ++  auto inline unsigned int
    1.40 ++#else
    1.41 +   static inline unsigned int
    1.42 ++#endif
    1.43 ++#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
    1.44 +   __attribute ((always_inline))
    1.45 ++#endif
    1.46 +   lookup_collation_sequence_value (br_elem)
    1.47 + 	 bracket_elem_t *br_elem;
    1.48 +     {
    1.49 +@@ -2819,8 +2831,14 @@
    1.50 +      mbcset->range_ends, is a pointer argument sinse we may
    1.51 +      update it.  */
    1.52 + 
    1.53 +-  static inline reg_errcode_t
    1.54 ++#if __GNUC__ >= 4
    1.55 ++  auto inline reg_errcode_t
    1.56 ++#else
    1.57 ++  static inline reg_errcode_t
    1.58 ++#endif
    1.59 ++#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
    1.60 +   __attribute ((always_inline))
    1.61 ++#endif
    1.62 + # ifdef RE_ENABLE_I18N
    1.63 +   build_range_exp (sbcset, mbcset, range_alloc, start_elem, end_elem)
    1.64 + 	 re_charset_t *mbcset;
    1.65 +@@ -2906,8 +2924,14 @@
    1.66 +      COLL_SYM_ALLOC is the allocated size of mbcset->coll_sym, is a
    1.67 +      pointer argument sinse we may update it.  */
    1.68 + 
    1.69 +-  static inline reg_errcode_t
    1.70 ++#if __GNUC__ >= 4
    1.71 ++  auto inline reg_errcode_t
    1.72 ++#else
    1.73 ++  static inline reg_errcode_t
    1.74 ++#endif
    1.75 ++#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
    1.76 +   __attribute ((always_inline))
    1.77 ++#endif
    1.78 + # ifdef RE_ENABLE_I18N
    1.79 +   build_collating_symbol (sbcset, mbcset, coll_sym_alloc, name)
    1.80 + 	 re_charset_t *mbcset;