From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/2358 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: Design idea for subarchs/abivariants Date: Wed, 28 Nov 2012 19:10:42 -0500 Message-ID: <20121129001042.GU20323@brightrain.aerifal.cx> References: <20121128192618.GA7491@brightrain.aerifal.cx> <20121128223801.GL10895@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1354147873 21831 80.91.229.3 (29 Nov 2012 00:11:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 29 Nov 2012 00:11:13 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-2359-gllmg-musl=m.gmane.org@lists.openwall.com Thu Nov 29 01:11:25 2012 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1Tdric-0005sk-8S for gllmg-musl@plane.gmane.org; Thu, 29 Nov 2012 01:11:06 +0100 Original-Received: (qmail 7943 invoked by uid 550); 29 Nov 2012 00:10:54 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 7935 invoked from network); 29 Nov 2012 00:10:54 -0000 Content-Disposition: inline In-Reply-To: <20121128223801.GL10895@port70.net> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:2358 Archived-At: On Wed, Nov 28, 2012 at 11:38:02PM +0100, Szabolcs Nagy wrote: > * Rich Felker [2012-11-28 14:26:18 -0500]: > > 2. Making bits/endian.h, bits/fenv.h, and any other bits headers that > > need to vary per-subarch into generated headers. I think this could be > > accomplished with a single rule for generating bits/%.h from > > bits/%.h.sh the way alltypes.h is generated now. The full > > $(ARCH)$(ENDIAN)$(SUBARCH) could be passed to the script as $1, > > allowing simple shell logic to choose the right version to output. > > i'm not sure about having many generated headers.. > > it could be a single generated bits/config.h with > > #define __FPU 1 > #define __BYTEORDER 1234 > > and other bits/*.h could use these macros Yes, I thought about this too and even started writing the email that way before deleting what I wrote and rewriting it. I was trying to avoid more nested and conditional inclusion, but I don't think it would actually be too costly to do it the way you proposed. > this way the generator is probably simpler, > the drawback is that the cpp may need to do more > work if bits/*.h have many conditional #if __FPU etc I would at least use macro names that are less likely to conflict with things a compiler might predefine. Rich