1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/patches/glibc/2.2.5/glibc-2.2.5-allow-gcc-4.0-sunrpc.patch Sat Jun 02 08:13:13 2007 +0000
1.3 @@ -0,0 +1,221 @@
1.4 +[Taken from ../glibc-2.3.2/glibc-2.3.2-allow-gcc-3.4-sunrpc.patch,
1.5 +rediffed, and with a fix for sunrpc/auth_none.c that was
1.6 +inexplicably not included in the original patch.]
1.7 +
1.8 +Fixes
1.9 +
1.10 +auth_none.c: In function 'authnone_create':
1.11 +auth_none.c:83: error: invalid lvalue in assignment
1.12 +clnt_perr.c: In function '_buf':
1.13 +clnt_perr.c:68: error: invalid lvalue in assignment
1.14 +clnt_raw.c: In function 'clntraw_create':
1.15 +clnt_raw.c:103: error: invalid lvalue in assignment
1.16 +clnt_simp.c: In function 'callrpc':
1.17 +clnt_simp.c:78: error: invalid lvalue in assignment
1.18 +etc.
1.19 +
1.20 +building glibc-2.2.5 with gcc-4.0.
1.21 +
1.22 +---
1.23 +
1.24 +http://sources.redhat.com/ml/libc-hacker/2004-02/msg00005.html
1.25 +[Also in CVS, but the original patch is easier to get.]
1.26 +
1.27 +Fixes errors like
1.28 +
1.29 +clnt_perr.c: In function `_buf':
1.30 +clnt_perr.c:67: error: invalid lvalue in assignment
1.31 +
1.32 +when building with gcc-3.5.
1.33 +
1.34 +To: libc-hacker at sources dot redhat dot com
1.35 +Subject: Fix cast as lvalue in sunrpc
1.36 +From: Andreas Schwab <schwab at suse dot de>
1.37 +X-Yow: SHHHH!! I hear SIX TATTOOED TRUCK-DRIVERS tossing ENGINE BLOCKS
1.38 + into empty OIL DRUMS dot dot
1.39 +Date: Sun, 08 Feb 2004 17:38:31 +0100
1.40 +Message-ID: <je4qu1frw8.fsf@sykes.suse.de>
1.41 +
1.42 +This fixes the uses of casts as lvalue in the sunrpc code.
1.43 +
1.44 +Andreas.
1.45 +
1.46 +2004-02-08 Andreas Schwab <schwab@suse.de>
1.47 +
1.48 + * include/rpc/rpc.h: Declare thread variables with their correct
1.49 + type.
1.50 + * sunrpc/clnt_perr.c: Don't cast thread variables.
1.51 + * sunrpc/clnt_raw.c: Likewise.
1.52 + * sunrpc/clnt_simp.c: Likewise.
1.53 + * sunrpc/key_call.c: Likewise.
1.54 + * sunrpc/svcauth_des.c: Likewise.
1.55 + * sunrpc/svc.c: Likewise.
1.56 + * sunrpc/svc_raw.c: Likewise.
1.57 + * sunrpc/svc_simple.c: Likewise.
1.58 +
1.59 +diff -ur glibc-2.2.5/include/rpc/rpc.h glibc-2.2.5-patched/include/rpc/rpc.h
1.60 +--- glibc-2.2.5/include/rpc/rpc.h 2001-03-25 21:11:32.000000000 -0800
1.61 ++++ glibc-2.2.5-patched/include/rpc/rpc.h 2005-03-11 13:18:29.810860624 -0800
1.62 +@@ -18,24 +18,24 @@
1.63 +
1.64 + void *authnone_private_s; /* auth_none.c */
1.65 +
1.66 +- void *clnt_perr_buf_s; /* clnt_perr.c */
1.67 ++ char *clnt_perr_buf_s; /* clnt_perr.c */
1.68 +
1.69 +- void *clntraw_private_s; /* clnt_raw.c */
1.70 ++ struct clntraw_private_s *clntraw_private_s; /* clnt_raw.c */
1.71 +
1.72 +- void *callrpc_private_s; /* clnt_simp.c */
1.73 ++ struct callrpc_private_s *callrpc_private_s; /* clnt_simp.c */
1.74 +
1.75 +- void *key_call_private_s; /* key_call.c */
1.76 ++ struct key_call_private *key_call_private_s; /* key_call.c */
1.77 +
1.78 +- void *authdes_cache_s; /* svcauth_des.c */
1.79 +- void *authdes_lru_s; /* svcauth_des.c */
1.80 ++ struct cache_entry *authdes_cache_s; /* svcauth_des.c */
1.81 ++ int *authdes_lru_s; /* svcauth_des.c */
1.82 +
1.83 +- void *svc_xports_s; /* svc.c */
1.84 +- void *svc_head_s; /* svc.c */
1.85 ++ SVCXPRT **svc_xports_s; /* svc.c */
1.86 ++ struct svc_callout *svc_head_s; /* svc.c */
1.87 +
1.88 +- void *svcraw_private_s; /* svc_raw.c */
1.89 ++ struct svcraw_private_s *svcraw_private_s; /* svc_raw.c */
1.90 +
1.91 +- void *svcsimple_proglst_s; /* svc_simple.c */
1.92 +- void *svcsimple_transp_s; /* svc_simple.c */
1.93 ++ struct proglst_ *svcsimple_proglst_s; /* svc_simple.c */
1.94 ++ SVCXPRT *svcsimple_transp_s; /* svc_simple.c */
1.95 + };
1.96 +
1.97 + extern struct rpc_thread_variables *__rpc_thread_variables(void)
1.98 +--- glibc-2.2.5/sunrpc/auth_none.c.old 2005-03-10 16:26:53.874178280 -0800
1.99 ++++ glibc-2.2.5/sunrpc/auth_none.c 2005-03-10 16:34:24.551664888 -0800
1.100 +@@ -62,7 +62,7 @@
1.101 + u_int mcnt;
1.102 + };
1.103 + #ifdef _RPC_THREAD_SAFE_
1.104 +-#define authnone_private ((struct authnone_private_s *)RPC_THREAD_VARIABLE(authnone_private_s))
1.105 ++#define authnone_private RPC_THREAD_VARIABLE(authnone_private_s)
1.106 + #else
1.107 + static struct authnone_private_s *authnone_private;
1.108 + #endif
1.109 +diff -ur glibc-2.2.5/sunrpc/clnt_perr.c glibc-2.2.5-patched/sunrpc/clnt_perr.c
1.110 +--- glibc-2.2.5/sunrpc/clnt_perr.c 2001-08-16 21:48:31.000000000 -0700
1.111 ++++ glibc-2.2.5-patched/sunrpc/clnt_perr.c 2005-03-11 13:18:29.812860320 -0800
1.112 +@@ -56,7 +56,7 @@
1.113 + * buf variable in a few functions. Overriding a global variable
1.114 + * with a local variable of the same name is a bad idea, anyway.
1.115 + */
1.116 +-#define buf ((char *)RPC_THREAD_VARIABLE(clnt_perr_buf_s))
1.117 ++#define buf RPC_THREAD_VARIABLE(clnt_perr_buf_s)
1.118 + #else
1.119 + static char *buf;
1.120 + #endif
1.121 +diff -ur glibc-2.2.5/sunrpc/clnt_raw.c glibc-2.2.5-patched/sunrpc/clnt_raw.c
1.122 +--- glibc-2.2.5/sunrpc/clnt_raw.c 2001-03-20 10:34:22.000000000 -0800
1.123 ++++ glibc-2.2.5-patched/sunrpc/clnt_raw.c 2005-03-11 13:18:29.813860168 -0800
1.124 +@@ -61,7 +61,7 @@
1.125 + u_int mcnt;
1.126 + };
1.127 + #ifdef _RPC_THREAD_SAFE_
1.128 +-#define clntraw_private ((struct clntraw_private_s *)RPC_THREAD_VARIABLE(clntraw_private_s))
1.129 ++#define clntraw_private RPC_THREAD_VARIABLE(clntraw_private_s)
1.130 + #else
1.131 + static struct clntraw_private_s *clntraw_private;
1.132 + #endif
1.133 +diff -ur glibc-2.2.5/sunrpc/clnt_simp.c glibc-2.2.5-patched/sunrpc/clnt_simp.c
1.134 +--- glibc-2.2.5/sunrpc/clnt_simp.c 2001-08-19 23:28:21.000000000 -0700
1.135 ++++ glibc-2.2.5-patched/sunrpc/clnt_simp.c 2005-03-11 13:18:29.814860016 -0800
1.136 +@@ -55,7 +55,7 @@
1.137 + char *oldhost;
1.138 + };
1.139 + #ifdef _RPC_THREAD_SAFE_
1.140 +-#define callrpc_private ((struct callrpc_private_s *)RPC_THREAD_VARIABLE(callrpc_private_s))
1.141 ++#define callrpc_private RPC_THREAD_VARIABLE(callrpc_private_s)
1.142 + #else
1.143 + static struct callrpc_private_s *callrpc_private;
1.144 + #endif
1.145 +diff -ur glibc-2.2.5/sunrpc/key_call.c glibc-2.2.5-patched/sunrpc/key_call.c
1.146 +--- glibc-2.2.5/sunrpc/key_call.c 2001-03-20 10:34:22.000000000 -0800
1.147 ++++ glibc-2.2.5-patched/sunrpc/key_call.c 2005-03-11 13:18:29.816859712 -0800
1.148 +@@ -360,7 +360,7 @@
1.149 + uid_t uid; /* user-id at last authorization */
1.150 + };
1.151 + #ifdef _RPC_THREAD_SAFE_
1.152 +-#define key_call_private_main ((struct key_call_private *)RPC_THREAD_VARIABLE(key_call_private_s))
1.153 ++#define key_call_private_main RPC_THREAD_VARIABLE(key_call_private_s)
1.154 + #else
1.155 + static struct key_call_private *key_call_private_main;
1.156 + #endif
1.157 +diff -ur glibc-2.2.5/sunrpc/svcauth_des.c glibc-2.2.5-patched/sunrpc/svcauth_des.c
1.158 +--- glibc-2.2.5/sunrpc/svcauth_des.c 2001-08-19 23:37:09.000000000 -0700
1.159 ++++ glibc-2.2.5-patched/sunrpc/svcauth_des.c 2005-03-11 13:18:29.821858952 -0800
1.160 +@@ -72,8 +72,8 @@
1.161 + char *localcred; /* generic local credential */
1.162 + };
1.163 + #ifdef _RPC_THREAD_SAFE_
1.164 +-#define authdes_cache ((struct cache_entry *)RPC_THREAD_VARIABLE(authdes_cache_s))
1.165 +-#define authdes_lru ((int *)RPC_THREAD_VARIABLE(authdes_lru_s))
1.166 ++#define authdes_cache RPC_THREAD_VARIABLE(authdes_cache_s)
1.167 ++#define authdes_lru RPC_THREAD_VARIABLE(authdes_lru_s)
1.168 + #else
1.169 + static struct cache_entry *authdes_cache;
1.170 + static int *authdes_lru;
1.171 +diff -ur glibc-2.2.5/sunrpc/svc.c glibc-2.2.5-patched/sunrpc/svc.c
1.172 +--- glibc-2.2.5/sunrpc/svc.c 2001-03-20 10:34:22.000000000 -0800
1.173 ++++ glibc-2.2.5-patched/sunrpc/svc.c 2005-03-11 13:18:29.817859560 -0800
1.174 +@@ -44,7 +44,7 @@
1.175 + #include <sys/poll.h>
1.176 +
1.177 + #ifdef _RPC_THREAD_SAFE_
1.178 +-#define xports ((SVCXPRT **)RPC_THREAD_VARIABLE(svc_xports_s))
1.179 ++#define xports RPC_THREAD_VARIABLE(svc_xports_s)
1.180 + #else
1.181 + static SVCXPRT **xports;
1.182 + #endif
1.183 +@@ -63,7 +63,7 @@
1.184 + void (*sc_dispatch) (struct svc_req *, SVCXPRT *);
1.185 + };
1.186 + #ifdef _RPC_THREAD_SAFE_
1.187 +-#define svc_head ((struct svc_callout *)RPC_THREAD_VARIABLE(svc_head_s))
1.188 ++#define svc_head RPC_THREAD_VARIABLE(svc_head_s)
1.189 + #else
1.190 + static struct svc_callout *svc_head;
1.191 + #endif
1.192 +diff -ur glibc-2.2.5/sunrpc/svc_raw.c glibc-2.2.5-patched/sunrpc/svc_raw.c
1.193 +--- glibc-2.2.5/sunrpc/svc_raw.c 2001-03-20 10:34:22.000000000 -0800
1.194 ++++ glibc-2.2.5-patched/sunrpc/svc_raw.c 2005-03-11 13:18:29.818859408 -0800
1.195 +@@ -54,7 +54,7 @@
1.196 + char verf_body[MAX_AUTH_BYTES];
1.197 + };
1.198 + #ifdef _RPC_THREAD_SAFE_
1.199 +-#define svcraw_private ((struct svcraw_private_s *)RPC_THREAD_VARIABLE(svcraw_private_s))
1.200 ++#define svcraw_private RPC_THREAD_VARIABLE(svcraw_private_s)
1.201 + #else
1.202 + static struct svcraw_private_s *svcraw_private;
1.203 + #endif
1.204 +diff -ur glibc-2.2.5/sunrpc/svc_simple.c glibc-2.2.5-patched/sunrpc/svc_simple.c
1.205 +--- glibc-2.2.5/sunrpc/svc_simple.c 2001-08-17 00:16:04.000000000 -0700
1.206 ++++ glibc-2.2.5-patched/sunrpc/svc_simple.c 2005-03-11 13:18:29.820859104 -0800
1.207 +@@ -62,7 +62,7 @@
1.208 + struct proglst_ *p_nxt;
1.209 + };
1.210 + #ifdef _RPC_THREAD_SAFE_
1.211 +-#define proglst ((struct proglst_ *)RPC_THREAD_VARIABLE(svcsimple_proglst_s))
1.212 ++#define proglst RPC_THREAD_VARIABLE(svcsimple_proglst_s)
1.213 + #else
1.214 + static struct proglst_ *proglst;
1.215 + #endif
1.216 +@@ -70,7 +70,7 @@
1.217 +
1.218 + static void universal (struct svc_req *rqstp, SVCXPRT *transp_s);
1.219 + #ifdef _RPC_THREAD_SAFE_
1.220 +-#define transp ((SVCXPRT *)RPC_THREAD_VARIABLE(svcsimple_transp_s))
1.221 ++#define transp RPC_THREAD_VARIABLE(svcsimple_transp_s)
1.222 + #else
1.223 + static SVCXPRT *transp;
1.224 + #endif