From owner-freebsd-mips@FreeBSD.ORG Tue Oct 21 00:31:11 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 C6614284 for ; Tue, 21 Oct 2014 00:31:11 +0000 (UTC) Received: from isis.morrow.me.uk (isis.morrow.me.uk [204.109.63.142]) by mx1.freebsd.org (Postfix) with ESMTP id A05A4DE for ; Tue, 21 Oct 2014 00:31:11 +0000 (UTC) Received: from anubis.morrow.me.uk (unknown [93.89.81.46]) (Authenticated sender: mauzo) by isis.morrow.me.uk (Postfix) with ESMTPSA id AD5C94508A; Tue, 21 Oct 2014 00:31:10 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.8.3 isis.morrow.me.uk AD5C94508A DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=morrow.me.uk; s=dkim201101; t=1413851470; bh=rSEIYmDwLx4FH3Vn5Rz/ioVOICRpN3mrngzwb2qktnI=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=VeZALGNKRLteXaQiZL5DI254OdDm3FUlA0HZZPJNZUGWLi28KyciFJCDKm3E72oTh uX6VYscSiG6AysDZtNCLOdyBPxQt4CEjACrKtHhH5DKHhlDEOH5HFb2ULiB89Udqij S83v2jq1L7wfJo48IHVmHxEuYcChEOcPK0MLnqtQ= X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.98.4 at isis.morrow.me.uk Received: by anubis.morrow.me.uk (Postfix, from userid 5001) id 19F1215076; Tue, 21 Oct 2014 01:31:09 +0100 (BST) Date: Tue, 21 Oct 2014 01:31:09 +0100 From: Ben Morrow To: Warner Losh Subject: Cross-building mips binaries Message-ID: <20141021003108.GD12023@anubis.morrow.me.uk> References: <20141018225950.GA12023@anubis.morrow.me.uk> <20141019223447.GB12023@anubis.morrow.me.uk> <3A1572B8-1CCE-49FD-BA08-476D0B9D8AB2@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3A1572B8-1CCE-49FD-BA08-476D0B9D8AB2@bsdimp.com> User-Agent: Mutt/1.5.23 (2014-03-12) 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: Tue, 21 Oct 2014 00:31:11 -0000 Warner Losh wrote: > On Oct 19, 2014, at 4:34 PM, Ben Morrow wrote: > > [ mips64 under qemu ] > > > > 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...) > > I’ve 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. 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. 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? Ben