From tate@spa.is.uec.ac.jp Thu Apr 29 06:08:14 1999
Return-Path: <tate@spa.is.uec.ac.jp>
Received: from mailgate.spa.is.uec.ac.jp (ns.spa.is.uec.ac.jp [130.153.67.2])
	by hub.freebsd.org (Postfix) with ESMTP id 445F71586F
	for <freebsd-gnats-submit@freebsd.org>; Thu, 29 Apr 1999 06:08:11 -0700 (PDT)
	(envelope-from tate@spa.is.uec.ac.jp)
Received: from unzen.spa.is.uec.ac.jp (unzen.spa.is.uec.ac.jp [192.168.166.34])
	by mailgate.spa.is.uec.ac.jp (8.8.8+2.7Wbeta7/3.6W+spa-2.0a) with ESMTP id WAA11330
	for <freebsd-gnats-submit@freebsd.org>; Thu, 29 Apr 1999 22:08:10 +0900 (JST)
Received: by unzen.spa.is.uec.ac.jp (8.9.2/3.6W+spa-null-2.0b) id WAA02138; Thu, 29 Apr 1999 22:08:10 +0900 (JST)
Message-Id: <199904291308.WAA02138@unzen.spa.is.uec.ac.jp>
Date: Thu, 29 Apr 1999 22:08:10 +0900 (JST)
From: tate@spa.is.uec.ac.jp
Reply-To: tate@spa.is.uec.ac.jp
To: FreeBSD-gnats-submit@freebsd.org
Subject: generated code using rpcgen with -b option cannot be compiled
X-Send-Pr-Version: 3.2

>Number:         11382
>Category:       bin
>Synopsis:       generated code using rpcgen with -b option cannot be compiled
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Apr 29 06:10:00 PDT 1999
>Closed-Date:    Thu Jul 26 18:54:35 PDT 2001
>Last-Modified:  Thu Jul 26 22:00:05 PDT 2001
>Originator:     Takamichi Tateoka
>Release:        FreeBSD 3.1-RELEASE i386
>Organization:
University of Electro-Communications, Tokyo, JAPAN
>Environment:

	FreeBSD 3.1-RELEASE i386 and rpcgen which included in the release.
	However it happen in FreeBSD 2.2.8-RELEASE i386 and 
	seems not fixed yet even in current CVS repository.

>Description:

	Generated server side code using rpcgen with -b (Backward compatible)
	option can not be compiled.  The code includes <stropts.h> and
	<netconfig.h>, they are not exist on FreeBSD system.

	This option is not useful in FreeBSD since current rpcgen on FreeBSD
	is not support TI-RPC features and this option is turned on by default.
	However, to compile old programs for ONC RPC, we should compile them
	with -b option (existence of this option will be detected automatically
	by configure script) for portability.
	On current FreeBSD, configure script estimates -b options is available
	and generates a Makefile to use rpcgen with -b option, then
	the compilation will be failed.

>How-To-Repeat:

	Here is a simple sample rpc source (sample.c):

program SAMPLEPROG {
  version SAMPLEVERS {
    void sample_proc(void) = 0;
  } = 1;
} = 10000;

	Compile it using rpcgen with -b option:
% rpcgen -b sample.x
	Then, compile generated server side code:
% cc -c sample_svc.c
	It makes an error:
sample_svc.c:12: stropts.h: No such file or directory
sample_svc.c:13: netconfig.h: No such file or directory

>Fix:
	
	It is came from turning tirpcflag on when -b options is specified.
	As described in man page, current rpcgen on FreeBSD can not handle
	TI-RPC features and this options should simply be ignored.
	The patch should be following:

*** usr.bin/rpcgen/rpc_main.c.orig	Fri Sep 25 20:43:48 1998
--- usr.bin/rpcgen/rpc_main.c	Thu Apr 29 21:46:26 1999
***************
*** 1175,1185 ****
  					 *  generating backward compatible
  					 *  code
  					 */
- #if defined(__FreeBSD__) || defined(__NetBSD__)
- 					tirpcflag = 1;
- #else
  					tirpcflag = 0;
- #endif
  					break;
  
  				case 'I':
--- 1175,1181 ----

>Release-Note:
>Audit-Trail:

From: TATEOKA Takamichi <tate@spa.is.uec.ac.jp>
To: freebsd-gnats-submit@freebsd.org
Cc:  
Subject: Re: bin/11382: generated code using rpcgen with -b option cannot be compiled
Date: Sat, 01 May 1999 15:01:39 +0900

  I made a small mistake, file name of the sample rpc source is not
 "sample.c".  "sample.x" is correct name.
 --
 tate
 
State-Changed-From-To: open->feedback 
State-Changed-By: mike 
State-Changed-When: Fri Jul 20 08:49:31 PDT 2001 
State-Changed-Why:  

Does this problem still occur in newer versions of FreeBSD, 
such as 4.3-RELEASE? 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=11382 

From: Mike Barcroft <mike@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: bin/11382: generated code using rpcgen with -b option cannot be compiled
Date: Wed, 25 Jul 2001 23:37:50 -0400

 Adding to Audit-Trail.
 
 ----- Forwarded message from TATEOKA Takamichi <tate@spa.is.uec.ac.jp> -----
 
 X-UIDL: c599eeb07f965b01b005d988b870ac9f
 Delivered-To: mike@freebsd.org
 To: mike@FreeBSD.org
 Cc: tate@spa.is.uec.ac.jp, freebsd-bugs@FreeBSD.org
 Subject: Re: bin/11382: generated code using rpcgen with -b option cannot
  be compiled
 From: TATEOKA Takamichi <tate@spa.is.uec.ac.jp>
 In-Reply-To: <200107201549.f6KFnvb30528@freefall.freebsd.org>
 X-Mailer: Mew version 1.94.2 on Emacs 20.6 / Mule 4.0 (HANANOEN)
 X-Pgp-Fingerprint: 2D DA AE 35 9C BF 4F F6  BE C4 F5 73 19 3B 0F 64
 Date: Tue, 24 Jul 2001 14:31:53 +0900
 X-Dispatcher: imput version 20000228(IM140)
 
 > Does this problem still occur in newer versions of FreeBSD,
 > such as 4.3-RELEASE?
 
   Yes.  I can re-produce the problem on FreeBSD-4.3-RELEASE.
   I think -b option should be ignored. Because backword compatible mode
 is turned on by default on FreeBSD, and TI-RPC mode is not supported.
 
 
 gilbert:tate[51]% uname -a
 FreeBSD gilbert.cs.uec.ac.jp 4.3-RELEASE FreeBSD 4.3-RELEASE #0: Fri May 11 08:44:52 JST 2001     root@:/usr/src/sys/compile/GILBERT  i386
 gilbert:tate[52]% ls
 gilbert:tate[53]% cat >sample.x
     program SAMPLEPROG {
       version SAMPLEVERS {
         void sample_proc(void) = 0;
       } = 1;
     } = 10000;
 gilbert:tate[54]% rpcgen -b sample.x
 gilbert:tate[55]% ls
 sample.h       sample.x       sample_clnt.c  sample_svc.c   
 gilbert:tate[56]% cc -c sample_svc.c
 sample_svc.c:12: stropts.h: No such file or directory
 sample_svc.c:13: netconfig.h: No such file or directory
 gilbert:tate[57]% 
 
 ----- End forwarded message -----
State-Changed-From-To: feedback->closed 
State-Changed-By: mike 
State-Changed-When: Thu Jul 26 18:54:35 PDT 2001 
State-Changed-Why:  

After doing a little more research, I have determined that this is the 
expected behaviour.  We aren't forward compatible with TI-RPC, so we 
make the default -b.  If however we see -b, we revert to TI-RPC in case 
someone needs that.  It's not perfect, but it makes the most sense. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=11382 

From: Mike Barcroft <mike@FreeBSD.org>
To: TATEOKA Takamichi <tate@spa.is.uec.ac.jp>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: bin/11382: generated code using rpcgen with -b option cannot be compiled
Date: Fri, 27 Jul 2001 00:32:28 -0400

 On Fri, Jul 27, 2001 at 12:37:45PM +0900, TATEOKA Takamichi wrote:
 > > After doing a little more research, I have determined that this is the
 > > expected behaviour.  We aren't forward compatible with TI-RPC, so we
 > > make the default -b.  If however we see -b, we revert to TI-RPC in case
 > > someone needs that.  It's not perfect, but it makes the most sense.
 > 
 >   I think it's not a good idea.  It makes -b option means reverse
 > effects compared to most of other operating systems.  It can confuse
 > any scripts (and users) working on multiple systems.
 > 
 >   I think make a NEW option to generate TI-RPC code and revert to -b
 > option for backword compatible (non TI-RPC mode) is better than
 > current behavior.  I think "-5" is reasonable, since it is compatible
 > with rpcgen shipped with Linux systems (at least Vine Linux 2.0 which
 > is RedHat base and has glibc-2.1.2).
 >   You can find a manual page of rpcgen for linux on:
 >    http://www.linuxcentral.com/linux/man-pages/rpcgen.1.html
 > 
 >   I think it has no side effects since any software for FreeBSD must
 > not use -b option.
 > 
 >   According to my check, rpcgen for OpenBSD-2.9 is disabled TI-RPC
 > mode completely (-b option is exist for "backword compatible"
 > meaning).  Rpcgen for NetBSD-1.5.1 generates TI-RPC code by default,
 > and seems to work.
 
 It appears -CURRENT is using NetBSD's solution, so 5.0-RELEASE and up
 will support this.  I don't think there are any plans to make these
 changes to the code in -STABLE, so you'll have to wait until then.
 
 Best regards,
 Mike Barcroft

From: TATEOKA Takamichi <tate@spa.is.uec.ac.jp>
To: mike@FreeBSD.org
Cc: tate@spa.is.uec.ac.jp, freebsd-gnats-submit@FreeBSD.org
Subject: Re: bin/11382: generated code using rpcgen with -b option cannot
 be compiled
Date: Fri, 27 Jul 2001 13:56:32 +0900

 > It appears -CURRENT is using NetBSD's solution, so 5.0-RELEASE and up
 > will support this.  I don't think there are any plans to make these
 > changes to the code in -STABLE, so you'll have to wait until then.
 
   OK, I accept it.
 
 Thanks,
 Takamchi, TATEOKA
>Unformatted:
