crosstool-NG build fails due to unsupported ARM mode


9 posts
by maf » Sun Mar 16, 2014 6:35 pm
Hello!

I've been trying to build my own toolchain with crosstool-NG, following as closely as possible the configuration suggested in Build GCC Linaro in the eLinux.org wiki. The article suggests quite a number of specific target options in addition to the target architecture, e.g. setting the "Architecture level" to "armv6zk" and setting "Tune for CPU" to "arm1176jzf-s". My build host runs a vanilla Debian wheezy with gcc 4.7.2.

The build fails in step 'Installing C library' due to some unspported ARM modes:
Code: Select all
[INFO ]  Installing C library
[DEBUG]    Entering '/home/malte/ct-ng/.build/arm-rpi-linux-gnueabihf/build/build-libc-final'
[EXTRA]    Configuring C library
[DEBUG]    Using gcc for target    : '/home/malte/ct-ng/.build/arm-rpi-linux-gnueabihf/buildtools/bin/arm-rpi-linux-gnueabihf-gcc'
[DEBUG]    Configuring with addons : 'nptl,ports'
[DEBUG]    Extra config args passed: '--enable-obsolete-rpc --enable-kernel=3.10.2 --with-__thread --with-tls --enable-shared --with-fp --enable-add-ons=nptl,ports --with-pkgversion=crosstool-NG 1.19.0'
[DEBUG]    Extra CC args passed    : ' -U_FORTIFY_SOURCE  -mlittle-endian -march=armv6zk  -mcpu=arm1176jzf-s -mtune=arm1176jzf-s -mfpu=vfp -mhard-float  -O2 '
[DEBUG]    Extra flags (multilib)  : ''
[DEBUG]    ==> Executing: 'BUILD_CC=i686-build_pc-linux-gnu-gcc' 'CFLAGS= -U_FORTIFY_SOURCE  -mlittle-endian -march=armv6zk  -mcpu=arm1176jzf-s -mtune=arm1176jzf-s -mfpu=vfp -mhard-float  -O2 ' 'CC=arm-rpi-linux-gnueabihf-gcc    ' 'AR=arm-rpi-linux-gnueabihf-ar' 'RANLIB=arm-rpi-linux-gnueabihf-ranlib' '/bin/bash' '/home/malte/ct-ng/.build/src/eglibc-2_13/configure' '--prefix=/usr' '--build=i686-build_pc-linux-gnu' '--host=arm-rpi-linux-gnueabihf' '--cache-file=/home/malte/ct-ng/.build/arm-rpi-linux-gnueabihf/build/build-libc-final/config.cache' '--without-cvs' '--disable-profile' '--without-gd' '--with-headers=/home/malte/crosscompile/arm-rpi-linux-gnueabihf/sysroot/usr/include' '--enable-obsolete-rpc' '--enable-kernel=3.10.2' '--with-__thread' '--with-tls' '--enable-shared' '--with-fp' '--enable-add-ons=nptl,ports' '--with-pkgversion=crosstool-NG 1.19.0'
...
[ALL  ]    arm-rpi-linux-gnueabihf-gcc     setfpucw.c -c -std=gnu99 -fgnu89-inline -O2 -U_FORTIFY_SOURCE -Wall -Winline -Wwrite-strings -fmerge-all-constants -march=armv6zk -mcpu=arm1176jzf-s -mfpu=vfp -mhard-float -mlittle-endian -mtune=arm1176jzf-s -Wstrict-prototypes     -Wno-uninitialized -D__NO_MATH_INLINES -D__LIBC_INTERNAL_MATH_INLINES -DNO_LONG_DOUBLE -D_Mlong_double_=double -I../include -I/home/malte/ct-ng/.build/arm-rpi-linux-gnueabihf/build/build-libc-final/math -I/home/malte/ct-ng/.build/arm-rpi-linux-gnueabihf/build/build-libc-final -I../ports/sysdeps/arm/elf -I../ports/sysdeps/unix/sysv/linux/arm/nptl -I../ports/sysdeps/unix/sysv/linux/arm -I../nptl/sysdeps/unix/sysv/linux -I../nptl/sysdeps/pthread -I../sysdeps/pthread -I../ports/sysdeps/unix/sysv/linux -I../sysdeps/unix/sysv/linux -I../sysdeps/gnu -I../sysdeps/unix/common -I../sysdeps/unix/mman -I../sysdeps/unix/inet -I../nptl/sysdeps/unix/sysv -I../ports/sysdeps/unix/sysv -I../sysdeps/unix/sysv -I../ports/sysdeps/unix/arm -I../nptl/sysdeps/unix -I../ports/sysdeps/unix -I../sysdeps/unix -I../sysdeps/posix -I../ports/sysdeps/arm/fpu -I../ports/sysdeps/arm/nptl -I../ports/sysdeps/arm -I../sysdeps/wordsize-32 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754 -I../sysdeps/generic/elf -I../sysdeps/generic -I../nptl -I../ports  -I.. -I../libio -I. -nostdinc -isystem /home/malte/ct-ng/.build/arm-rpi-linux-gnueabihf/buildtools/lib/gcc/arm-rpi-linux-gnueabihf/4.7.4/include -isystem /home/malte/ct-ng/.build/arm-rpi-linux-gnueabihf/buildtools/lib/gcc/arm-rpi-linux-gnueabihf/4.7.4/include-fixed -isystem /home/malte/crosscompile/arm-rpi-linux-gnueabihf/sysroot/usr/include -D_LIBC_REENTRANT -include ../include/libc-symbols.h       -o /home/malte/ct-ng/.build/arm-rpi-linux-gnueabihf/build/build-libc-final/math/setfpucw.o -MD -MP -MF /home/malte/ct-ng/.build/arm-rpi-linux-gnueabihf/build/build-libc-final/math/setfpucw.o.dt -MT /home/malte/ct-ng/.build/arm-rpi-linux-gnueabihf/build/build-libc-final/math/setfpucw.o
[ALL  ]    /tmp/ccK6MbmW.s: Assembler messages:
[ALL  ]    /tmp/ccK6MbmW.s:27: Error: selected processor does not support ARM mode `rfs r1'
[ALL  ]    /tmp/ccK6MbmW.s:34: Error: selected processor does not support ARM mode `wfs r3'
[ERROR]    make[3]: *** [/home/malte/ct-ng/.build/arm-rpi-linux-gnueabihf/build/build-libc-final/math/setfpucw.o] Error 1

