Subject: kern/16217: special kernel config won't link
To: None <gnats-bugs@gnats.netbsd.org>
From: None <mrauch@netbsd.org>
List: netbsd-bugs
Date: 04/06/2002 16:54:50
>Number:         16217
>Category:       kern
>Synopsis:       using the attached kernel config the kernel won't link
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Apr 06 06:55:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Michael Rauch
>Release:        NetBSD 1.5ZC, 30 Mar 2002
>Organization:
>Environment:
System: NetBSD zonk 1.5ZC NetBSD 1.5ZC (ZONKCONF) #0: Sat Apr 6 15:52:30 GMT 2002 root@zonk:/usr/src/src/sys/arch/i386/compile/ZONKCONF i386
Architecture: i386
Machine: i386
>Description:
	I've created the following kernel configuration for my system. 
	(It's a GENERIC_ISDN with a few things added and non-existent ones
	 commented out.)
############## ZONKCONF ###########
include 	"arch/i386/conf/std.i386"
maxusers	32		# estimated number of users
options 	I686_CPU
options 	VM86		# virtual 8086 emulation
options 	USER_LDT	# user-settable LDT; used by WINE
options 	DUMMY_NOPS
options 	MTRR		# memory-type range register syscall support
options 	UCONSOLE	# users can use TIOCCONS (for xconsole)
options 	INSECURE	# disable kernel security levels
options 	RTC_OFFSET=0	# hardware clock is this many mins. west of GMT
options 	NTP		# NTP phase/frequency locked loop
options 	KTRACE		# system call tracing via ktrace(1)
options 	SYSVMSG		# System V-like message queues
options 	SYSVSEM		# System V-like semaphores
options 	SYSVSHM		# System V-like memory sharing
options 	LKM		# loadable kernel modules
options 	DDB		# in-kernel debugger
options 	DDB_HISTORY_SIZE=512	# enable history editing in DDB
options 	COMPAT_NOMID	# compatibility with 386BSD, BSDI, NetBSD 0.8,
options 	COMPAT_09	# NetBSD 0.9,
options 	COMPAT_10	# NetBSD 1.0,
options 	COMPAT_11	# NetBSD 1.1,
options 	COMPAT_12	# NetBSD 1.2,
options 	COMPAT_13	# NetBSD 1.3,
options 	COMPAT_14	# NetBSD 1.4,
options 	COMPAT_15	# NetBSD 1.5,
options 	COMPAT_43	# and 4.3BSD
options 	COMPAT_386BSD_MBRPART # recognize old partition ID
options 	COMPAT_SVR4	# binary compatibility with SVR4
options 	COMPAT_LINUX	# binary compatibility with Linux
options 	COMPAT_FREEBSD	# binary compatibility with FreeBSD
file-system 	FFS		# UFS
file-system 	EXT2FS		# second extended file system (linux)
file-system 	LFS		# log-structured file system
file-system 	MFS		# memory file system
file-system 	NFS		# Network File System client
file-system 	NTFS		# Windows/NT file system (experimental)
file-system 	CD9660		# ISO 9660 + Rock Ridge file system
file-system 	MSDOSFS		# MS-DOS file system
file-system 	FDESC		# /dev/fd
file-system 	KERNFS		# /kern
file-system 	NULLFS		# loopback file system
file-system 	OVERLAY		# overlay file system
file-system 	PORTAL		# portal filesystem (still experimental)
file-system 	PROCFS		# /proc
file-system 	UMAPFS		# NULLFS + uid and gid remapping
file-system 	UNION		# union file system
options 	QUOTA		# UFS quotas
options 	SOFTDEP		# FFS soft updates support.
options 	NFSSERVER	# Network File System server
				# immutable) behave as system flags.
