This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Resend: support for -M in recent GLIBC
- To: libc-alpha Mailinglist <libc-alpha at sourceware dot cygnus dot com>, Thorsten Kukuk <kukuk at suse dot de>, Andreas Jaeger <aj at suse dot de>
- Subject: Resend: support for -M in recent GLIBC
- From: Derek Atkins <warlord at MIT dot EDU>
- Date: 20 Mar 2001 10:25:38 -0500
Let's try this again...
-derek
----- Original message follows -----
Return-Path: <warlord@MIT.EDU>
Received: (from warlord@localhost) by rcn.ihtfp.org (8.9.3)
id RAA15860; Mon, 19 Mar 2001 17:53:01 -0500
To: Horst von Brand <vonbrand@sleipnir.valparaiso.cl>
Cc: Andreas Jaeger <aj.suse.de@MIT.EDU>,
Thorsten Kukuk <kukuk.suse.de@MIT.EDU>,
libc-alpha Mailinglist <libc-alpha.sourceware.cygnus.com@MIT.EDU>,
Svein Olav Bjerkeset <svein.olav.bjerkeset@oslo.online.no>,
bugs@redhat.com
References: <200005160117.e4G1HdK13323@sleipnir.valparaiso.cl>
Subject: support for -M in recent GLIBC
From: Derek Atkins <warlord@MIT.EDU>
Date: 19 Mar 2001 17:52:56 -0500
Message-ID: <sjm3dc91id3.fsf@rcn.ihtfp.org>
Lines: 67
X-Mailer: Gnus v5.5/Emacs 20.3
> It does already if you don't use -N:
> $ rpcgen pr1731myprc.x
> bool MYRPCPROC (string, int) = 1;
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> pr1731myprc.x, line 4: only one argument is allowed
>
> Thorsten, Sven and myself discussed to disable -N and -M since those
> flags are not supported at all with glibc.
>
> Is the appended patch ok?
Unfortunately no, this patch is NOT ok. Indeed, GLIBC _DOES_ support
the MT-Safe code. The difference is most clear when you generate
the client stubs. Without -M you get a stub that looks like:
return_type *function_1 (argument_type *, CLIENT *)
{
static return_type ret;
clnt_call (...);
return &ret;
}
With the -M flag, you get a client stub that looks like:
enum function_1 (arg_type *arg, ret_type *ret, CLIENT *cl)
{
return (clnt_call (...));
}
Obviously this is a much better approach for most programming!!! A
better patch than the one below would be to ignore newstyle without
ignoring mtflag. Otherwise this DOES break a lot of code, now that -M
doesn't work anymore.
-derek
> Andreas
>
> 2000-05-18 Andreas Jaeger <aj@suse.de>
>
> * sunrpc/rpc_main.c (parseargs): Don't accept -M and -N.
> Closes PR libc/1731.
>
> ============================================================
> Index: sunrpc/rpc_main.c
> --- sunrpc/rpc_main.c 2000/02/20 17:51:34 1.17
> +++ sunrpc/rpc_main.c 2000/05/18 08:18:47
> @@ -1362,6 +1362,13 @@
> cmd->Scflag = flag['C'];
> cmd->makefileflag = flag['M'];
>
> + if (mtflag || newstyle)
> + {
> + /* glibc doesn't support these flags. */
> + f_print (stderr,
> + _("This implementation doesn't support newstyle or MT-safe code!\n"));
> + return (0);
> + }
> if (tirpcflag)
> {
> pmflag = inetdflag ? 0 : 1; /* pmflag or inetdflag is always TRU
--
Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
Member, MIT Student Information Processing Board (SIPB)
URL: http://web.mit.edu/warlord/ PP-ASEL-IA N1NWH
warlord@MIT.EDU PGP key available
------- End of forwarded message -------