Subject: lib/7888: new malloc doesn't compile on sparc
To: None <gnats-bugs@gnats.netbsd.org>
From: Manuel Bouyer <bouyer@antioche.lip6.fr>
List: netbsd-bugs
Date: 07/01/1999 06:50:53
>Number:         7888
>Category:       lib
>Synopsis:       new malloc doesn't compile on sparc
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    lib-bug-people (Library Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jul  1 06:50:01 1999
>Last-Modified:
>Originator:     Manuel Bouyer
>Organization:
	LIP6
>Release:        -current as supped last nigth.
>Environment:
	
System: NetBSD juliard.antioche.eu.org 1.4D NetBSD 1.4D (GENERIC_SCSI3) #0: Thu Jun 17 22:33:09 MEST 1999 pk@flambard:/usr/src/sys/arch/sparc/compile/GENERIC_SCSI3 sparc


>Description:
	
	The new malloc uses PGSHIFT. Seems like this macro is inteded for
	inernal kernel use only, as on sparc it is defined as pgshift which
	is a global kernel variable ( this is because the page size is not
	the same on all sparc machines). So using PGSHIFT in malloc.c breaks
	on the sparc (and any other architecture where PGSHIFT is not defined
	as a constant) because pgshift is not available in libc.
>How-To-Repeat:
	make build
>Fix:
	Workaround: use malloc.c from 1.4
	Fix: don't use PGSHIFT in libc, get the page size from another source
	(sysctl hw.pagesize ?).
>Audit-Trail:
>Unformatted: