static linking, libc multiple definitions

Sean Bruno sbruno at ignoranthack.me
Sun Apr 6 16:44:45 UTC 2014


On Sun, 2014-04-06 at 17:12 +0100, David Chisnall wrote:
> It looks like these two are defined in rpc_com.h, so they are declared and defined in multiple compilation units.  That's not actually wrong (they'll have common linkage and be merged), but it's discouraged because it can mask other errors.  Can you see if this patch fixes it for you?
> 
> David
> 
> 
> Index: rpc/rpc_com.h
> ===================================================================
> --- rpc/rpc_com.h       (revision 264068)
> +++ rpc/rpc_com.h       (working copy)
> @@ -86,8 +86,8 @@
>  bool_t __xdrrec_getrec(XDR *, enum xprt_stat *, bool_t);
>  void __xprt_unregister_unlocked(SVCXPRT *);
>  
> -SVCXPRT **__svc_xports;
> -int __svc_maxrec;
> +extern SVCXPRT **__svc_xports;
> +extern int __svc_maxrec;
>  
>  __END_DECLS
>  
> Index: rpc/svc.c
> ===================================================================
> --- rpc/svc.c   (revision 264068)
> +++ rpc/svc.c   (working copy)
> @@ -84,6 +84,9 @@
>         void                (*sc_dispatch)(struct svc_req *, SVCXPRT *);
>  } *svc_head;
>  
> +SVCXPRT **__svc_xports;
> +int __svc_maxrec;
> +
>  static struct svc_callout *svc_find(rpcprog_t, rpcvers_t,
>      struct svc_callout **, char *);
>  static void __xprt_do_unregister (SVCXPRT *xprt, bool_t dolock);
> 
> 


Yep, that make it much quieter now.  :-)  Thank you.

sean
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freebsd.org/pipermail/freebsd-current/attachments/20140406/cf379af3/attachment.sig>


More information about the freebsd-current mailing list