From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/5531 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: How to build a musl toolchain for or1k Date: Sat, 19 Jul 2014 19:06:56 -0400 Message-ID: <20140719230655.GG17402@brightrain.aerifal.cx> References: <20140719222628.GA19901@chokladfabriken.org> 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 1405811250 14196 80.91.229.3 (19 Jul 2014 23:07:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 19 Jul 2014 23:07:30 +0000 (UTC) Cc: musl@lists.openwall.com To: Stefan Kristiansson Original-X-From: musl-return-5536-gllmg-musl=m.gmane.org@lists.openwall.com Sun Jul 20 01:07:25 2014 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 1X8dio-0007zk-Lg for gllmg-musl@plane.gmane.org; Sun, 20 Jul 2014 01:07:18 +0200 Original-Received: (qmail 5453 invoked by uid 550); 19 Jul 2014 23:07:17 -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 5445 invoked from network); 19 Jul 2014 23:07:17 -0000 Content-Disposition: inline In-Reply-To: <20140719222628.GA19901@chokladfabriken.org> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:5531 Archived-At: On Sun, Jul 20, 2014 at 01:26:29AM +0300, Stefan Kristiansson wrote: > Now when or1k support has landed in musl, I thought I'd take the opportunity to > give some notes on how to build a toolchain for it (and also, Rich asked me to). Thanks! > And some notes about emulators and kernel for or1k. > There's support in qemu for or1k, but the atomic instructions required for musl > has not yet been added to that, but we have a functional simulator (or1ksim) > with support for them. > > git clone -b or1k-master git://github.com/openrisc/or1ksim.git > ../configure --target=or1k-elf > make && make install > > Mainline kernel is missing support for a couple of features required > by musl (mostly related to the atomic instructions). I've added > support for them, but sending out patches for them is yet to be done. > In the meantime, they are all present in the smp branch of > git://openrisc.net/stefan/linux. What kernel features are needed for atomics to work? I figured it was mainly a cpu-level issue. Or were changes needed for the kernel to properly clear the lwa/swa flag on context switch? It would be really nice if the kernel could also trap and emulate l.lwa/l.swa and perhaps also l.msync so that these features could be used on old emulators/hardware that lack them. > git clone -b smp git://openrisc.net/stefan/linux > make ARCH=openrisc musl_defconfig > make ARCH=openrisc What's special in musl_defconfig? :) > This became pretty lengthy, but if nothing else, now I've got some > instructions in a public place to point people to. =P Indeed. It sounds like it's still enough work that I won't setup an environment yet (I've got lots of other things I'm trying to finish including getting the next musl release out on schedule this month) but I'm looking forward to having a setup (perhaps musl-cross binaries, Gregor? :) to try it out in the future. Rich