-march bug when building kernel
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
binutils |
Fix Released
|
Medium
|
|||
armel-cross-toolchain-base (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Hi,
Just tried to compile linaro kernel with linaro toolchain (up to date) and ended up with something like:
arch/arm/
arch/arm/
arch/arm/
arch/arm/
make[2]: *** [arch/arm/
make[2]: *** Attente des tâches non terminées....
make[1]: *** [arch/arm/
make: *** [uImage] Erreur 2
My machine:
Description: Ubuntu 10.04.4 LTS
Release: 10.04
uname -a
Linux ferre-desktop 2.6.38-13-generic #54~lucid1-Ubuntu SMP Wed Jan 4 13:00:37 UTC 2012 x86_64 GNU/Linux
Used linux-linaro-3.1 kernel.
To fix it pm215 from the linaro irc channel told me to comment out the
asflags-y := -Wa,-march=all
part in the file arch/arm/
affects: | ubuntu → armel-cross-toolchain-base (Ubuntu) |
Changed in armel-cross-toolchain-base (Ubuntu): | |
status: | New → Confirmed |
Changed in binutils: | |
importance: | Unknown → Medium |
status: | Unknown → Fix Released |
Changed in armel-cross-toolchain-base (Ubuntu): | |
status: | Confirmed → Invalid |
Changed in binutils: | |
status: | Fix Released → Confirmed |
Changed in binutils: | |
status: | Confirmed → Fix Released |
As noticed by debian bug 623964, when building an arm kernel with a snasphot made on 04/19, compiling head.S is failing with :
Error: selected processor does not support requested special purpose register -- `mrs r2,cpsr'
It's valid for current head.
To reproduce, create a head.S containing:
mrs r2, cpsr
msr cpsr_c, r2
And then build with ./gas/as-new -march=all -c head.S -o head.o
I believe it's due to this commit : sourceware. org/git/ ?p=binutils. git;a=commitdif f;h=335cd491563 02284cea0438fd0 68f0a7cc11355a
http://
I've written this workaround:
--- binutils. orig/gas/ config/ tc-arm. c gas/config/ tc-arm. c
+++ binutils/
@@ -5356,6 +5356,11 @@ parse_psr (char **str, bfd_boolean lhs)
bfd_boolean is_apsr = FALSE;
bfd_boolean m_profile = ARM_CPU_HAS_FEATURE (selected_cpu, arm_ext_m);
+ /* march=all, will match the m_profile case too, so things like 'mrs r2,cpsr'
+ * will now fail. Workaround by saying it's not a m profile */
+ if (selected_cpu.core == arm_arch_any.core)
+ m_profile = FALSE;
+
/* CPSR's and SPSR's can now be lowercase. This is just a convenience
feature for ease of use and backwards compatibility. */
p = *str;
It doesn't seem to create any regression but I'm not sure how good is this patch. At least, I hope it'll help fixing the bug.