[Buildroot] libgcc erroneously built as armv5 for arm920t(armv4t)

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Thu Nov 21 16:12:41 UTC 2013


Adam,

On Thu, 21 Nov 2013 08:07:17 -0800 (PST), adam hussein\(!\) wrote:

> >Ok, so that's with a Buildroot internal toolchain. Can you also try to
> >build the kernel with this toolchain to see if it's affected or not by
> >the below problem?
> 
> It was fine, just didn't think to mention it as was an exception of the Sourcery toolchain.

Ok, thanks for the confirmation!

> >In order to ask the assembler to accept these instructions, the
> >following commit was made back in 2008:
> >
>http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/arch/arm/boot/compressed/Makefile?id=80cec14a83ad0ad109d822b3f3482a379bc481ba
> >
> >However, it was reverted recently:
> >
>http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/arch/arm/boot/compressed/Makefile?id=da94a829305f1c217cfdf6771cb1faca0917e3b9
> >
> >I am not sure how this last commit doesn't break your situation.
> 
> Interesting stuff. It's building 2.6.38.6, which benefits only from the first commit.

Ah, interesting.

> >So in other words, you mean that this wouldn't work on the target
> >platform. Hum, weird. Is this a part of U-Boot implemented in assembly,
> >or something compiled from C ?
> 
> Yes indeed. My belief is that _udivsi3 was pulled in with CLZs intact from the libgcc built and distributed with the Sourcery toolchain, rather than rebuilding a 4T arch version for the occasion.
> To be honest, I'm not sure if something like --sysroot can redirect this; I've never thought about it before.

The Sourcery toolchain has 3 sysroot: ARMv4, ARMv5, and ARMv7 Thumb2.
So if the proper -march=armv4t option is passed, it uses the ARMv4
sysroot.

> Sure. Didn't get far off making for the dev board it was based on, aside from memory tweaks to u-boot.
> I'm building the buildroot-2013.08.1 archive with 'make at91rm9200df_defconfig'.
> The u-boot clone is at commit 46ef4faed18196472eb95216b2f74c1397ecf024 from http://git.denx.de/u-boot.git.
> Then:
>     export PATH=$PATH:/data/at91rm9200/buildroot-2013.08.1/output/host/usr/bin/
>     export CROSS_COMPILE=arm-buildroot-linux-uclibcgnueabi-
>     make at91rm9200dvc_ram_config
>     make
> or:
>     export PATH=$PATH:/data/at91rm9200/buildroot-2013.08.1-thomas2/output/host/opt/ext-toolchain/bin/
> accordingly.

This is wrong. For external toolchains, you should *NOT* use the
compiler in host/opt/ext-toolchain/bin, but instead the compiler in
output/host/usr/bin. We create a toolchain wrapper which ensures that
the proper compiler flags are used. If you don't use this toolchain
wrapper, then it cannot work.

Have you been building both the kernel and u-boot outside of Buildroot?
Why not instruct Buildroot to build them instead?

Can you retry the external toolchain case, by using the compiler in
output/host/usr/bin instead?

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com



More information about the buildroot mailing list