patches/glibc/2.2.5/glibc-2.2.5-allow-gcc-4.0-gconv.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sat Feb 24 11:00:05 2007 +0000 (2007-02-24)
changeset 1 eeea35fbf182
permissions -rw-r--r--
Add the full crosstool-NG sources to the new repository of its own.
You might just say: 'Yeah! crosstool-NG's got its own repo!".
Unfortunately, that's because the previous repo got damaged beyond repair and I had no backup.
That means I'm putting backups in place in the afternoon.
That also means we've lost history... :-(
     1 Fixes
     2 gconv_open.c: In function `__gconv_open':
     3 gconv_open.c:186: error: invalid lvalue in assignment
     4 when building glibc-2.2.5 with gcc-4.0.
     5 Same as ../glibc-2.3.2/glibc-2.3.2-allow-gcc-3.5-gconv.patch
     6 but rediffed against glibc-2.2.5.
     7 
     8 wget 'http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/iconv/gconv_simple.c.diff?r1=1.59&r2=1.63&cvsroot=glibc'
     9         * (internal_ucs4_loop): Fix typo in last change.
    10 
    11         * (internal_ucs4le_loop): Remove cast used as lvalue.
    12 
    13         * Fix last commit.
    14 
    15 	* iconv/gconv_simple.c (ucs4le_internal_loop): Remove cast used as lvalue.
    16 	(internal_ucs4le_loop_single): Likewise.
    17 	(ucs4_internal_loop): Likewise.
    18 	(BODY): Likewise.
    19 	(internal_ucs4_loop_single): Likewise.
    20 
    21 wget 'http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/iconv/gconv_open.c.diff?r1=1.32&r2=1.33&cvsroot=glibc'
    22 	* iconv/gconv_simple.c (ucs4le_internal_loop): Remove cast used as lvalue.
    23 	(internal_ucs4le_loop_single): Likewise.
    24 	(ucs4_internal_loop): Likewise.
    25 	(BODY): Likewise.
    26 	(internal_ucs4_loop_single): Likewise.
    27 
    28 
    29 ===================================================================
    30 RCS file: /cvs/glibc/libc/iconv/gconv_open.c,v
    31 retrieving revision 1.32
    32 retrieving revision 1.33
    33 diff -u -r1.32 -r1.33
    34 --- libc/iconv/gconv_open.c	2001/11/29 04:51:58	1.32
    35 +++ libc/iconv/gconv_open.c	2004/02/07 15:56:32	1.33
    36 @@ -1,5 +1,5 @@
    37  /* Find matching transformation algorithms and initialize steps.
    38 -   Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
    39 +   Copyright (C) 1997, 1998, 1999, 2000, 2001, 2004 Free Software Foundation, Inc.
    40     This file is part of the GNU C Library.
    41     Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
    42  
    43 @@ -182,8 +182,13 @@
    44  	      || __builtin_expect (__gconv_translit_find (runp), 0) == 0)
    45  	    lastp = runp;
    46  	  else
    47 -	    /* This means we haven't found the module.  Remove it.  */
    48 -	    (lastp == NULL ? trans : lastp->next) = runp->next;
    49 +	    {
    50 +	      /* This means we haven't found the module.  Remove it.  */
    51 +	      if (lastp == NULL)
    52 +		trans  = runp->next;
    53 +	      else
    54 +		lastp->next  = runp->next;
    55 +	    }
    56  	}
    57  
    58        /* Allocate room for handle.  */
    59 ===================================================================
    60 --- glibc-2.2.5/iconv/gconv_simple.c.old	2001-08-03 15:06:46.000000000 -0700
    61 +++ glibc-2.2.5/iconv/gconv_simple.c	2005-03-10 00:49:45.558181608 -0800
    62 @@ -1,5 +1,5 @@
    63  /* Simple transformations functions.
    64 -   Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
    65 +   Copyright (C) 1997, 1998, 1999, 2000, 2001, 2004 Free Software Foundation, Inc.
    66     This file is part of the GNU C Library.
    67     Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
    68  
    69 @@ -73,12 +73,13 @@
    70  #if __BYTE_ORDER == __LITTLE_ENDIAN
    71    /* Sigh, we have to do some real work.  */
    72    size_t cnt;
    73 +  uint32_t *outptr32 = (uint32_t *) outptr;
    74  
    75    for (cnt = 0; cnt < n_convert; ++cnt, inptr += 4)
    76 -    *((uint32_t *) outptr)++ = bswap_32 (*(const uint32_t *) inptr);
    77 +    *outptr32++ = bswap_32 (*(const uint32_t *) inptr);
    78  
    79    *inptrp = inptr;
    80 -  *outptrp = outptr;
    81 +  *outptrp = (unsigned char *) outptr32;
    82  #elif __BYTE_ORDER == __BIG_ENDIAN
    83    /* Simply copy the data.  */
    84    *inptrp = inptr + n_convert * 4;
    85 @@ -176,13 +177,16 @@
    86    (*outptrp)[2] = state->__value.__wchb[1];
    87    (*outptrp)[3] = state->__value.__wchb[0];
    88  
    89 -  *outptrp += 4;
    90  #elif __BYTE_ORDER == __BIG_ENDIAN
    91    /* XXX unaligned */
    92 -  *(*((uint32_t **) outptrp)++) = state->__value.__wch;
    93 +  (*outptrp)[0] = state->__value.__wchb[0];
    94 +  (*outptrp)[1] = state->__value.__wchb[1];
    95 +  (*outptrp)[2] = state->__value.__wchb[2];
    96 +  (*outptrp)[3] = state->__value.__wchb[3];
    97  #else
    98  # error "This endianess is not supported."
    99  #endif
   100 +  *outptrp += 4;
   101  
   102    /* Clear the state buffer.  */
   103    state->__count &= ~7;
   104 @@ -251,7 +255,8 @@
   105  	  return __GCONV_ILLEGAL_INPUT;
   106  	}
   107  
   108 -      *((uint32_t *) outptr)++ = inval;
   109 +      *((uint32_t *) outptr) = inval;
   110 +      outptr += sizeof (uint32_t);
   111      }
   112  
   113    *inptrp = inptr;
   114 @@ -427,9 +432,11 @@
   115  #if __BYTE_ORDER == __BIG_ENDIAN
   116    /* Sigh, we have to do some real work.  */
   117    size_t cnt;
   118 +  uint32_t *outptr32 = (uint32_t *) outptr;
   119  
   120    for (cnt = 0; cnt < n_convert; ++cnt, inptr += 4)
   121 -    *((uint32_t *) outptr)++ = bswap_32 (*(const uint32_t *) inptr);
   122 +    *outptr32++ = bswap_32 (*(const uint32_t *) inptr);
   123 +  outptr = (unsigned char *) outptr32;
   124  
   125    *inptrp = inptr;
   126    *outptrp = outptr;
   127 @@ -530,12 +537,17 @@
   128    (*outptrp)[2] = state->__value.__wchb[1];
   129    (*outptrp)[3] = state->__value.__wchb[0];
   130  
   131 -  *outptrp += 4;
   132  #else
   133    /* XXX unaligned */
   134 -  *(*((uint32_t **) outptrp)++) = state->__value.__wch;
   135 +  (*outptrp)[0] = state->__value.__wchb[0];
   136 +  (*outptrp)[1] = state->__value.__wchb[1];
   137 +  (*outptrp)[2] = state->__value.__wchb[2];
   138 +  (*outptrp)[3] = state->__value.__wchb[3];
   139 +
   140  #endif
   141  
   142 +  *outptrp += 4;
   143 +
   144    /* Clear the state buffer.  */
   145    state->__count &= ~7;
   146  
   147 @@ -600,7 +612,8 @@
   148  	  return __GCONV_ILLEGAL_INPUT;
   149  	}
   150  
   151 -      *((uint32_t *) outptr)++ = inval;
   152 +      *((uint32_t *) outptr) = inval;
   153 +      outptr += sizeof (uint32_t);
   154      }
   155  
   156    *inptrp = inptr;
   157 @@ -782,7 +795,8 @@
   158        }									      \
   159      else								      \
   160        /* It's an one byte sequence.  */					      \
   161 -      *((uint32_t *) outptr)++ = *inptr++;				      \
   162 +      *((uint32_t *) outptr) = *inptr++;				      \
   163 +      outptr += sizeof (uint32_t);					      \
   164    }
   165  #define LOOP_NEED_FLAGS
   166  #include <iconv/loop.c>
   167 @@ -812,7 +826,8 @@
   168        }									      \
   169      else								      \
   170        /* It's an one byte sequence.  */					      \
   171 -      *outptr++ = *((const uint32_t *) inptr)++;			      \
   172 +      *outptr++ = *((const uint32_t *) inptr);				      \
   173 +      inptr += sizeof (uint32_t);					      \
   174    }
   175  #define LOOP_NEED_FLAGS
   176  #include <iconv/loop.c>
   177 @@ -1031,7 +1046,8 @@
   178        }									      \
   179  									      \
   180      /* Now adjust the pointers and store the result.  */		      \
   181 -    *((uint32_t *) outptr)++ = ch;					      \
   182 +    *((uint32_t *) outptr) = ch;					      \
   183 +    outptr += sizeof (uint32_t);					      \
   184    }
   185  #define LOOP_NEED_FLAGS
   186  
   187 @@ -1174,7 +1190,8 @@
   188  	continue;							      \
   189        }									      \
   190  									      \
   191 -    *((uint32_t *) outptr)++ = u1;					      \
   192 +    *((uint32_t *) outptr) = u1;					      \
   193 +    outptr += sizeof (uint32_t);					      \
   194      inptr += 2;								      \
   195    }
   196  #define LOOP_NEED_FLAGS
   197 @@ -1224,7 +1241,8 @@
   198        }									      \
   199      else 								      \
   200        {									      \
   201 -	*((uint16_t *) outptr)++ = val;					      \
   202 +	*((uint16_t *) outptr) = val;					      \
   203 +        outptr += sizeof (uint16_t);					      \
   204  	inptr += 4;							      \
   205        }									      \
   206    }
   207 @@ -1265,7 +1283,8 @@
   208  	continue;							      \
   209        }									      \
   210  									      \
   211 -    *((uint32_t *) outptr)++ = u1;					      \
   212 +    *((uint32_t *) outptr) = u1;					      \
   213 +    outptr += sizeof (uint32_t);					      \
   214      inptr += 2;								      \
   215    }
   216  #define LOOP_NEED_FLAGS
   217 @@ -1314,7 +1333,8 @@
   218        }									      \
   219      else 								      \
   220        {									      \
   221 -	*((uint16_t *) outptr)++ = bswap_16 (val);			      \
   222 +	*((uint16_t *) outptr) = bswap_16 (val);			      \
   223 +	outptr += sizeof (uint16_t);					      \
   224  	inptr += 4;							      \
   225        }									      \
   226    }