[mkroot] Fwd: Re: About mkroot compiling

Rob Landley rob at landley.net
Mon May 8 16:42:53 PDT 2017


And permission to forward answers to the list granted. :)

On 05/07/2017 02:24 AM, tgrauss wrote:
> Hello,
> 
> I am part of the tinkerphone smartphone community (we are trying to
> build a free smartphone : http://www.tinkerphones.org).
> I am trying to build a small Linux with the qtmoko stack to be embedded
> in the 512MB of Flash we have on the gta04a5 phone. The CPU is a Cortex
> A8 which is an armv7-a

I just checked in simple armv7l kernel support last night. :)

> Thanks to your mkroot tool and explanations, I was able to build
> crosscompilers :) Well, it is strange that there is no armv7-a
> toolchain, but a armv7l. It seems to be the same from what I can find on
> internet...

Yup, armv7l.

> Nevertheless, I tried with a simple system first and typed the
> following:
> CROSS_COMPILE=~/mcm/output/armv7l-linux-musleabihf-cross/bin/armv7l-linux-musleabihf-
> ./mkroot.sh kernel
> 
> And the system compiles fine up to when it tried to compile the Linux
> kernel where there is an error message:
> linux-4.11.tar.gz confirmed
> Unknown $TARGET

That would be the "I just checked in armv7l support last night" part. :)

Coming up with kernel configurations that run under qemu for the various
architectures is time consuming. The main build is architecture-agnostic
(it builds whatever your cross compiler outputs), but the kernel cares
about architecture, so module/kernel has a big if/else staircase of
recognized architectures and sets stuff for each one.

> So, based on your website, I tried to force the ARCH variable, but with
> the same error.
> 
> Do you know what is happening here?

Yeah, it had armv5 but not armv7. And the armv5 that was checked in
booted to a shell prompt but didn't have the emulated network card or
hard drives working (drivers weren't configured right). And the armv7
support is -M versatilepb when armv7 needs -M vexpress (do
"qemu-system-arm -M ?" to see the list), except the one I actually got
_working_ was -M virt.

I'm writing blog entries about it and trying to get
https://landley.net/notes-2017.html caught up to current.

> I have another questions also:
> - With your script, what is the best way to specify other fine compile
> tuning parameters? Like the type of fpu: vfpv3 or the "-mthumb" option
> and others?

Personally I hardwire those into the cross compilers I build so it's
producing the right output for the target without flags. That said, most
packages honor the $CFLAGS environment variable, and some do $LDFLAGS as
well.

> Thank you
> 
> Best regards
> 
> Thierry GRAUSS
> 

Rob


More information about the mkroot mailing list