[Clfs-support] Building ARMv6 uClibc-ng cross-compiler

Andrew Bradford andrew at bradfordembedded.com
Mon Nov 21 05:40:56 PST 2016


Hi Michele,

On 11/18 23:38, Michele Bucca wrote:
> Il 18 nov 2016 9:27 PM, "Andrew Bradford"
> <andrew at bradfordembedded.com> ha scritto:
> >
> > Hi Michele,
> >
> > On 11/16 10:08, Michele Bucca wrote:
> > > Hello, I'm trying to build a cross compiler for arm v6 machines  without
> > > float on my computer. Debian 8
> > >
> > > the target I'm trying to use for the build is arm-linux-uclibc but
> > > configure recognises it as arm-unknown-linux-uclibc and gcc does not
> > > recognise as a valid target when I give the command "make"
> >
> > Can you share what the actual build error is?  And does this error from
> > make happen when you're compiling the first pass of GCC or at some other
> > time?
> 
> the  error was gcc-all target not valid during the make process

If you're able to provide the actual error output, that might be
helpful.

> >
> > arm-unknown-linux-uclibc should be a valid triplet according to GCC, as
> > far as I can tell.
> 
> I've used arm-unknown-linux-uclibcgnueabi

I don't believe that's a valid triplet.  The "gnu" part in the last
segment is to indicate glibc, normally.  The "eabi" is to indicate the
newer ABI for ARM, which since you mention you're using Cortex-A53, is
correct for your processor.

Likely you want arm-unknown-linux-uclibceabi as your triplet.

> >
> > What versions of binutils, GCC, and uClibc are you using?
> 
> Gcc 6.2.0
> Binutiils 2.27
> uClibc-ng 1.0.17
> MPC 1.0.3
> GMP 6.1.1
> MPFR 3.1.4
> Linux 4.7.2
> 
> >
> > > There's no book on clfs.org that builds by hand a uclibc toolchain and I
> > > want to learn to build one to compile static software (qemu as a console
> > > command)to run on android. I've already succeeded building qemu statically
> > > with a glibc arm compiler but it does not work well as glibc suck for
> > > static compiling. Can you help me with building GCC? I'm building the first
> > > pass GCC
> >
> > Are you building for a no-mmu system?  If not, are you able to follow
> > the current embedded book using musl libc and compile statically linked
> > executables?
> >
> 
> The CPU that will run the executables is a Qualcomm Snapdragon 400/410
> Architecture ARM Cortex-A53 (revision r0p0)
> I don't know anything else
> 
> GCC is built using --with-arch=armv6 --with-float=soft

Cortex-A53 is armv8-a, it likely will work fine executing armv6 binaries,
but I find it odd that you're trying to do this.  Any reason why you're
not using --with-arch=armv8-a or at least --with-arch=armv7?

Are you trying to match a toolchain given to you by someone else?

> > If you are able to build using musl, then at least it would narrow down
> > the problem to how you're using uClibc.
> 
> On the page below it is shown that QEMU can't be build with musl. I
> know that there are patches out there but I don't want to edit the
> code of the tarball as I want to keep it as intact as possible.
> 
> http://wiki.musl-libc.org/wiki/Pkgsrc_results

In my experience, there are a decent number of packages in pkgsrc which
don't build with musl where the build failure has nothing to do with
musl specifically.  Unless you have specific knowledge of why the pkgsrc
packages aren't building, it's not always good to put full faith in that
test suite.

Sabotage Linux [1] has a qemu package and uses musl, you may look at how
they build it for some tips.

[1]: https://github.com/sabotage-linux/sabotage

> Like now I've installed uClibc, let's hope that anything will go well
> (at least when building the toolchain)
> I wanted to learn how to make this toolchain because all I can find
> about arm uclibc toolchains is the buildroot package that may be
> really neat for what I want to do but it does not let me to study how
> the toolchain is made. To build this thing I'm using multiple sources:
> the clfs-embedded book, the LFS book and sometimes even the CLFS-3.0
> (sysvinit) book.

Buildroot isn't hard to follow if you take a gander through their
Makefiles, or just read through the output during a build.  It takes
some time to parse and understand, but their toolchain when using uClibc
or musl is pretty simple and rather similar to how CLFS does things.

You might also check out crosstool-ng [2] if you want a relatively easy
to use toolchain creator system.

[2]: http://crosstool-ng.org/

> I'll keep you Informed if you wish
> If you have other suggestions or warnings that would be appreciated

I'm happy to help if I can so long as you post your questions to the
clfs-support list.

Thanks,
Andrew



More information about the Clfs-support mailing list