Starting to cross-compile non-base software for MIPS - what it's like
Warner Losh
imp at bsdimp.com
Mon Jun 15 17:31:21 UTC 2015
> On Jun 15, 2015, at 12:21 AM, Adrian Chadd <adrian at freebsd.org> wrote:
>
> So, for what it's worth - after the relevant hacks to convince the
> various stages to do their thing, I actually /do/ have a user/kernel
> cross-built from gcc-4.9.2 up on both the mips32 emulator (qemu) /and/
> on real hardware (AR9331, MIPS24kc).
>
> The installworld fails because somehow the CROSS_TOOLCHAIN bits aren't
> being included right, so the compiler bits aren't set right. Here,
> COMPILER_TYPE=gcc and COMPILER_VERSION=40902 - with this, MK_GCC is
> set to NO and the legacy c++ library isn't built.
That’s actually correct. From about 4.8 and onward, clang and gcc should
be using the same c++ runtime. Maybe our defaults are a bit messed up,
since libgcov likely shouldn’t be tied to MK_GCC at all… With the clang introduction,
we’ve not always had a good clear line about the different subtle aspects
of clang vs gcc, and this may be one of them.
> There's no compiler built with it though, so until I cross compile a
> compiler package (and cross-compile pkg, grr) getting a compiler
> /into/ the image is going to take some time.
gcc does support the notion of building on host X to generate binaries
that run on host Y that generate code for host Z. But that might be a
bit of a stretch for our system.
> But, it does boot and run fine, and cross-compiled binaries (eg
> dropbear client/server) work fine, as well as crunchgen binaries
> (rescue, bsdbox.)
That’s cool!
Warner
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 842 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.freebsd.org/pipermail/freebsd-embedded/attachments/20150615/d3420a99/attachment.sig>
More information about the freebsd-embedded
mailing list