On Sun, Aug 21, 2011 at 7:54 PM, Nicolas Pitre nicolas.pitre@linaro.org wrote:
On Sun, 21 Aug 2011, John Rigby wrote:
I'm having trouble building the Thumb2 kernel on, I actually believe this same code worked some time ago before a toolchain update. There are actually two problems described below. I get past the first with a config change but don't know how to fix the second one.
[...]
AS arch/arm/boot/compressed/head.o arch/arm/boot/compressed/head.S: Assembler messages: arch/arm/boot/compressed/head.S:127: Error: selected processor does not support requested special purpose register -- `mrs r2,cpsr' arch/arm/boot/compressed/head.S:134: Error: selected processor does not support requested special purpose register -- `mrs r2,cpsr' arch/arm/boot/compressed/head.S:136: Error: selected processor does not support requested special purpose register -- `msr cpsr_c,r2' make[2]: *** [arch/arm/boot/compressed/head.o] Error 1 make[1]: *** [arch/arm/boot/compressed/vmlinux] Error 2 make: *** [uImage] Error 2
Here is my gcc version:
$ arm-linux-gnueabi-gcc --version arm-linux-gnueabi-gcc (Ubuntu/Linaro 4.6.1-5ubuntu2~ppa1) 4.6.1 Copyright (C) 2011 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
And as version: GNU assembler (GNU Binutils for Ubuntu) 2.21.52.20110707 Copyright 2011 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License version 3 or later. This program has absolutely no warranty. This assembler was configured for a target of `arm-linux-gnueabi'.
Looks to me like your assembler is broken, or gcc is not properly telling it about the actual architecture in use.
To confirm, please try this:
echo -e ".arch armv7-a\n.thumb\nmrs r2, cpsr" | \ arm-linux-gnueabi-as - -o /dev/null
If that works then your assembler is fine. In that case the following should fail:
echo -e ".thumb\nmrs r2, cpsr" | \ arm-linux-gnueabi-gcc -march=armv7-a -x assembler -o /dev/null -c -
If for some reasons this works too, then the kernel build might be wrong. In that case, see the output of:
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- V=1 \ arch/arm/boot/compressed/head.o
I have: arm-linux-gnueabi-gcc (Ubuntu/Linaro 4.5.2-8ubuntu3) 4.5.2 GNU assembler (GNU Binutils for Ubuntu) 2.21.0.20110327 And that works for me just fine.
Thanks for the info, just before reading your response I found this problem in GNU assembler when you say -march=all:
http://sourceware.org/bugzilla/show_bug.cgi?id=12698
I have a workaround now by setting in -march=armv7-a in arch/arm/boot/compressed/Makefile instead of -march=all.
Meanwhile Ricardo is working on a fix to binutils in a ppa.
--john