Subject: Building libkern.o for -DLKM always?
To: None <tech-kern@netbsd.org>
From: Simon Burge <simonb@wasabisystems.com>
List: tech-kern
Date: 11/12/2005 10:42:43
Hi Folks,

Two recent PRs (31857 and 32047) show that we build a libkern.a on mips
and alpha even for the LKM case, and when we link the kernel obviously
all the unneeded libkern .o's are left out.  This causes problems when
some LKMs then can't find libkern functions - bswap64 in the pf LKM is
the case in those PRs.

As it is currently, only a handful of archs use KERN_AS=obj to link in
a complete libkern when LKMs are enabled.  After a little discussion
with Chuck Silvers, how about adding

	.if !empty(IDENT:M-DLKM)
	KERN_AS=        obj
	.endif

to conf/Makefile.kern.inc so that we don't need to make the same
change to every arch's Makefile.inc?  Or maybe KERN_AS?=obj so that
it can still be overriden per-port if there's a need?  I'll check
that that works first (ie, conf/Makefile.kern.inc is included before
sys/lib/libkern/Makefile.inc).

I'll do this in a couple of days if no one has any problems with it.

Simon.
--
Simon Burge                                   <simonb@wasabisystems.com>
NetBSD Development, Support and Service:   http://www.wasabisystems.com/