Subject: port-hp300/21502: Compile error for dev/rtc.c
To: None <gnats-bugs@gnats.netbsd.org>
From: None <jarle@uninett.no>
List: netbsd-bugs
Date: 05/08/2003 15:41:50
>Number:         21502
>Category:       port-hp300
>Synopsis:       Compile error for dev/rtc.c
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    port-hp300-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu May 08 13:42:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Jarle Greipsland
>Release:        NetBSD 1.6R
>Organization:
	
>Environment:
	
	
System: NetBSD dennis.urc.uninett.no 1.6R NetBSD 1.6R (DENNIS) #1: Mon Apr 28 21:52:21 CEST 2003 jarle@dennis.urc.uninett.no:/sys/arch/hp300/compile/DENNIS hp300
Architecture: m68k
Machine: hp300
>Description:
The dev/rtc.c file fails to compile.  The error messages are:
cc  -msoft-float -ffreestanding -g -O2 -Werror -Wall -Wno-main -Wno-format-zero-length -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wno-sign-compare -Wno-uninitialized  -Dhp300 -I.  -I../../../../arch -I../../../.. -nostdinc -DLKM -DCOMPAT_NOLABEL -DSCSIVERBOSE -DDIOVERBOSE -DMAXUSERS=32 -D_KERNEL -D_KERNEL_OPT   -c ../../../../arch/hp300/dev/rtc.c
cc1: warnings being treated as errors
../../../../arch/hp300/dev/rtc.c: In function `rtcattach':
../../../../arch/hp300/dev/rtc.c:116: warning: implicit declaration of function `simple_lock'
../../../../arch/hp300/dev/rtc.c:116: warning: implicit declaration of function `simple_unlock'
*** Error code 1

The kernel configuration (see below) is stripped down if compared to the
GENERIC configuration file, and I think that the problem is in the
sys/malloc.h file, where the omission of any of the options: KMEMSTATS,
DIAGNOSTIC, _LKM, MALLOCLOG, LOCKDEBUG, and MALLOC_NOINLINE, causes the
macroized version of MALLOC() to be selected, and this again includes
references to the simple_lock function.  sys/lock.h is not included in the
rtc.c file.

Kernel configuration file:

# DENNIS kernel configuration file

include 	"arch/hp300/conf/std.hp300"

#options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary

#ident 		"GENERIC-$Revision: 1.89 $"

maxusers	32		# estimated number of users

# Support for various CPU types
#options 	HP320
#options 	HP330		# includes 318, 319
#options 	HP340
#options 	HP345
#options 	HP350
#options 	HP360
#options 	HP370
#options 	HP375
#options 	HP380
#options 	HP385
options 	HP400
options 	HP425
options 	HP433
options 	FPSP		# floating point interface for 68040

# Standard system options
options 	KTRACE		# system call tracing support
options 	SYSTRACE	# system call vetting via systrace(1)
options 	LKM		# Loadable kernel modules
#options 	INSECURE	# disable kernel security level
#options 	UCONSOLE	# Allow non-root TIOCCONS
options 	USERCONF	# userconf(4) support
#options	PIPE_SOCKETPAIR	# smaller, but slower pipe(2)
#options	RTC_OFFSET=0	# hardware clock is this many mins. west of GMT
options 	NTP		# NTP phase/frequency locked loop
options 	SYSVSHM		# System V-style shared memory
#options	SHMMAXPGS=1024	# 1024 pages is the default
options 	SYSVMSG		# System V-style message queues
options 	SYSVSEM		# System V-style semaphores
#options 	SEMMNI=10	# number of semaphore identifiers
#options 	SEMMNS=60	# number of semaphores in system
#options 	SEMUME=10	# max number of undo entries per process
#options 	SEMMNU=30	# number of undo structures in system

# Enable experimental buffer queue strategy for better responsiveness under 
# high disk I/O load. Use it with caution - it's not proven to be stable yet.
#options 	NEW_BUFQ_STRATEGY

# Debugging options
#options 	DIAGNOSTIC	# Extra kernel sanity checks
#options 	DEBUG		# Enable misc. kernel debugging code
#options 	KMEMSTATS	# kernel memory statistics (vmstat -m)
options 	DDB		# Kernel Dynamic Debugger
#options 	DDB_HISTORY_SIZE=100	# Enable history editing in DDB
#options 	KGDB		# remote debugger
makeoptions	DEBUG="-g"	# netbsd.gdb with full debugging symbols

# Compatibility options
#options 	COMPAT_43	# compatibility with 4.3BSD interfaces
#options 	COMPAT_44	# compatibility with 4.4BSD binaries
#options 	COMPAT_09	# compatibility with NetBSD 0.9
#options 	COMPAT_10	# compatibility with NetBSD 1.0
#options 	COMPAT_11	# compatibility with NetBSD 1.1
#options 	COMPAT_12	# compatibility with NetBSD 1.2
#options 	COMPAT_13	# compatibility with NetBSD 1.3
#options 	COMPAT_14	# compatibility with NetBSD 1.4
#options 	TCP_COMPAT_42	# 4.2BSD TCP/IP bug compat. Not recommended.

# Binary compatibility.
#options 	COMPAT_HPUX	# HP-UX binary compatibility
#options 	COMPAT_AOUT_M68K	# NetBSD/m68k a.out binary compatibility
#options 	COMPAT_M68K4K	# NetBSD/m68k4k binary compatibility
#options 	COMPAT_SUNOS	# SunOS4 m68k binary compatibility
#options 	COMPAT_LINUX	# Linux/m68k binary compatibility
#options 	COMPAT_SVR4	# SVR4 binary compatibility

# Filesystems
file-system	CD9660		# CD-ROM ISO-9660 filesystem
#file-system	EXT2FS		# second extended file system (linux)
file-system	FDESC		# user file descriptor filesystem
file-system	FFS		# fast filesystem
file-system	KERNFS		# kernel data-structure filesystem
file-system	LFS		# log-structured file system
file-system	MFS		# Memory-based filesystem
file-system	NFS		# Network filesystem client
file-system	NULLFS		# loopback file system
file-system	OVERLAY		# overlay file system
file-system	PORTAL		# portal filesystem (still experimental)
file-system	PROCFS		# /proc filesystem
file-system	UMAPFS		# NULLFS + uid and gid remapping
file-system	UNION		# Union filesystem (req. for FDESC)
#file-system	CODA		# Coda File System; also needs vcoda (below)

# Filesystem options
options 	QUOTA		# User and group quotas in FFS
#options 	FFS_EI		# FFS Endian Independant support
options 	SOFTDEP		# FFS soft updates support.
options 	NFSSERVER	# Network filesystem server
#options 	EXT2FS_SYSTEM_FLAGS # makes ext2fs file flags
options 	NFS_BOOT_BOOTP	# use bootp for NFS boot

# Networking options
options 	INET		# Internet protocols
options 	INET6		# IPV6
#options 	IPSEC		# IP security
#options 	IPSEC_ESP	# IP security (encryption part; define w/IPSEC)
#options 	IPSEC_DEBUG	# debug for IP security
#options 	GATEWAY		# IP forwarding + larger mb_map
#options 	MROUTING	# Multicast routing
#options 	NS		# XNS
#options 	NSIP		# XNS tunneling over IP
#options 	ISO,TPIP	# OSI
#options 	EON		# OSI tunneling over IP
#options 	CCITT,LLC,HDLC	# X.25
#options 	NETATALK	# AppleTalk networking protocols
options 	PPP_BSDCOMP	# BSD-Compress compression support for PPP
options 	PPP_DEFLATE	# Deflate compression support for PPP
options 	PPP_FILTER	# Active filter support for PPP (requires bpf)
options 	PFIL_HOOKS	# packet filter hooks
options 	IPFILTER_LOG	# ipmon(8) log support
#options 	IPFILTER_DEFAULT_BLOCK	# block all packets by default
#options 	TCP_DEBUG	# Record last TCP_NDEBUG packets with SO_DEBUG

# Options for HP hardware
options 	USELEDS		# make the lights twinkle
options 	COMPAT_NOLABEL	# defaults for unlabeled disks
#options 	PANICBUTTON	# two fast <reset>s on HIL dump kernel
#options 	CONSCODE=9	# force console at this select code
#options 	MAPPEDCOPY	# different copyin/copyout for large copies

# These options enable verbose messages for several subsystems.
# Warning, these may compile large string tables into the kernel!
options 	SCSIVERBOSE	# Verbose SCSI errors
options 	DIOVERBOSE	# recognize "unknown" DIO devices

config		netbsd root on ? type ?

#
# Device configuration
#

mainbus0	at root			# root "bus"

intio0		at mainbus0		# internal i/o space
dio0		at mainbus0		# DIO/DIO-II bus

rtc*		at intio?		# real-time clock (not optional)
dma* 		at intio?		# DMA controller
hil*		at intio?		# Human Interface Loop
#options 	UK_KEYBOARD		# include United Kingdom HIL keymap
#options 	SE_KEYBOARD		# include Swedish HIL keymap
frodo*		at intio?		# Frodo utility chip found on 4xx's

# 8250-like serial ports found on Frodo ASIC
#dnkbd0		at frodo? offset 0x0	# Domain keyboard flavor
apci*		at frodo? offset ?	# tty flavor

#dvbox*		at intio? 		# Davinci framebuffer
#dvbox*		at dio? scode ?

#gbox*		at intio?		# Gatorbox framebuffer
#gbox*		at dio? scode ?

hyper*		at dio? scode ?		# Hyperion framebuffer

#rbox*		at intio?		# Renaissance framebuffer
#rbox*		at dio? scode ?

topcat*		at intio?		# Topcat/catseye framebuffers
topcat*		at dio? scode ?

# Framebuffer abstraction
#grf*		at dvbox?
#grf*		at gbox?
grf*		at hyper?
#grf*		at rbox?
grf*		at topcat?

ite*		at grf?			# Internal Terminal Emulator

dca0		at dio? scode 9	flags 1	# DCA serial interfaces
dca*		at dio? scode ?

#dcm*		at dio? scode ?	flags 0xe # DCM 4- or 8-port serial interfaces

le*		at dio? scode ?		# LANCE ethernet interfaces

nhpib0		at dio? scode 7		# slow internal HP-IB
nhpib*		at dio? scode ?

#fhpib*		at dio? scode ?		# `fast' HP-IB

hpibbus0	at nhpib0
hpibbus*	at nhpib?
#hpibbus*	at fhpib?

#rd*		at hpibbus? slave ? punit ?	# HP-IB disks
ct*		at hpibbus? slave ? punit ?	# HP-IB cartridge tapes
mt*		at hpibbus? slave ? punit ?	# HP-IB 9-track tape
#ppi0		at hpibbus0 slave 5 punit 0	# HP-IB plotter

oscsi*		at dio? scode ?		# Old HP SCSI

sd*		at oscsi? target ? lun ?	# SCSI disks
st*		at oscsi? target ? lun ?	# SCSI tapes
#ac*		at oscsi? target ? lun ?	# SCSI changers

#
# Pseudo-devices
#

# disk pseudo-devices
#pseudo-device	ccd		4	# concatenated disk devices
#pseudo-device	cgd		4	# cryptographic disk devices
#pseudo-device	raid		8	# RAIDframe disk driver
#options 	RAID_AUTOCONFIG		# auto-configuration of RAID components
# Options to enable various other RAIDframe RAID types.
# options	RF_INCLUDE_EVENODD=1
# options	RF_INCLUDE_RAID5_RS=1
# options	RF_INCLUDE_PARITYLOGGING=1
# options	RF_INCLUDE_CHAINDECLUSTER=1
# options	RF_INCLUDE_INTERDECLUSTER=1
# options 	RF_INCLUDE_PARITY_DECLUSTERING=1
# options	RF_INCLUDE_PARITY_DECLUSTERING_DS=1
pseudo-device	md		1	# memory disk device (ramdisk)
pseudo-device	vnd		4	# vnode pseudo-disks

# network pseudo-devices
#pseudo-device	bridge			# simple inter-network bridging
pseudo-device	bpfilter	8	# Berkeley packet filter
#pseudo-device	faith		1	# IPv[46] tcp relay translation i/f
#pseudo-device	gre		2	# generic L3 over IP tunnel
#pseudo-device	gif		4	# IPv[46] over IPv[46] tunnel (RFC1933)
pseudo-device	ipfilter 		# IP Filter package
pseudo-device	loop			# loopback network interface
pseudo-device	ppp		4	# PPP network interfaces
#pseudo-device	pppoe			# PPP over Ethernet (RFC 2516)
#pseudo-device	sl		4	# SLIP network interfaces
#pseudo-device	stf		1	# 6to4 IPv6 over IPv4 encapsulation
pseudo-device	tun		2	# network tunneling over tty
#pseudo-device	vlan			# IEEE 802.1q encapsulation

# miscellaneous pseudo-devices
pseudo-device	clockctl		# user control of clock subsystem
pseudo-device	pty			# pseudo-terminals
pseudo-device	rnd			# /dev/random and in-kernel generator
#pseudo-device	vcoda		4	# coda minicache <-> venus comm.
	
>How-To-Repeat:
Configure a kernel without any of the options mentioned in the description
part of this message, and try and build the kernel.
	
>Fix:
Include <sys/lock.h> in rtc.c?
Use malloc() instead of MALLOC()?
	
>Release-Note:
>Audit-Trail:
>Unformatted: