Subject: "virtual memory exausted" building netbsd-1-6 for sparc on alpha
To: NetBSD/alpha Discussion List <port-alpha@NetBSD.ORG>
From: Greg A. Woods <woods@weird.com>
List: tech-toolchain
Date: 11/07/2003 17:22:58
I'm trying a cross-build of netbsd-1-6 for sparc on my alpha.  It gets this far:

/build/woods/building/NetBSD-1.6.x-alpha-sparc-tools/bin/sparc--netbsdelf-gcc -O2 -g -DALL_STATE -DUSG_COMPAT -pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Wreturn-type -Wpointer-arith -Wswitch -Wshadow  -Werror  -D_LIBC -DLIBC_SCCS -DSYSLIBC_SCCS -D_REENTRANT -I/proven/work/woods/m-NetBSD-1.6/lib/libc/include -DINET6 -DNLS -D__DBINTERFACE_PRIVATE -I/proven/work/woods/m-NetBSD-1.6/lib/libc/../../libexec/ld.elf_so -I/proven/work/woods/m-NetBSD-1.6/lib/libc/dlfcn -DI18NMODULE_MAJOR=4 -DWITH_RUNE -I/proven/work/woods/m-NetBSD-1.6/lib/libc -DRESOLVDEBUG -DRESOLVSORT -I. -DPOSIX_MISTAKE -DPORTMAP -DFLOATING_POINT -nostdinc -isystem /build/woods/building/NetBSD-1.6.x-sparc-destdir/usr/include  -c /proven/work/woods/m-NetBSD-1.6/lib/libc/hash/sha1.c
/proven/work/woods/m-NetBSD-1.6/lib/libc/hash/sha1.c: In function `_SHA1Transform':
/proven/work/woods/m-NetBSD-1.6/lib/libc/hash/sha1.c:206: virtual memory exhausted


This machine has 1.5GB of RAM and 1GB of swap, but of course that's not
what counts.  My default soft rlimits are:

	$ ulimit -a
	time(cpu-seconds)    unlimited
	file(blocks)         unlimited
	coredump(blocks)     unlimited
	data(kbytes)         131072
	stack(kbytes)        2048
	lockedmem(kbytes)    485077
	memory(kbytes)       1455232
	nofiles(descriptors) 64
	processes            160

I increased the data and stack limits to their default hard limits:

	$ ulimit -a         
	time(cpu-seconds)    unlimited
	file(blocks)         unlimited
	coredump(blocks)     unlimited
	data(kbytes)         1048576
	stack(kbytes)        32768
	lockedmem(kbytes)    485077
	memory(kbytes)       1455232
	nofiles(descriptors) 64
	processes            160

and then watched the 'cc1' process grow to at least 1019 MB (with top)
before it died the same way again.

Using "COPTS=-O0" worked.

Is cross-building for sparc on alpha maybe not a good idea for
netbsd-1-6?  (Given the number of other GCC 2.95.3 -O blow-ups I've
heard rumours of, I'm guessing this won't be the first I encounter.)


Note that a build for alpha on the alpha works fine with -O2 (with the
same source tree, as does building for i386 and sparc on i386).

-- 
						Greg A. Woods

+1 416 218-0098                  VE3TCP            RoboHack <woods@robohack.ca>
Planix, Inc. <woods@planix.com>          Secrets of the Weird <woods@weird.com>