From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/11601 Path: news.gmane.org!.POSTED!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] powerpc64le: Add single instruction math functions Date: Sat, 24 Jun 2017 18:44:06 -0400 Message-ID: <20170624224406.GZ1627@brightrain.aerifal.cx> References: <20170623193533.GO1627@brightrain.aerifal.cx> <594DB66E.7030009@adelielinux.org> <594DDEC6.8030200@adelielinux.org> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1498344259 1932 195.159.176.226 (24 Jun 2017 22:44:19 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 24 Jun 2017 22:44:19 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) To: musl@lists.openwall.com Original-X-From: musl-return-11614-gllmg-musl=m.gmane.org@lists.openwall.com Sun Jun 25 00:44:15 2017 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1dOtmp-0000Gc-AQ for gllmg-musl@m.gmane.org; Sun, 25 Jun 2017 00:44:15 +0200 Original-Received: (qmail 15937 invoked by uid 550); 24 Jun 2017 22:44:18 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 15910 invoked from network); 24 Jun 2017 22:44:17 -0000 Content-Disposition: inline In-Reply-To: Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:11601 Archived-At: On Sat, Jun 24, 2017 at 04:53:58PM -0400, David Edelsohn wrote: > On Fri, Jun 23, 2017 at 11:38 PM, A. Wilcox wrote: > > -----BEGIN PGP SIGNED MESSAGE----- > > Hash: SHA256 > > > > On 23/06/17 22:05, David Edelsohn wrote: > >> Note that I only added the optimizations to the "powerpc64" port, > >> not the "powerpc" port. The powerpc64 port only support PPC64LE > >> Linux, which does not include PPC970. The comments about emulation > >> are not relevant to the "powerpc64" port. > > > > On 23/06/17 14:35, Rich Felker wrote: > >> Indeed, musl uses the ELFv2 ABI (minus its gratuitous mandate of > >> minimum ISA level) for both little and big endian powerpc64, and I > >> think we have users of both (people running it on old powerbooks, > >> etc.). > > The ABIs are not endian-specific. ELFv1 can operate as little endian > (and did for a brief period as a transition), ELFv2 can operate as big > endian. PowerPC64 Linux only will be 64 bit little endian going > forward, although the existing big endian, ELFv1 Linux distributions > will continue to be supported. There is no infrastructure or > distribution into which a PPC64BE ELFv2 libc can be installed. Any distro that builds from source and uses musl should work. I suspect Sabotage can do it. Rob Landley's minimal mkroot builds should also get you a system you can boot. > A PPC64 big endian ELFv2 port is an interesting exercise, but does not > match or interact with any other Linux distributions or toolchains. That's already the case if you're using musl anyway, and part of why the decision made sense. > All of the PPC64 BE Linux ports are based on ELFv1 and have no > intention of changing. I think the kernel simply supports both ELFv1 and ELFv2 userspace anyway and doesn't care what binaries you run, though I didn't check. The only place where it could care anyway is the function pointers used for signal handlers. > > Are you aware of any little-endian specific code in musl/powerpc64? I > > assume that libc-test would probably catch most of it when I am able > > to run it, but until then, it would be nice to know if there is > > anything I need to work on in the meantime. > > The PPC64 port of Musl does not assume little endian addressing, but > Musl currently only supports ELFv2. All of the toolchains and > operating systems that support ELFv2 are little endian. All of the > big endian toolchains and operating systems are designed for ELFv1. > There is no overlap. git clone https://github.com/richfelker/musl-cross-make.git \ && cd musl-cross-make && make TARGET=powerpc64-linux-musl There are no patches needed for the ABI to work, just --with-abi=elfv2 which musl-cross-make always uses for ppc64. qemu-ppc64 (user level) runs the binaries it produces just fine. I don't have actual hardware or a kernel for system emulation handy but I don't see any reason to expect it not to work. > I added the macro tests for portability and completeness. > > The only ports of Musl that will function on existing, supported, > big-endian PowerPC systems are the 32 bit "powerpc" port and an > unimplemented PPC64 BE ELFv1 port. I guess "supported" is the key word here, in particular whose perspective you're asking that something be supported from. Rich