options 	INET		# IP + ICMP + TCP + UDP
options 	INET6		# IPV6
options 	IPSEC		# IP security
options 	IPSEC_ESP	# IP security (encryption part; define w/IPSEC)
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	# pfil(9) packet filter hooks
options 	IPFILTER_LOG	# ipmon(8) log support
options 	EISAVERBOSE	# verbose EISA device autoconfig messages
options 	MIIVERBOSE	# verbose PHY autoconfig messages
options 	PCIVERBOSE	# verbose PCI device autoconfig messages
options 	SCSIVERBOSE	# human readable SCSI error messages
options 	USBVERBOSE	# verbose USB device autoconfig messages
options 	PNPBIOSVERBOSE	# verbose PnP BIOS messages
options 	NFS_BOOT_DHCP,NFS_BOOT_BOOTPARAM
options 	WSEMUL_VT100		# VT100 / VT220 emulation
options 	WS_KERNEL_FG=WSCOL_GREEN
options 	WSDISPLAY_COMPAT_PCVT		# emulate some ioctls
options 	WSDISPLAY_COMPAT_SYSCONS	# emulate some ioctls
options 	WSDISPLAY_COMPAT_USL		# VT handling
options 	WSDISPLAY_COMPAT_RAWKBD		# can get raw scancodes
options 	PCKBD_LAYOUT="(KB_DE | KB_NODEAD)"
options 	PCDISPLAY_SOFTCURSOR
config		netbsd	root on ? type ?
mainbus0 at root
apm0	at mainbus0			# Advanced power management
pnpbios*	at mainbus?
pci*	at mainbus? bus ?
pci*	at pchb? bus ?
pci*	at ppb? bus ?
options 	PCIBIOS			# PCI BIOS support
options 	PCIBIOSVERBOSE		# PCI BIOS verbose info
pchb*	at pci? dev ? function ?	# PCI-Host bridges
pcib*	at pci? dev ? function ?	# PCI-ISA bridges
ppb*	at pci? dev ? function ?	# PCI-PCI bridges
agp* 	at pchb?
isa0	at mainbus?
isa0	at pcib?
isapnp0	at isa?
npx0	at isa? port 0xf0 irq 13	# x86 math coprocessor
pckbc0		at isa?			# pc keyboard controller
pckbd*		at pckbc?		# PC keyboard
pms*		at pckbc?		# PS/2 mouse for wsmouse
pmsi*		at pckbc?		# PS/2 "Intelli"mouse for wsmouse
vga0		at isa?
vga*		at pci? dev ? function ?
wsdisplay*	at vga? console ?
wskbd* 		at pckbd? console ?
wsmouse*	at pms? mux 0
wsmouse*	at pmsi? mux 0
pcppi0		at isa?
sysbeep0	at pcppi?
com*	at isapnp?			# Modems and serial boards
com0	at isa? port 0x3f8 irq 4	# Standard PC serial ports
com1	at isa? port 0x2f8 irq 3
lpt0	at isa? port 0x378 irq 7	# standard PC parallel ports
viapm*	at pci? dev ? function ?
viaenv* at viapm?
trm*	at pci? dev ? function ?	# Tekram DC-395U/UW/F, DC-315/U SCSI
scsibus* at trm?
sd*	at scsibus? target ? lun ?	# SCSI disk drives
st*	at scsibus? target ? lun ?	# SCSI tape drives
cd*	at scsibus? target ? lun ?	# SCSI CD-ROM drives
ch*	at scsibus? target ? lun ?	# SCSI autochangers
ses*	at scsibus? target ? lun ?	# SCSI Enclosure Services devices
ss*	at scsibus? target ? lun ?	# SCSI scanners
uk*	at scsibus? target ? lun ?	# SCSI unknown
pciide* at pci? dev ? function ? flags 0x0000
wd*	at pciide? channel ? drive ? flags 0x0000
atapibus* at pciide? channel ?
cd*	at atapibus? drive ? flags 0x0000	# ATAPI CD-ROM drives
sd*	at atapibus? drive ? flags 0x0000	# ATAPI disk drives
st*	at atapibus? drive ? flags 0x0000	# ATAPI tape drives
uk*	at atapibus? drive ? flags 0x0000	# ATAPI unknown
fdc0	at isa? port 0x3f0 irq 6 drq 2	# standard PC floppy controllers
fd*	at fdc? drive ?			# the drives themselves
uhci*	at pci?	dev ? function ?	# Universal Host Controller (Intel)
usb*	at uhci?
uhub*	at usb?
uhub*	at uhub? port ? configuration ? interface ?
ugen*	at uhub? port ?
auvia*	at pci? dev ? function ?	# VIA VT82C686A integrated AC'97 Audio
audio*	at auvia?
pseudo-device	md		1	# memory disk device (ramdisk)
pseudo-device	vnd		4	# disk-like interface to files
pseudo-device	bpfilter	8	# Berkeley packet filter
pseudo-device	ipfilter		# IP filter (firewall) and NAT
pseudo-device	loop			# network loopback
pseudo-device	ppp		2	# Point-to-Point Protocol
pseudo-device	gif		4	# IPv[46] over IPv[46] tunnel (RFC1933)
pseudo-device	vlan			# IEEE 802.1q encapsulation
pseudo-device	pty			# pseudo-terminals
pseudo-device	rnd			# /dev/random and in-kernel generator
pseudo-device	wsmux			# mouse & keyboard multiplexor
pseudo-device	wsfont
ifpci* at pci?
pseudo-device	isdn		  # communication with userland daemon
pseudo-device	isdntrc		2 # userland driver to do ISDN tracing
pseudo-device	isdnctl		  # userland driver to control the whole thing
pseudo-device	isdnbchan	4 # userland driver for access to raw B channel
pseudo-device	isdntel		2 # userland driver for telephony
options 	IPR_VJ		  # compile support for VJ compression
pseudo-device	irip		2 # network driver for IP over raw HDLC ISDN
pseudo-device	ippp		2 # synchronous PPP over ISDN
#########################################################################

	The final linking of netbsd fails with undefined symbols:

