Subject: Re: 1.4 -> current
To: der Mouse <mouse@Rodents.Montreal.QC.CA>
From: Eduardo E. Horvath <eeh@one-o.com>
List: port-sparc
Date: 08/16/1999 08:41:20
On Sun, 15 Aug 1999, der Mouse wrote:

> I wanted to move one of my SPARCs from 1.4 to -current (specifically,
> the sup of 08-13).  So I looked at the "a.out to ELF" faq and started
> in.  But I'd barely started when I got trouble.  When trying to build
> the first -current kernel,
> 
> cc -g -O2 -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes  -Wpointer-arith -Wno-main -I. -I../../../../arch -I../../../.. -nostdinc -DSUN4 -DSUN4C -DSUN4M -DRASTERCONSOLE -DRASTERCONS_WONB -DRASTERCONS_FULLSCREEN -DLKM -DDIAGNOSTIC -DDEBUG -DSCSIDEBUG -DCOMPAT_14 -DNS -DMAXUSERS=32 -D_KERNEL  -c param.c
> cc1: warnings being treated as errors
> In file included from param.c:48:
> ../../../../sys/systm.h:196: warning: conflicting types for built-in function `memcmp'
> ../../../../sys/systm.h:197: warning: conflicting types for built-in function `memcpy'
> ../../../../sys/systm.h:199: warning: conflicting types for built-in function `memset'
> *** Error code 1
> 
> Stop.
> 
> This appears to be because sys/arch/sparc/include/ansi.h in the old
> tree defines _BSD_SIZE_T_ as unsigned int, whereas the new one defines
> it as unsigned long.  This ends up getting used for size_t, which
> breaks the prototypes in systm.h.
> 
> For the time being, I'm going to add a private patch to change this
> back, since on my SPARCs, unsigned int and unsigned long are the same.
> But I'd be interested to know what the right fix is....

The old definition of _BSD_SIZE_T_ as well as several other types in
ansi.h were wrong and would simply not work in an LP64 environment.  They
were changed to provide source level compatibility with sparc64.  The idea
is that since everything else would break when switching to ELF that one
more breakage would not be noticed.

The proper fix is to install the new ansi.h on your 1.4 systems and
rebuild an a.out gcc with it.  Alternatively you can remove -Werror from 
bsd.sys.mk and just ignore the warning since it has no real effect on code
generation in ILP32.

=========================================================================
Eduardo Horvath				eeh@one-o.com
	"I need to find a pithy new quote." -- me