From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/7440 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: ppc64 ABI Date: Sun, 19 Apr 2015 11:12:21 -0400 Message-ID: <20150419151221.GO6817@brightrain.aerifal.cx> References: 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 1429456360 28502 80.91.229.3 (19 Apr 2015 15:12:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 19 Apr 2015 15:12:40 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-7453-gllmg-musl=m.gmane.org@lists.openwall.com Sun Apr 19 17:12:39 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1Yjqti-0004aH-RT for gllmg-musl@m.gmane.org; Sun, 19 Apr 2015 17:12:38 +0200 Original-Received: (qmail 19551 invoked by uid 550); 19 Apr 2015 15:12:34 -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 19530 invoked from network); 19 Apr 2015 15:12:33 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:7440 Archived-At: On Sun, Apr 19, 2015 at 12:44:15PM +0100, Justin Cormack wrote: > I am looking at doing a ppc64 port, and after some discussion on irc > last night wondering which ABI to port to. > > ppc64 has two ABIs: > v1: as documented here > http://refspecs.linuxfoundation.org/ELF/ppc64/PPC-elf64abi-1.9.html > Slightly odd, as has function descriptors, so you cant just reference > a function pointer, mainly makes asm code messier as needs a header > for every function. Yeah, I don't think it's as bad as it sounds, but probably mildly ugly and sufficiently gratuitously different from other archs that it might impose new generality requirements in some places in musl. This might be worth looking into. > Traditionally bigendian. Fedora and Gentoo do distros, not sure there > are any others; FreeBSD support also exists. > > v2, usually known as powerpc64le, helpfully. It is not little endian > exclusively, but there are no existing distros that are big endian. > Aim was to make it much closer to a standard ABI, so function pointers > are gone. Do you mean function descriptors? > IBM has been pushing this, and there are RedHat and Ubuntu > releases, targeting POWER8. (Which also means Ubuntu ships with cross > compilers for it). > > I was thinking of doing a v1 port first then v2, partly as I have > little endian only hardware (Apple G5 running Fedora; Fedora has > recently dropped support though; ten years old but dual G5 is still > decent hardware). However maybe I should just skip to v2; I do have > access to hardware. In principal could then produce a bigendian Musl > distro for G5... IBM have been spending a fair amount of time making > sure software works with v2. Unless there's a strong reason (like compatibility with existing code, which won't be much of an issue here) I prefer not to introduce two different ABIs for the same target. If v2 is really that much better I would like to just go with it from the beginning. Having v2 for BE could also be an interesting "first" musl could claim. > Both have 16 byte long double oddness. That needs to be fixed in the toolchain to proceed with either. If there's some chance the hardware will support IEEE quad in the future we should probably leave the size alone and switch it to quad. Otherwise just forcing 8-byte long double with repr matching IEEE double is the simplest (and lightest) solution. Rich