Subject: kern/9842: ata dependency on wdc, triggered by umass
To: None <gnats-bugs@gnats.netbsd.org>
From: Gary Duzan <gary@gduzan.static.shore.net>
List: netbsd-bugs
Date: 04/08/2000 11:23:05
>Number:         9842
>Category:       kern
>Synopsis:       ata dependency on wdc, triggered by umass
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Apr 08 10:56:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Gary Duzan
>Release:        Sat Apr  8 10:04:49 EDT 2000
>Organization:
	Not a lot
>Environment:
System: NetBSD wheel 1.4X NetBSD 1.4X (WHEEL) #0: Wed Mar 29 15:58:18 EST 2000 gary@wheel:/usr/tmp/src/sys/arch/i386/compile/WHEEL i386


>Description:
	In a kernel with umass (which pulls in atapi) configured,
	but no atapibus or wdc configured, ata.c (which refers to
	symbols in wdc) is pulled in, but not wdc, leading to
	unresolved symbols at link time.

ld -Ttext c0100000 -e start -X -o netbsd ${SYSTEM_OBJ} vers.o
ata.o: In function `ata_get_params':
/root/src/sys/arch/i386/compile/WHEEL/../../../../dev/ata/ata.c:74: undefined reference to `wdcdebug_mask'
/root/src/sys/arch/i386/compile/WHEEL/../../../../dev/ata/ata.c:91: undefined reference to `wdcdebug_mask'
/root/src/sys/arch/i386/compile/WHEEL/../../../../dev/ata/ata.c:98: undefined reference to `wdc_exec_command'
/root/src/sys/arch/i386/compile/WHEEL/../../../../dev/ata/ata.c:99: undefined reference to `wdcdebug_mask'
/root/src/sys/arch/i386/compile/WHEEL/../../../../dev/ata/ata.c:104: undefined reference to `wdcdebug_mask'
ata.o: In function `ata_set_mode':
/root/src/sys/arch/i386/compile/WHEEL/../../../../dev/ata/ata.c:147: undefined reference to `wdcdebug_mask'
/root/src/sys/arch/i386/compile/WHEEL/../../../../dev/ata/ata.c:157: undefined reference to `wdc_exec_command'
ata.o: In function `ata_dmaerr':
/root/src/sys/arch/i386/compile/WHEEL/../../../../dev/ata/ata.c:178: undefined reference to `wdc_downgrade_mode'
*** Error code 1

>How-To-Repeat:
	Configure a fairly minimal kernel with umass enabled, but
	no wdc/atapibus, and try to build it.
>Fix:
	Protecting all of ata.c with "#if NATAPIBUS > 0" lets me
	compile, at least, but doesn't seem right. Either prevent
	ata from being pulled in or pull in wdc with it.
>Release-Note:
>Audit-Trail:
>Unformatted: