patches/glibc/2.2.5/glibc-2.2.5-allow-gcc-4.0-sunrpc.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 [Taken from ../glibc-2.3.2/glibc-2.3.2-allow-gcc-3.4-sunrpc.patch,
     2 rediffed, and with a fix for sunrpc/auth_none.c that was
     3 inexplicably not included in the original patch.]
     4 
     5 Fixes 
     6 
     7 auth_none.c: In function 'authnone_create':
     8 auth_none.c:83: error: invalid lvalue in assignment
     9 clnt_perr.c: In function '_buf':
    10 clnt_perr.c:68: error: invalid lvalue in assignment 
    11 clnt_raw.c: In function 'clntraw_create':
    12 clnt_raw.c:103: error: invalid lvalue in assignment
    13 clnt_simp.c: In function 'callrpc':
    14 clnt_simp.c:78: error: invalid lvalue in assignment
    15 etc.
    16 
    17 building glibc-2.2.5 with gcc-4.0.
    18 
    19 ---
    20 
    21 http://sources.redhat.com/ml/libc-hacker/2004-02/msg00005.html
    22 [Also in CVS, but the original patch is easier to get.]
    23 
    24 Fixes errors like
    25 
    26 clnt_perr.c: In function `_buf':
    27 clnt_perr.c:67: error: invalid lvalue in assignment
    28 
    29 when building with gcc-3.5.
    30 
    31 To: libc-hacker at sources dot redhat dot com
    32 Subject: Fix cast as lvalue in sunrpc
    33 From: Andreas Schwab <schwab at suse dot de>
    34 X-Yow: SHHHH!!  I hear SIX TATTOOED TRUCK-DRIVERS tossing ENGINE BLOCKS
    35  into empty OIL DRUMS dot  dot 
    36 Date: Sun, 08 Feb 2004 17:38:31 +0100
    37 Message-ID: <je4qu1frw8.fsf@sykes.suse.de>
    38 
    39 This fixes the uses of casts as lvalue in the sunrpc code.
    40 
    41 Andreas.
    42 
    43 2004-02-08  Andreas Schwab  <schwab@suse.de>
    44 
    45 	* include/rpc/rpc.h: Declare thread variables with their correct
    46 	type.
    47 	* sunrpc/clnt_perr.c: Don't cast thread variables.
    48 	* sunrpc/clnt_raw.c: Likewise.
    49 	* sunrpc/clnt_simp.c: Likewise.
    50 	* sunrpc/key_call.c: Likewise.
    51 	* sunrpc/svcauth_des.c: Likewise.
    52 	* sunrpc/svc.c: Likewise.
    53 	* sunrpc/svc_raw.c: Likewise.
    54 	* sunrpc/svc_simple.c: Likewise.
    55 
    56 diff -ur glibc-2.2.5/include/rpc/rpc.h glibc-2.2.5-patched/include/rpc/rpc.h
    57 --- glibc-2.2.5/include/rpc/rpc.h	2001-03-25 21:11:32.000000000 -0800
    58 +++ glibc-2.2.5-patched/include/rpc/rpc.h	2005-03-11 13:18:29.810860624 -0800
    59 @@ -18,24 +18,24 @@
    60  
    61  	void		*authnone_private_s;	/* auth_none.c */
    62  
    63 -	void		*clnt_perr_buf_s;	/* clnt_perr.c */
    64 +	char		*clnt_perr_buf_s;	/* clnt_perr.c */
    65  
    66 -	void		*clntraw_private_s;	/* clnt_raw.c */
    67 +	struct clntraw_private_s *clntraw_private_s;	/* clnt_raw.c */
    68  
    69 -	void		*callrpc_private_s;	/* clnt_simp.c */
    70 +	struct callrpc_private_s *callrpc_private_s;	/* clnt_simp.c */
    71  
    72 -	void		*key_call_private_s;	/* key_call.c */
    73 +	struct key_call_private *key_call_private_s;	/* key_call.c */
    74  
    75 -	void		*authdes_cache_s;	/* svcauth_des.c */
    76 -	void		*authdes_lru_s;		/* svcauth_des.c */
    77 +	struct cache_entry *authdes_cache_s;	/* svcauth_des.c */
    78 +	int		*authdes_lru_s;		/* svcauth_des.c */
    79  
    80 -	void		*svc_xports_s;		/* svc.c */
    81 -	void		*svc_head_s;		/* svc.c */
    82 +	SVCXPRT		**svc_xports_s;		/* svc.c */
    83 +	struct svc_callout *svc_head_s;		/* svc.c */
    84  
    85 -	void		*svcraw_private_s;	/* svc_raw.c */
    86 +	struct svcraw_private_s *svcraw_private_s;	/* svc_raw.c */
    87  
    88 -	void		*svcsimple_proglst_s;	/* svc_simple.c */
    89 -	void		*svcsimple_transp_s;	/* svc_simple.c */
    90 +	struct proglst_ *svcsimple_proglst_s;	/* svc_simple.c */
    91 +	SVCXPRT		*svcsimple_transp_s;	/* svc_simple.c */
    92  };
    93  
    94  extern struct rpc_thread_variables *__rpc_thread_variables(void)
    95 --- glibc-2.2.5/sunrpc/auth_none.c.old	2005-03-10 16:26:53.874178280 -0800
    96 +++ glibc-2.2.5/sunrpc/auth_none.c	2005-03-10 16:34:24.551664888 -0800
    97 @@ -62,7 +62,7 @@
    98    u_int mcnt;
    99  };
   100  #ifdef _RPC_THREAD_SAFE_
   101 -#define authnone_private ((struct authnone_private_s *)RPC_THREAD_VARIABLE(authnone_private_s))
   102 +#define authnone_private RPC_THREAD_VARIABLE(authnone_private_s)
   103  #else
   104  static struct authnone_private_s *authnone_private;
   105  #endif
   106 diff -ur glibc-2.2.5/sunrpc/clnt_perr.c glibc-2.2.5-patched/sunrpc/clnt_perr.c
   107 --- glibc-2.2.5/sunrpc/clnt_perr.c	2001-08-16 21:48:31.000000000 -0700
   108 +++ glibc-2.2.5-patched/sunrpc/clnt_perr.c	2005-03-11 13:18:29.812860320 -0800
   109 @@ -56,7 +56,7 @@
   110   * buf variable in a few functions.  Overriding a global variable
   111   * with a local variable of the same name is a bad idea, anyway.
   112   */
   113 -#define buf ((char *)RPC_THREAD_VARIABLE(clnt_perr_buf_s))
   114 +#define buf RPC_THREAD_VARIABLE(clnt_perr_buf_s)
   115  #else
   116  static char *buf;
   117  #endif
   118 diff -ur glibc-2.2.5/sunrpc/clnt_raw.c glibc-2.2.5-patched/sunrpc/clnt_raw.c
   119 --- glibc-2.2.5/sunrpc/clnt_raw.c	2001-03-20 10:34:22.000000000 -0800
   120 +++ glibc-2.2.5-patched/sunrpc/clnt_raw.c	2005-03-11 13:18:29.813860168 -0800
   121 @@ -61,7 +61,7 @@
   122      u_int mcnt;
   123    };
   124  #ifdef _RPC_THREAD_SAFE_
   125 -#define clntraw_private ((struct clntraw_private_s *)RPC_THREAD_VARIABLE(clntraw_private_s))
   126 +#define clntraw_private RPC_THREAD_VARIABLE(clntraw_private_s)
   127  #else
   128  static struct clntraw_private_s *clntraw_private;
   129  #endif
   130 diff -ur glibc-2.2.5/sunrpc/clnt_simp.c glibc-2.2.5-patched/sunrpc/clnt_simp.c
   131 --- glibc-2.2.5/sunrpc/clnt_simp.c	2001-08-19 23:28:21.000000000 -0700
   132 +++ glibc-2.2.5-patched/sunrpc/clnt_simp.c	2005-03-11 13:18:29.814860016 -0800
   133 @@ -55,7 +55,7 @@
   134      char *oldhost;
   135    };
   136  #ifdef _RPC_THREAD_SAFE_
   137 -#define callrpc_private ((struct callrpc_private_s *)RPC_THREAD_VARIABLE(callrpc_private_s))
   138 +#define callrpc_private RPC_THREAD_VARIABLE(callrpc_private_s)
   139  #else
   140  static struct callrpc_private_s *callrpc_private;
   141  #endif
   142 diff -ur glibc-2.2.5/sunrpc/key_call.c glibc-2.2.5-patched/sunrpc/key_call.c
   143 --- glibc-2.2.5/sunrpc/key_call.c	2001-03-20 10:34:22.000000000 -0800
   144 +++ glibc-2.2.5-patched/sunrpc/key_call.c	2005-03-11 13:18:29.816859712 -0800
   145 @@ -360,7 +360,7 @@
   146    uid_t   uid;            /* user-id at last authorization */
   147  };
   148  #ifdef _RPC_THREAD_SAFE_
   149 -#define key_call_private_main ((struct  key_call_private *)RPC_THREAD_VARIABLE(key_call_private_s))
   150 +#define key_call_private_main RPC_THREAD_VARIABLE(key_call_private_s)
   151  #else
   152  static struct key_call_private *key_call_private_main;
   153  #endif
   154 diff -ur glibc-2.2.5/sunrpc/svcauth_des.c glibc-2.2.5-patched/sunrpc/svcauth_des.c
   155 --- glibc-2.2.5/sunrpc/svcauth_des.c	2001-08-19 23:37:09.000000000 -0700
   156 +++ glibc-2.2.5-patched/sunrpc/svcauth_des.c	2005-03-11 13:18:29.821858952 -0800
   157 @@ -72,8 +72,8 @@
   158      char *localcred;		/* generic local credential */
   159    };
   160  #ifdef _RPC_THREAD_SAFE_
   161 -#define authdes_cache ((struct cache_entry *)RPC_THREAD_VARIABLE(authdes_cache_s))
   162 -#define authdes_lru ((int *)RPC_THREAD_VARIABLE(authdes_lru_s))
   163 +#define authdes_cache RPC_THREAD_VARIABLE(authdes_cache_s)
   164 +#define authdes_lru RPC_THREAD_VARIABLE(authdes_lru_s)
   165  #else
   166  static struct cache_entry *authdes_cache;
   167  static int *authdes_lru;
   168 diff -ur glibc-2.2.5/sunrpc/svc.c glibc-2.2.5-patched/sunrpc/svc.c
   169 --- glibc-2.2.5/sunrpc/svc.c	2001-03-20 10:34:22.000000000 -0800
   170 +++ glibc-2.2.5-patched/sunrpc/svc.c	2005-03-11 13:18:29.817859560 -0800
   171 @@ -44,7 +44,7 @@
   172  #include <sys/poll.h>
   173  
   174  #ifdef _RPC_THREAD_SAFE_
   175 -#define xports ((SVCXPRT **)RPC_THREAD_VARIABLE(svc_xports_s))
   176 +#define xports RPC_THREAD_VARIABLE(svc_xports_s)
   177  #else
   178  static SVCXPRT **xports;
   179  #endif
   180 @@ -63,7 +63,7 @@
   181    void (*sc_dispatch) (struct svc_req *, SVCXPRT *);
   182  };
   183  #ifdef _RPC_THREAD_SAFE_
   184 -#define svc_head ((struct svc_callout *)RPC_THREAD_VARIABLE(svc_head_s))
   185 +#define svc_head RPC_THREAD_VARIABLE(svc_head_s)
   186  #else
   187  static struct svc_callout *svc_head;
   188  #endif
   189 diff -ur glibc-2.2.5/sunrpc/svc_raw.c glibc-2.2.5-patched/sunrpc/svc_raw.c
   190 --- glibc-2.2.5/sunrpc/svc_raw.c	2001-03-20 10:34:22.000000000 -0800
   191 +++ glibc-2.2.5-patched/sunrpc/svc_raw.c	2005-03-11 13:18:29.818859408 -0800
   192 @@ -54,7 +54,7 @@
   193      char verf_body[MAX_AUTH_BYTES];
   194    };
   195  #ifdef _RPC_THREAD_SAFE_
   196 -#define svcraw_private ((struct svcraw_private_s *)RPC_THREAD_VARIABLE(svcraw_private_s))
   197 +#define svcraw_private RPC_THREAD_VARIABLE(svcraw_private_s)
   198  #else
   199  static struct svcraw_private_s *svcraw_private;
   200  #endif
   201 diff -ur glibc-2.2.5/sunrpc/svc_simple.c glibc-2.2.5-patched/sunrpc/svc_simple.c
   202 --- glibc-2.2.5/sunrpc/svc_simple.c	2001-08-17 00:16:04.000000000 -0700
   203 +++ glibc-2.2.5-patched/sunrpc/svc_simple.c	2005-03-11 13:18:29.820859104 -0800
   204 @@ -62,7 +62,7 @@
   205      struct proglst_ *p_nxt;
   206    };
   207  #ifdef _RPC_THREAD_SAFE_
   208 -#define proglst ((struct proglst_ *)RPC_THREAD_VARIABLE(svcsimple_proglst_s))
   209 +#define proglst RPC_THREAD_VARIABLE(svcsimple_proglst_s)
   210  #else
   211  static struct proglst_ *proglst;
   212  #endif
   213 @@ -70,7 +70,7 @@
   214  
   215  static void universal (struct svc_req *rqstp, SVCXPRT *transp_s);
   216  #ifdef _RPC_THREAD_SAFE_
   217 -#define transp ((SVCXPRT *)RPC_THREAD_VARIABLE(svcsimple_transp_s))
   218 +#define transp RPC_THREAD_VARIABLE(svcsimple_transp_s)
   219  #else
   220  static SVCXPRT *transp;
   221  #endif