Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Oct 2014 16:27:26 -0500
From:      Stacey Son <sson@me.com>
To:        Ben Morrow <ben@morrow.me.uk>
Cc:        freebsd-mips@freebsd.org
Subject:   Re: Cross-building mips binaries
Message-ID:  <313C0AC8-309A-452C-9EA2-227746BD524B@me.com>
In-Reply-To: <20141021003108.GD12023@anubis.morrow.me.uk>
References:  <20141018225950.GA12023@anubis.morrow.me.uk> <CAJ-Vmon5yFb7z5gDAZ4StAOY%2B05dBjd8w9u1PWZHR_ihynk9Ow@mail.gmail.com> <20141019223447.GB12023@anubis.morrow.me.uk> <3A1572B8-1CCE-49FD-BA08-476D0B9D8AB2@bsdimp.com> <20141021003108.GD12023@anubis.morrow.me.uk>

next in thread | previous in thread | raw e-mail | index | archive | help

On Oct 20, 2014, at 7:31 PM, Ben Morrow <ben@morrow.me.uk> wrote:

> Warner Losh <imp@bsdimp.com> wrote:
>> On Oct 19, 2014, at 4:34 PM, Ben Morrow <ben@morrow.me.uk> 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.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?313C0AC8-309A-452C-9EA2-227746BD524B>