From owner-freebsd-current Sat Sep 16 22: 1:13 2000 Delivered-To: freebsd-current@freebsd.org Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.208.78.105]) by hub.freebsd.org (Postfix) with ESMTP id A854937B422; Sat, 16 Sep 2000 22:01:10 -0700 (PDT) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.9.3/8.9.3) id WAA07848; Sat, 16 Sep 2000 22:06:29 -0700 (PDT) (envelope-from sgk) From: Steve Kargl Message-Id: <200009170506.WAA07848@troutmask.apl.washington.edu> Subject: Re: upgrade libgmp? In-Reply-To: from Kris Kennaway at "Sep 16, 2000 09:31:22 pm" To: Kris Kennaway Date: Sat, 16 Sep 2000 22:06:29 -0700 (PDT) Cc: FreeBSD Current X-Mailer: ELM [version 2.4ME+ PL61 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Kris Kennaway wrote: > On Sat, 16 Sep 2000, Steve Kargl wrote: > > > I'm not fluent in FSF configure scripts, but it looks like > > configure tests the compiler for specific features to determine > > CPU type. The gross hack would be to add CPU_TYPE="generic" > > to /etc/defaults/make.conf, and allow users to define CPU_TYPE > > in /etc/make.conf. It appears that for example CPU_TYPE="alpha" > > is insufficient because each cpu type 21064, 21164, 21264 has > > tuned asm code. The bmake file would then have a cascade of > > #ifdef CPU_TYPE to pull in the right code. > > > > Would a CPU_TYPE variable be useful for others parts of "make world"? > > The issue is that you have all sorts of possibilities like i386, i486, > pentium, pentiumpro, pentiummmx, k6, ... which you need to specify in > order of preference. If someone would care to submit example code of how > to handle this nicely from both the user and makefile perspective I'd be > grateful :-) > I need to review the gmp documents again, but I not sure the preference order is much of an issue. By default, CPU_TYPE="generic" would build the C code, which should work on all architectures supported by FreeBSD. If a user explicitly sets CPU_TYPE in /etc/make.conf, then the ordering would be CPU_TYPE then generic. There is not gray area. For example, I have an athlon processor, so libgmp.a would have a preferred order of athlon, generic. The question that I don't know the answer to is what happens if someone really screws up and sets CPU_TYPE to 21264 when he has an i386. I suspect that this would break make world, so it will be easily detected. Another possibility would be to specify the preference order in a CPU_ORDER variable. For example, CPU_ORDER="k6,i386,pentium" and always add "generic" has the last target. The major problem with this is that the parsing of CPU_ORDER suggests that you have to generate Makefile on the fly otherwise Makefile would be a big bowl of spaghetti. -- Steve To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message