From owner-cvs-all Sat Nov 2 11:18:21 2002 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E1E2F37B401; Sat, 2 Nov 2002 11:18:17 -0800 (PST) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.208.78.105]) by mx1.FreeBSD.org (Postfix) with ESMTP id 75F9643E42; Sat, 2 Nov 2002 11:18:17 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) by troutmask.apl.washington.edu (8.12.6/8.12.5) with ESMTP id gA2JIHeZ029243; Sat, 2 Nov 2002 11:18:17 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.12.6/8.12.6/Submit) id gA2JIHGW029242; Sat, 2 Nov 2002 11:18:17 -0800 (PST) Date: Sat, 2 Nov 2002 11:18:17 -0800 From: Steve Kargl To: Alfred Perlstein Cc: cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG Subject: Re: cvs commit: src/lib/libc/stdio findfp.c Message-ID: <20021102191817.GB28971@troutmask.apl.washington.edu> References: <200210310154.g9V1sRiC017013@repoman.freebsd.org> <20021031015818.GU24139@elvis.mu.org> <20021102180404.GA28779@troutmask.apl.washington.edu> <20021102183444.GM24139@elvis.mu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20021102183444.GM24139@elvis.mu.org> User-Agent: Mutt/1.4i Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sat, Nov 02, 2002 at 10:34:44AM -0800, Alfred Perlstein wrote: > * Steve Kargl [021102 10:04] wrote: >> On Wed, Oct 30, 2002 at 05:58:18PM -0800, Alfred Perlstein wrote: >>> * Alfred Perlstein [021030 17:55] wrote: >>>> alfred 2002/10/30 17:54:27 PST >>>> >>>> Modified files: >>>> lib/libc/stdio findfp.c >>>> Log: >>>> Make __sF static. This can not be allowed to exist in 5.x. >>> >>> My suggestion is to use: >>> portupgrade -aF >>> after an installworld and things will be fine. >>> >>> If this is truly too upsetting for some then I recommend that you >>> submit a patch to add a make.conf knob for your special case. I've done this. See below for the diff. I've defined a COMPAT4_STDIO variable that can be added to CFLAGS depending on the WANT_COMPAT4_STDIO make.conf knob. >> >> This breaks commercial third party software, which >> cannot be easily updated by portupgrade -aF. >> >> kargl[206] f95 -o a a.f90 >> /usr/local/lib/NAGWare/libf96.so: undefined reference to `__sF' >> collect2: ld returned 1 exit status >> > > The simplest fix is to simply locally revert my change until > this vendor supplies a binary for 5.x. Either that or compile > your code on a 4.x system or in such a way that it links against > libc.so.4. > NAG's last release was for FreeBSD 4.2. It may be awhile before a 5.x binary is released. -- Steve --- lib/libc/stdio/findfp.c.orig Sat Nov 2 10:14:36 2002 +++ lib/libc/stdio/findfp.c Sat Nov 2 10:44:10 2002 @@ -69,11 +69,15 @@ static struct __sFILEX __sFX[3]; -static FILE __sF[3] = { +#ifndef COMPAT4_STDIO +static +#endif +FILE __sF[3] = { std(__SRD, STDIN_FILENO), std(__SWR, STDOUT_FILENO), std(__SWR|__SNBF, STDERR_FILENO) }; + /* * The following kludge is done to ensure enough binary compatibility --- lib/libc/stdio/Makefile.inc.orig Sat Nov 2 10:28:14 2002 +++ lib/libc/stdio/Makefile.inc Sat Nov 2 10:34:23 2002 @@ -4,6 +4,10 @@ # stdio sources .PATH: ${.CURDIR}/../libc/stdio +.if WANT_COMPAT4_STDIO +CFLAGS+=-DCOMPAT4_STDIO +.endif + SRCS+= _flock_stub.c asprintf.c clrerr.c fclose.c fdopen.c feof.c ferror.c \ fflush.c fgetc.c fgetln.c fgetpos.c fgets.c fgetwc.c fgetws.c \ fileno.c findfp.c flags.c fopen.c fprintf.c fpurge.c fputc.c fputs.c \ --- share/examples/etc/make.conf.orig Sat Nov 2 10:48:43 2002 +++ share/examples/etc/make.conf Sat Nov 2 10:55:36 2002 @@ -171,6 +171,14 @@ #COMPAT3X= yes #COMPAT4X= yes # +# If you have a commercial application for a FreeBSD 4.x that cannot easily +# be updated to a FreeBSD 5.x application and it generates the error message +# "undefined reference to `__sF'", then you can uncomment the following +# line to build a libc compatibility with FreeBSD 4.x. NOTE, THIS SHOULD BE +# USED AS A LAST RESORT. +# +#WANT_COMPAT4_STDIO= yes +# # # Default format for system documentation, depends on your printer. # Set this to "ascii" for simple printers or screen --- share/man/man5/make.conf.5.orig Sat Nov 2 10:56:04 2002 +++ share/man/man5/make.conf.5 Sat Nov 2 11:03:43 2002 @@ -605,6 +605,14 @@ and above is known to trigger known optimizer bugs at various times \(em this is worse on the Alpha platform. The value assigned is the highest optimization value used. +.It Va WANT_COMPAT4_STDIO +.Pq Vt bool +If you have a commercial application for a FreeBSD 4.x that cannot easily +be updated to a FreeBSD 5.x application and it generates the error message +.Dq undefined reference to `__sF' , +then you can uncomment the following line to build a libc compatibility with +FreeBSD 4.x. +.Em NOTE, THIS SHOULD BE USED AS A LAST RESORT. .El .Pp The following list provides a name and short description for variables To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message