[PATCH] Fix sunrpc static library
Andreas Jaeger
aj@suse.de
Thu May 17 19:36:00 GMT 2012
Compiling with sunrpc enabled, I got these warnings for the .o files:
svc_simple.c:124:1: warning: data definition has no type or storage class [enabled by default]
svc_simple.c:124:1: warning: type defaults to ‘int’ in declaration of ‘compat_symbol’ [enabled by default]
svc_simple.c:124:1: warning: parameter names (without types) in function declaration [enabled by default]
xcrypt.c:92:1: warning: data definition has no type or storage class [enabled by default]
xcrypt.c:92:1: warning: type defaults to ‘int’ in declaration of ‘compat_symbol’ [enabled by default]
xcrypt.c:92:1: warning: parameter names (without types) in function declaration [enabled by default]
the problem is the usage of compat_symbol.
Fixed with the appended patch - tested on Linux/i686 with sunrpc enabled
and on Linux/x86-64 with sunrpc disabled. It passed check-abi on both
systems.
nm of the .o files shows that we now export registerrpc and passwd2des
which we didn't do before.
Ok to commit?
Andreas
2012-05-17 Andreas Jaeger <aj@suse.de>
* sunrpc/svc_simple.c [LINK_OBSOLETE_RPC]: Create strong_alias for
registerrpc to export it for static library.
* sunrpc/xcrypt.c [LINK_OBSOLETE_RPC]: Create strong_alias for
passwd2des to export it for static library.
diff --git a/sunrpc/svc_simple.c b/sunrpc/svc_simple.c
index b8ba4ab..e69fb80 100644
--- a/sunrpc/svc_simple.c
+++ b/sunrpc/svc_simple.c
@@ -121,7 +121,11 @@ __registerrpc (u_long prognum, u_long versnum, u_long procnum,
free (buf);
return -1;
}
+#ifdef LINK_OBSOLETE_RPC
+strong_alias (__registerrpc, registerrpc)
+#else
compat_symbol (libc, __registerrpc, registerrpc, GLIBC_2_0);
+#endif
static void
universal (struct svc_req *rqstp, SVCXPRT *transp_l)
diff --git a/sunrpc/xcrypt.c b/sunrpc/xcrypt.c
index 2e53f2d..4ead446 100644
--- a/sunrpc/xcrypt.c
+++ b/sunrpc/xcrypt.c
@@ -89,7 +89,11 @@ passwd2des_internal (char *pw, char *key)
#ifdef _LIBC
libc_hidden_def (passwd2des_internal)
+# ifdef LINK_OBSOLETE_RPC
+strong_alias (passwd2des_internal, passwd2des)
+# else
compat_symbol (libc, passwd2des_internal, passwd2des, GLIBC_2_1);
+# endif
#else
void passwd2des (char *pw, char *key)
{
--
Andreas Jaeger aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn,Jennifer Guild,Felix Imendörffer,HRB16746 (AG Nürnberg)
GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126
More information about the Libc-alpha
mailing list