From owner-freebsd-mips@FreeBSD.ORG Wed Oct 22 22:27:52 2014 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E23CE23D for ; Wed, 22 Oct 2014 22:27:52 +0000 (UTC) Received: from st11p01mm-asmtp001.mac.com (st11p01mm-asmtp001.mac.com [17.172.204.239]) (using TLSv1 with cipher DES-CBC3-SHA (112/168 bits)) (Client CN "smtp.me.com", Issuer "VeriSign Class 3 Extended Validation SSL SGC CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B1E98CCD for ; Wed, 22 Oct 2014 22:27:52 +0000 (UTC) Received: from [192.168.0.39] (cpe-76-187-139-93.tx.res.rr.com [76.187.139.93]) by st11p01mm-asmtp001.mac.com (Oracle Communications Messaging Server 7u4-27.10(7.0.4.27.9) 64bit (built Jun 6 2014)) with ESMTPSA id <0NDV005VC7LRLEA0@st11p01mm-asmtp001.mac.com> for freebsd-mips@freebsd.org; Wed, 22 Oct 2014 21:27:28 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.12.52,1.0.28,0.0.0000 definitions=2014-10-22_07:2014-10-22,2014-10-22,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1408290000 definitions=main-1410220199 Subject: Re: Cross-building mips binaries MIME-version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Content-type: text/plain; charset=windows-1252 From: Stacey Son In-reply-to: <20141021003108.GD12023@anubis.morrow.me.uk> Date: Wed, 22 Oct 2014 16:27:26 -0500 Content-transfer-encoding: quoted-printable Message-id: <313C0AC8-309A-452C-9EA2-227746BD524B@me.com> References: <20141018225950.GA12023@anubis.morrow.me.uk> <20141019223447.GB12023@anubis.morrow.me.uk> <3A1572B8-1CCE-49FD-BA08-476D0B9D8AB2@bsdimp.com> <20141021003108.GD12023@anubis.morrow.me.uk> To: Ben Morrow X-Mailer: Apple Mail (2.1878.6) Cc: freebsd-mips@freebsd.org X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2014 22:27:53 -0000 On Oct 20, 2014, at 7:31 PM, Ben Morrow wrote: > Warner Losh wrote: >> On Oct 19, 2014, at 4:34 PM, Ben Morrow wrote: >>>=20 > [ mips64 under qemu ] >>>=20 >>> Thank you, that works. (Good God, it's slow... I wonder how hard it >>> would be to replace cc with something that runs a cross-compiler on = the >>> host? Maybe I can do something with distcc...) >>=20 >> I=92ve been helping Sean Bruno do exactly this, but I think for = mips32. >> You build a chroot with the full world, then you build x86 binaries = to >> produce mips32/64 output and replace the cc, et al, in the chroot = with >> those. Makes things quite a bit faster. Still not quite as fast as a >> full native cross build, but much faster than pure user mode and more >> reliable than the current state of the art in cross building. >=20 > This is a huge improvement (thank you to Juli and Alexander for = pointing > me in the direction of qemu-user-static). I've now got a poudriere = jail > with a mips64 world, amd64->mips64 cross-tools and imgact_binmisc to > invoke the emulator, and after a bit of fuss setting up the jail it = all > appears to Just Work. >=20 > The new time hog seems to be xz and bz2 untarring distfiles and = building > packages. Presumably a static amd64 tar binary would work without > problems; does anyone know if there are endianness issues with sqlite > which would upset an amd64 pkg-static binary? Hi Ben, I have used an amd64 pkg-static to create indexes and such for = FreeBSD/mips64 packages. =20 With the impact_binmisc kernel module you can add statically linked = amd64 binaries and the kernel will run them natively. /rescue is a = good source for these (e.g. tar). Also, there are some of my (and others) notes at = https://wiki.freebsd.org/QemuUserModeHowTo for the simple chroot case = but also apply as well to a poudriere jail. Best Regards, -stacey.=