Subject: Re: actual -current sources -> kernel link failure
To: None <current-users@netbsd.org>
From: Valeriy E. Ushakov <uwe@ptc.spbu.ru>
List: current-users
Date: 11/08/2003 21:48:10
On Sat, Nov 08, 2003 at 18:58:00 +0100, Markus W Kilbinger wrote:

> With recent -current sources (some minutes ago) completely compiling a
> new kernel fails with:
> 
>   /usr/toolchain-sparc/bin/sparc--netbsdelf-ld -n -T ../../../../arch/sparc/conf/kern.ldscript -Ttext F0004000 -e start   -X -S -o netbsd ${SYSTEM_OBJ} ${EXTRA_OBJ} vers.o
>   locore.o: In function `Lsw_scan':
>   locore.o(.text+0x38e8): undefined reference to `__ffstab'
>   locore.o(.text+0x38ec): undefined reference to `__ffstab'

Oh, seems like makeing the libkern is completely broken with recent
changes (to share/mk, I guess).  I can see similar failure mode with
building hpcsh kernel.

The problem is that linkern's makefile now *ingores* arch specific .S
implementations of certain functions and always uses MI .c
implementations.  Check the lib/kern/ffs.d file in your kernel build
dir and you'll see it uses MI ffs.c, not sparc's ffs.S

Sparc's locore.S has an optimized inlined ffs() in Lsw_scan that uses
__ffstab provides by sparc's ffs.S, but libkern supplies ffs()
compiled MI ffs.c that doesn't provide this table, so the kernel fails
to link.

(Luke?)

SY, Uwe
-- 
uwe@ptc.spbu.ru                         |       Zu Grunde kommen
http://www.ptc.spbu.ru/~uwe/            |       Ist zu Grunde gehen