Starting to cross-compile non-base software for MIPS - what it's like

Adrian Chadd adrian at freebsd.org
Mon Jun 15 18:39:37 UTC 2015


On 15 June 2015 at 10:31, Warner Losh <imp at bsdimp.com> wrote:
>
>> 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.

*nod* so,, I agree with all of that, but the above is the result, not the cause.

make buildworld uses CROSS_TOOLCHAIN for the gcc config and cascades
things correctly.
make installworld doesn't seem to use CROSS_TOOLCHAIN everywhere, and
it defaults to assuming we're building with gcc, and thus MK_GCC=yes,
and it tries installing non-built things.
If I manually set the COMPILER_TYPE / COMPILER_VERSION variables then
things work out.

I /think/ that's broken behaviour, so I'm going to check first with
bapt to see what's supposed to happen and see what we can do to sort
that out.


-a


More information about the freebsd-mips mailing list