Subject: port-sparc/20556: sparc boot blocks not building for MACHINE==sparc64,MACHINE_ARCH==sparc
To: None <gnats-bugs@gnats.netbsd.org>
From: None <lukem@netbsd.org>
List: netbsd-bugs
Date: 03/03/2003 13:20:46
>Number:         20556
>Category:       port-sparc
>Synopsis:       sparc boot blocks not building for MACHINE==sparc64,MACHINE_ARCH==sparc
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    port-sparc-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Mar 02 18:21:00 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Luke Mewburn
>Release:        NetBSD 20030303
>Organization:
>Environment:
System: NetBSD cerberus.mewburn.net 1.6N NetBSD 1.6N (CERBERUS from GENERIC32-$Revision: 1.56 $) #1: Sun Feb 16 21:04:57 EST 2003 lukem@argo.mewburn.net:/var/scratch/obj.sparc/z/src/netbsd/src-clean/sys/arch/sparc/compile/CERBERUS sparc64
Architecture: sparc
Machine: sparc64

>Description:
	I'm building a sparc release on my Ultra 5 (which runs a
	variant of the GENERIC32 kernel) with:
		build.sh -m sparc64 -a sparc ...
	(I.e, 32 bit userland).

	The boot blocks in sys/arch/sparc/stand fail to build on lines
	such as:
		paddr_t foo;
		printf("%lx", foo);
	with errors such as:
		warning: long unsigned int format, different type arg (arg 2)

	The `obvious' fix of casting foo to (u_long) appeases the
	compiler in boot/boot.c and common/mmu.c, but then we
	hit a problem in sys/lib/libsa/loadfile_aout.c with:
		warning: cast to pointer from integer of different size
	(lines 136, 140, 151, (etc)), at which point I punted until
	receiving further advice...

	This looks like it's related to the code in
	sys/arch/sparc/include/types.h which seems to effectively do:
		#if defined(SUN4U) && !defined(__arch64__)
		typedef unsigned long long int paddr_t
		#else
		typedef unsigned long int paddr_t
		#endif


>How-To-Repeat:
	(see above)

>Fix:
	NFI; my sparc foo isn't that good.  It appears that this may
	one of the issues associated with having sys/arch/sparc
	containing MACHINE dependent as well as MACHINE_ARCH dependent code.
>Release-Note:
>Audit-Trail:
>Unformatted: