This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Fix sunrpc static library
On 05/18/2012 12:12 AM, Roland McGrath wrote:
> I think you should instead add a macro like libc_sunrpc_symbol
> that is either strong_alias or compat_symbol depending.
Like this? Tested with and without obsolete rpc on Linux/x86-64 and x86,
Andreas
2012-05-18 Andreas Jaeger <aj@suse.de>
* include/libc-symbols.h (libc_sunrpc_symbol): Define.
* sunrpc/svc_simple.c: Support export of registerrpc for static
library.
* sunrpc/xcrypt.c: Support export of passwd2des for static
library.
diff --git a/include/libc-symbols.h b/include/libc-symbols.h
index 12b3639..cd0185d 100644
--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -746,6 +746,17 @@ for linking")
# define libutil_hidden_data_ver(local, name)
#endif
+#ifdef LINK_OBSOLETE_RPC
+/* Export symbol also for linking with static library. */
+# define libc_sunrpc_symbol(name, aliasname, version) \
+ strong_alias (name, aliasname)
+#else
+/* Export symbol only in shared libc. */
+# define libc_sunrpc_symbol(name, aliasname, version) \
+ compat_symbol (libc, name, aliasname, version);
+#endif
+
+
/* Get some dirty hacks. */
#include <symbol-hacks.h>
diff --git a/sunrpc/svc_simple.c b/sunrpc/svc_simple.c
index b8ba4ab..bf74601 100644
--- a/sunrpc/svc_simple.c
+++ b/sunrpc/svc_simple.c
@@ -121,7 +121,9 @@ __registerrpc (u_long prognum, u_long versnum, u_long procnum,
free (buf);
return -1;
}
-compat_symbol (libc, __registerrpc, registerrpc, GLIBC_2_0);
+
+libc_sunrpc_symbol (__registerrpc, registerrpc, GLIBC_2_0)
+
static void
universal (struct svc_req *rqstp, SVCXPRT *transp_l)
diff --git a/sunrpc/xcrypt.c b/sunrpc/xcrypt.c
index 2e53f2d..9f64404 100644
--- a/sunrpc/xcrypt.c
+++ b/sunrpc/xcrypt.c
@@ -89,7 +89,7 @@ passwd2des_internal (char *pw, char *key)
#ifdef _LIBC
libc_hidden_def (passwd2des_internal)
-compat_symbol (libc, passwd2des_internal, passwd2des, GLIBC_2_1);
+libc_sunrpc_symbol(passwd2des_internal, passwd2des, GLIBC_2_1)
#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