Subject: Re: actual -current sources -> kernel link failure
To: None <current-users@netbsd.org, port-sparc@netbsd.org>
From: Luke Mewburn <lukem@NetBSD.org>
List: current-users
Date: 11/09/2003 10:19:40
On Sat, Nov 08, 2003 at 09:48:10PM +0300, Valeriy E. Ushakov wrote:
  | 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?)

This is fixed now; update share/mk/sys.mk to the latest.
I've testbuilt a sparc GENERIC kernel and it linked ok.

Apologies for that.