ld -T ../../../../arch/i386/conf/kern.ldscript -Ttext c0100000 -e start -X -o netbsd ${SYSTEM_OBJ} vers.o
isic_l1.o: In function `isic_std_mph_command_req':
isic_l1.o(.text+0x397): undefined reference to `isic_enable_intr'
isic_l1.o(.text+0x41a): undefined reference to `isic_enable_intr'
if_ethersubr.o: In function `ether_output':
if_ethersubr.o(.text+0x1ec): undefined reference to `arpresolve'
if_ethersubr.o: In function `ether_input':
if_ethersubr.o(.text+0x84b): undefined reference to `arpintrq'
if_ethersubr.o(.text+0x85b): undefined reference to `revarpinput'
if_ethersubr.o: In function `ether_ioctl':
if_ethersubr.o(.text+0x1058): undefined reference to `arp_ifinit'
if_vlan.o: In function `vlan_ioctl':
if_vlan.o(.text+0x5ae): undefined reference to `arp_ifinit'
ifpci.o: In function `ifpci_attach':
ifpci.o(.text+0x337): undefined reference to `isic_enable_intr'
*** Error code 1

>How-To-Repeat:
	cd /usr/src/sys/arch/i386/conf
	#create the above config
	config ZONKCONF
	cd ../compile/ZONKCONF
	make depend && make
>Fix:
	sys/conf/files seems to need the following patch and ifpci needs to
	depend on arp (but I have never worked with the internals of 
	kernel configuration, so someone should verify that this is correct.)
Index: files
===================================================================
RCS file: /cvsroot/syssrc/sys/conf/files,v
retrieving revision 1.508
diff -u -r1.508 files
--- files	2002/03/30 20:21:21	1.508
+++ files	2002/04/06 14:40:42
@@ -841,12 +841,12 @@
 #
 device	isic: isdndev, passive_isdn
 
-file	dev/ic/isic.c			isic
+file	dev/ic/isic.c			isic|ifpci
 file	dev/ic/isac.c			isic|ifpci
 file	dev/ic/isic_l1.c		isic|ifpci
 file	dev/ic/isic_l1fsm.c		isic|ifpci
-file	dev/ic/hscx.c			isic
-file	dev/ic/isic_bchan.c		isic
+file	dev/ic/hscx.c			isic|ifpci
+file	dev/ic/isic_bchan.c		isic|ifpci
 
 # (old) Diehl active ISDN cards
 #
>Release-Note:
>Audit-Trail:
>Unformatted: