Subject: Building libkern.o for -DLKM always?
To: None <>
From: Simon Burge <>
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

to conf/ so that we don't need to make the same
change to every arch's  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/ is included before

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

Simon Burge                                   <>
NetBSD Development, Support and Service: