From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/3889 Path: news.gmane.org!not-for-mail From: Luca Barbato Newsgroups: gmane.linux.lib.musl.general Subject: Re: Build system adjustments for subarchs Date: Wed, 14 Aug 2013 03:42:48 +0200 Message-ID: <520AE098.4010106@gentoo.org> References: <20130814010617.GA16011@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1376444494 10717 80.91.229.3 (14 Aug 2013 01:41:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 14 Aug 2013 01:41:34 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-3893-gllmg-musl=m.gmane.org@lists.openwall.com Wed Aug 14 03:41:36 2013 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 1V9Q5g-0001EI-MR for gllmg-musl@plane.gmane.org; Wed, 14 Aug 2013 03:41:36 +0200 Original-Received: (qmail 9939 invoked by uid 550); 14 Aug 2013 01:41:35 -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 9931 invoked from network); 14 Aug 2013 01:41:35 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130411 Thunderbird/17.0.5 In-Reply-To: <20130814010617.GA16011@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:3889 Archived-At: On 14/08/13 03:06, Rich Felker wrote: > Hi, > > I'm looking for some ideas on a problem in the build system: how to > cleanly share asm between subarchs. The problem is this: ARM, and > possibly other archs in the future, has multiple dimensions of > subarch: little-endian(default) vs big-endian, and > fpu-agnostic(default) vs hardfloat. The asm requirements are: > > - MOST asm is shared by all subarchs. > > - A small amount of asm (for now, just memcpy) is endian-specific but > has nothing to do with floating point ABI. > > - A fairly significant amount of asm in the future will be hard-float > specific (optimized math functions and floating point environment) > but has nothing to do with endianness. > > Until commit 90d77722511ad5e9b748f69f42c5b2a8467fa049, asm was shared > by all subarchs; there was no ability to have subarch-specific > overrides. At least one person (I can't remember who right off) > suggested that instead of more build system logic, we should switch to > preprocessed asm files (.S) so that a single asm file could include > the logic to support all subarchs, but that was not a viable solution, > because what I needed was a way to write asm for one subarch that > doesn't interfere with the fallback C source file getting used for > other subarchs. > > The current system searches for arch-specific asm in this order: > > 1. $(ARCH)$(ASMSUBARCH)/%.s, where ASMSUBARCH for the default subarch > is not blank but rather a unique suffix (for plain arm, it's "el"). > This allows having asm that applies only to the default subarch but > not others. > > 2. $(ARCH)/%.s, for shared asm used by all subarchs. > > 3. %.c, the C fallback (which is empty for code that cannot be > implemented at all in C). > - armel/%.s and armhf/%.s as duplicate files or symlinked > - armhf/%.s and armebhf/%.s as duplicate files or symlinked I'd just explicitly group files by the most selective so ARMEL+=${list of objects that work on el doesn't matter what} ARMHF+=${list of objects that work on hf doesn't matter what} ARMEB+=${list of objects that work on eb doesn't matter what} ARMHFEL+=$(ARMEL) $(ARMHF) ${other stuff} ARMHFEB+=$(ARMEB) $(ARMHF) ${different stuff} OBJS+=$($(targetarch)) And give up on having automagic fallbacks. lu