Could anyone tell me how I can avoid that error?

Thanks in advance,
Malte
Posts: 10
Joined: Sun Mar 16, 2014 3:31 pm
by bust » Mon Mar 17, 2014 2:54 am
Hi
I do not use crossed compile and I am not expert on this side but i have read here at:
http://elinux.org/RPi_Kernel_Compilation
chapter (2. Cross compiling from Linux)
He seems that this model precise of the (ARM11 family) will not work with cross method.
I know that native compile is very very slow.
Personally I built the source of GCC 4.8.2 but the time to compile is not reduced.
Only after compile source of binutils-2.24 and adding (ccache) it's now little more speeded.
((as, ar ,ld ) work also now asynchronous with using --jobs=X)
Regards
Posts: 66
Joined: Mon Mar 17, 2014 12:31 am
by maf » Mon Mar 17, 2014 12:27 pm
Thanks, bust, but I'm afraid I don't understand what you are suggesting.

The page RPi Linaro GCC Compilation I used is directly linked to from the wiki page you are referring to in the section "Custom-built Linaro GCC". The configuration is meant for a cross compiler specifically for the Raspberry Pi.

I'm not sure what you think might not be suitable for processors from the ARM11 family.
Posts: 10
Joined: Sun Mar 16, 2014 3:31 pm
by bust » Mon Mar 17, 2014 3:10 pm
Hi
I have read your link, I see this tools is able to use precise flag arm1176jzf-s
I don't use the cross tools ,i have rebuilt practically all the system Raspbian.
Now I built all programming on system Raspbian natively but i will download this tools
at the link that you give and verify result (-mfpu=vfp -mfloat-abi=hard thumb-interwork etc ...) between
two side (native my 4.8.2 and with this cross tools).
It will be well experience for me with verify if he really able to differentiate an model precise of ARM11 family.
I have the doubts that it's will be true.
I have already built native MesaLib-10.1.0 with libdrm on my 4.8.2 with i will verify his side assembler.
Regards
Posts: 66
Joined: Mon Mar 17, 2014 12:31 am
by bust » Tue Mar 18, 2014 1:06 am
Hi
Last news
I have built last versions NG 1.19.0 without problem (Debian Wheezy (64) computer hosting Haswell model processor) compiler 4.8.2
but for his file .config generated by utility (ct-ng menuconfig) it's unable to list compiler 4.8.2 ,last is 4.81 ???
also last binutils is 2.22 , (I have 2.24)
Better i made test later on an new install Wheezy native without any rebuilt compiler ,binutils, mpc etc ...
I will be happy to find how to build with less of time if it's possible to obtain same result that when i built natively on raspberry.

