Subject: Re: Recent changes in NetBSD/mips
To: Toru Nishimura <nisimura@itc.aist-nara.ac.jp>
From: Castor Fu <castor@geocast.net>
List: port-mips
Date: 01/17/1999 18:33:00
> I think I've finished cleanup jobs involved with recent changes in
> arch/mips arena.  NetBSD/pmax and NetBSD/newsmips are now stable
> enough to compile kernels.  Sorry about mess made by my imcomplete
> work.
> 
> However, I think there still is one trouble with sys/lib/libkern.  How
> can I avoid to compile *.S files from '-DPIC -DABI_CALLS'? 

I was thinking that in bsd.lib.mk one could insert a specific test.

How about something like the following:

	# On mips, all libs need to be compiled with ABIcalls, not just sharedlibs.
	CPICFLAGS?=
	APICFLAGS?=
	#CPICFLAGS?= -fpic -DPIC
	#APICFLAGS?= -DPIC

	# so turn shlib PIC flags on for ${CPP}, ${CC}, and ${AS} as follows:
	# XXX We need better way of disabling this if GP is set.
	.if (!defined(KERNCPPFLAGS))
	AINC+=-DPIC -DABICALLS
	COPTS+= -fPIC ${AINC}
	AFLAGS+= -fPIC
	AS+=    -KPIC
	.endif

It's a hack, because someone just might want to have ABICALLS in their
kernel.  

	-castor