Subject: Re: building 32bit kernel
To: None <heas@shrubbery.net, port-sparc64@netbsd.org>
From: None <eeh@netbsd.org>
List: port-sparc64
Date: 03/05/2002 00:58:26
| eeh mentioned (or eluded to) a week or two ago that 32 bit kernels on
| sparc64 offered more stability and compiler reliability.  i decided to
| try it, but i've been unsuccessful in building GENERIC32 on a ultra2
| with userland from sources of ~saturday.  the linker produces the
| following
|
| ld: warning: sparc:v9 architecture of input file `/sys/arch/sparc64/compile/NONPLUS/lib/compat/libcompat.a(tty_43.o)' is incompatible with sparc output
|
| from
|
| cc -Wa,-Av9a -mno-fpu -ffreestanding -g -O2 -Werror -Wall -Wno-main -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wno-uninitialized -I../../../../../../lib/libkern/arch/sparc -Dsparc64 -I../../. -I../../../../../../arch -I../../../../../.. -nostdinc -D__ELF__ -DLKM -DMAXUSERS=64 -D_KERNEL -D_KERNEL_OPT    -c /home/src/sys/arch/sparc64/compile/NONPLUS/lib/kern/../../../../../../lib/libkern/strrchr.c
|
| which generates v9 64bit object files
|
| maple [33] file vers.o
| vers.o: ELF 64-bit MSB relocatable, SPARC V9, version 1 (SYSV), not stripped
|
| presumably -Wa,-Av9a needs to become -Wa,-Av8 or some such and perhaps
| -msupersparc to tell it to produce sparcv8 object files?  or is cross-
| compiling the only option right now?

There are a few problems with what you're doing.

1) You need a 32-bit sparc toolchain.

2) You need to set MACHINE_ARCH=sparc in your environment

3) Apparently the sparc64->sparc32 cross compiler generates buggy
`long long' code.

So the best thing to do is to cross-compile the kernel from some
other 32-bit machine, or install an existing 32-bit sparc userland
and use that compiler in /emul/netbsd32.

Eduardo