(Sorry, for my bad English practiced)
Regards
Posts: 66
Joined: Mon Mar 17, 2014 12:31 am
by maf » Tue Mar 18, 2014 7:55 am
I'm also using crosstool-NG 1.19.0. I've been trying to build gcc version linaro-4.7-2013.06-1 with eglibc 2.13. That compiler versions seems to be the closest match availabe in ct-ng 1.19.0 to the version linaro-4.7-2012.10 specified on the eLinux wiki page.
Posts: 10
Joined: Sun Mar 16, 2014 3:31 pm
by Zenki » Sat Mar 29, 2014 12:18 pm
Got the same problem. After some hours in google ,but no resolution...Help~Thanks
pkg info:
binutils-2.22
gcc-4.6.3
glibc-2.13
Code: Select all
-march=armv6zk -mcpu=arm1176jzf-s -mfloat-abi=hard -mfpu=vfp -mtune=arm1176jzf-s

while building glibc , got:
Code: Select all
/tmp/ccojjZlG.s: Assembler messages:
/tmp/ccojjZlG.s:26: Error: selected processor does not support ARM mode `rfs r1'
/tmp/ccojjZlG.s:33: Error: selected processor does not support ARM mode `wfs r3'
make[2]: *** [/home/zenki/arm_raspberry/build_tools/build_glibc/math/setfpucw.o] Error 1

PS: Does not use CrossNG~~,build cross tool manually~
Arm1176jzf-s dose have the hardware fpu? it should not be a problem,,,, :evil:
Posts: 3
Joined: Mon Feb 24, 2014 2:23 am
by Zenki » Sun Mar 30, 2014 2:29 am
I think i foud the solution. ld.so is different in arm hard-float while compiling gcc~~
this is the patch:
https://github.com/epi/rpi-gcc/tree/master/debian/patches
and some discussions here:
https://www.sourceware.org/ml/libc-alpha/2012-05/msg00222.html
Posts: 3
Joined: Mon Feb 24, 2014 2:23 am
by maf » Wed Apr 02, 2014 8:56 pm
While the patch you're referring to did not solve the problem here, it helped me find another patch (for eglibc-ports 2.13) that did. I'm attaching it here as a patch for crosstool-NG 1.19.0. Later versions of eglibc-ports already include that patch.

Thanks for your help,
Malte
Attachments
preconfigure-ports-arm-gnueabihf.patch.gz
(342 Bytes) Downloaded 362 times
Posts: 10
Joined: Sun Mar 16, 2014 3:31 pm