Subject: Re: xdr_float.c?
To: Aaron J. Grier <agrier@poofy.goof.com>
From: Simon Burge <simonb@telstra.com.au>
List: tech-toolchain
Date: 03/30/1999 17:19:23
[[ I've added tech-toolchain to the list - it's probably more appropriate
   there ]]

"Aaron J. Grier" wrote:

> On Tue, Mar 30, 1999 at 11:39:54AM +1000, Simon Burge wrote:
> > "Aaron J. Grier" wrote:
> > 
> > > I had to add a '|| defined(__mipsel__)' in lib/libc/rpc/xdr_float.c and
> > > a few other places (lib/libc/stdlib/strtod.c, perhaps others) to get
> > > (today's) -current to compile.  Are the __mips__ defines obsolete now?
> >
> > I can't see where the problem is at the moment.  For example (line
> > wrapped to hopefully make it easier to read):
> [SNIP]
> 
> Ahh, sorry, it's lint that's causing problems, not cc:
> 
> (output is massaged a little here...)
> 
> lint -chapbxzF -D_LIBC -DNLS -DYP -DHESIOD -DLIBC_SCCS -DSYSLIBC_SCCS \
> 	-D_REENTRANT -I/usr/local/src/NetBSD/src/lib/libc/include \
> 	-D__DBINTERFACE_PRIVATE -DRESOLVSORT -I. -DPOSIX_MISTAKE \
> 	-DFLOATING_POINT -i lib/libc/rpc/xdr_float.c
> lib/libc/rpc/xdr_float.c(119): incomplete structure or union ieee_single: is
> lib/libc/rpc/xdr_float.c(120): incomplete structure or union vax_single: vs
> lib/libc/rpc/xdr_float.c(131): warning: pointer casts may be troublesome
> [bunch of errors snipped]
> *** Error code 1
> 
> Stop.
> 
> Hmm...  lint should be setting __mips__, right?  (I recompiled it, and
> things still didn't work...)

The problem is that lint is setting __${MACHINE_ARCH}__, which is mipsel
now.  I guess we have two options:

a)  Change all occurances of "if defined(__mips__)" to
    "if defined(__mipseb__) || defined(__mipsel_)".  In the tree at the
    moment, there are 4 files in gcc, 5 in sys and 15 others that
    check for __mips__

b)  Special case mips in xlint/xlint.c in the following chunk of code:

	#ifdef MACHINE_ARCH
		if (strcmp(un.machine, MACHINE_ARCH) != 0) {
			appdef(&cppflags, MACHINE_ARCH);
			appstrg(&lcppflgs, concat2("-D", MACHINE_ARCH));
		}
	#endif

I'm tempted to do (a)...

Simon.