natty gcc-4.5 kernel (2.6.37-rc1) build failure

Bug #669912 reported by Robert Nelson
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
gcc-4.5 (Ubuntu)
Invalid
Undecided
Unassigned
linux (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: gcc-4.5

On Natty, I'm seeing build failure of the Linux Kernel, where i wasn't seeing them on Maverick, I can't replicate the issue with the maverick x86 gcc-4.5 armel cross compiler in the maverick repo..

Full logs of my builds: http://rcn-ee.homeip.net:81/dl/farm/log/

Natty usually fails with:

arch/arm/mach-omap2/omap-headsmp.S: Assembler messages:
arch/arm/mach-omap2/omap-headsmp.S:36: Error: selected processor does not support ARM mode `smc #0'
make[3]: *** [arch/arm/mach-omap2/omap-headsmp.o] Error 1
make[2]: *** [arch/arm/mach-omap2] Error 2
make[2]: *** Waiting for unfinished jobs....

To replicate, in either a natty chroot or running on an armv7 target board:

With the latest 2.6.37-rc1 tar

make ARCH=arm CROSS_COMPILE= omap2plus_defconfig

make ARCH=arm CROSS_COMPILE= menuconfig

then drop omap2/armv6 support, now only omap3/4/armv7-a enabled

System Type -> TI OMAP2/3/4 Specific Features -> (uncheck omap2)

Otherwise config: http://pastebin.com/WHy9RrqS

make ARCH=arm CROSS_COMPILE= uImage

Error:

  CC arch/arm/mach-omap2/omap-smp.o
  AS arch/arm/mach-omap2/omap-headsmp.o
arch/arm/mach-omap2/omap-headsmp.S: Assembler messages:
arch/arm/mach-omap2/omap-headsmp.S:36: Error: selected processor does not support ARM mode `smc #0'
make[1]: *** [arch/arm/mach-omap2/omap-headsmp.o] Error 1
make: *** [arch/arm/mach-omap2] Error 2

full build log: http://pastebin.com/cTWaxbwg

From http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=arch/arm/mach-omap2/Makefile;h=60e51bcf53bd2e053a384826d45ac760eb30588d;hb=HEAD#l29

AFLag settings: :=-Wa,-march=armv7-a

GCC:
voodoo@beagle-256mb-1:~/omap4-kernel/linux-2.6.37-rc1$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabi/4.5.1/lto-wrapper
Target: arm-linux-gnueabi
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.5.1-9ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.5/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.5 --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.5 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin --enable-objc-gc --disable-sjlj-exceptions --with-arch=armv7-a --with-float=softfp --with-fpu=vfpv3-d16 --with-mode=thumb --disable-werror --enable-checking=release --build=arm-linux-gnueabi --host=arm-linux-gnueabi --target=arm-linux-gnueabi
Thread model: posix
gcc version 4.5.1 (Ubuntu/Linaro 4.5.1-9ubuntu1)

description: updated
Revision history for this message
Matthias Klose (doko) wrote :

that might be related to bug #673085, however somebody did tell me that the kernel builds with
-Wa,-mimplicit-it=thumb by default.

Revision history for this message
Robert Nelson (robertcnelson) wrote :

Hi Matthias,

Thank you for taking some time to look at this..

Versions:
gcc-4.5: gcc version 4.5.1 (Ubuntu/Linaro 4.5.1-9ubuntu1)
gcc-4.4: gcc version 4.4.5 (Ubuntu/Linaro 4.4.5-7ubuntu1)
as: GNU assembler version 2.20.90

So grepping the (arch/arm/Makfile) there's one occurance of 'mimplicit-it', and it's in the "build kernel in thumb2 mode config" which i usually don't enable..

ifeq ($(CONFIG_THUMB2_KERNEL),y)
AFLAGS_AUTOIT :=$(call as-option,-Wa$(comma)-mimplicit-it=always,-Wa$(comma)-mauto-it)
AFLAGS_NOWARN :=$(call as-option,-Wa$(comma)-mno-warn-deprecated,-Wa$(comma)-W)
CFLAGS_THUMB2 :=-mthumb $(AFLAGS_AUTOIT) $(AFLAGS_NOWARN)
AFLAGS_THUMB2 :=$(CFLAGS_THUMB2) -Wa$(comma)-mthumb
endif

So with that config enabled, it fails much sooner at:

  AS arch/arm/nwfpe/entry.o
arch/arm/nwfpe/entry.S: Assembler messages:
arch/arm/nwfpe/entry.S:96: Error: cannot use post-indexing with this instruction -- `ldrt r6,[r5],#4'
make[1]: *** [arch/arm/nwfpe/entry.o] Error 1
make: *** [arch/arm/nwfpe] Error 2

So playing around with different things, i forced gcc-4.4 over gcc-4.5 in the kernel Makfile with:

HOSTCC = gcc-4.4
HOSTCXX = g++-4.4

and it still fails...

  AS arch/arm/mach-omap2/omap-headsmp.o
arch/arm/mach-omap2/omap-headsmp.S: Assembler messages:
arch/arm/mach-omap2/omap-headsmp.S:36: Error: selected processor does not support ARM mode `smc #0'
make[1]: *** [arch/arm/mach-omap2/omap-headsmp.o] Error 1
make: *** [arch/arm/mach-omap2] Error 2

Makes me wonder if this might be a binutils issue instead of gcc-4.5?

Regards,

Revision history for this message
Robert Nelson (robertcnelson) wrote :

Clarity Note: the playing around with gcc-4.4 is back with the original config mentioned in this bug.. (thumb2 kernel disabled)

Revision history for this message
Anand Gadiyar (gadiyar) wrote :

Does reverting commit df571c4ab32da9bc05a7db98516fc06ef3cdc5d1 (omap4: Fix build break when used with gcc-4.4.1 (2009-q3) ) help?

Revision history for this message
Robert Nelson (robertcnelson) wrote :

Hi Anand,

No luck, using 2.6.37-rc3, and manually reverting that commit (changed smc #0 to smc)..

  CC arch/arm/mach-omap2/prm44xx.o
  CC arch/arm/mach-omap2/mcbsp.o
  CC arch/arm/mach-omap2/omap-smp.o
  AS arch/arm/mach-omap2/omap-headsmp.o
arch/arm/mach-omap2/omap-headsmp.S: Assembler messages:
arch/arm/mach-omap2/omap-headsmp.S:36: Error: selected processor does not support ARM mode `smc'
make[1]: *** [arch/arm/mach-omap2/omap-headsmp.o] Error 1
make: *** [arch/arm/mach-omap2] Error 2
voodoo@beagle-256mb-1:~/omap4-kernel/linux-2.6.37-rc3$ cat arch/arm/mach-omap2/omap-headsmp.S | grep smc
 smc @ read from AuxCoreBoot0

using natty's: gcc version 4.5.2 (Ubuntu/Linaro 4.5.1-10ubuntu3)

Revision history for this message
Robert Nelson (robertcnelson) wrote :
Revision history for this message
Michael Hope (michaelh1) wrote :

My reading of this is that 'smc' isn't in the base Cortex-A profile but requires the security extensions present. I think this can be enabled using '-march=armv7-a+sec' or (preferably) adding '.arch_extension sec' to the assembly code.

Revision history for this message
Robert Nelson (robertcnelson) wrote :

Interesting Michael,

  AS arch/arm/mach-omap2/omap-headsmp.o
  CC arch/arm/mach-omap2/omap-hotplug.o
  AS arch/arm/mach-omap2/omap44xx-smc.o
  CC arch/arm/mach-omap2/omap4-common.o
  AS arch/arm/mach-omap2/sram34xx.o

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 60e51bc..1b931b4 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -26,8 +26,8 @@ obj-$(CONFIG_LOCAL_TIMERS) += timer-mpu.o
 obj-$(CONFIG_HOTPLUG_CPU) += omap-hotplug.o
 obj-$(CONFIG_ARCH_OMAP4) += omap44xx-smc.o omap4-common.o

-AFLAGS_omap-headsmp.o :=-Wa,-march=armv7-a
-AFLAGS_omap44xx-smc.o :=-Wa,-march=armv7-a
+AFLAGS_omap-headsmp.o :=-Wa,-march=armv7-a+sec
+AFLAGS_omap44xx-smc.o :=-Wa,-march=armv7-a+sec

 # Functions loaded to SRAM
 obj-$(CONFIG_ARCH_OMAP2420) += sram242x.o

I'll play around with it a little more when i get home in just a little bit... This shouldn't break anything before natty?

Revision history for this message
Robert Nelson (robertcnelson) wrote :

it'll take 4-5 hours for build and test of the image..

One big limitation with this patch, it breaks older binutils..

Assembler messages:
Error: unknown architecture `armv7-a+sec'

Error: unrecognized option -march=armv7-a+sec
make[1]: *** [arch/arm/mach-omap2/omap-headsmp.o] Error 1
make: *** [arch/arm/mach-omap2] Error 2
make: *** Waiting for unfinished jobs....

This was with maverick's cross gcc
gcc version 4.5.1 (Ubuntu/Linaro 4.5.1-7ubuntu1)
GNU assembler version 2.20.51 (arm-linux-gnueabi) using BFD version (GNU Binutils for Ubuntu) 2.20.51.20100908

Revision history for this message
John Rigby (jcrigby) wrote :

The following is compatible with old and new binutils:

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 60e51bc..ee9ef4f 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -26,8 +26,9 @@ obj-$(CONFIG_LOCAL_TIMERS) += timer-mpu.o
 obj-$(CONFIG_HOTPLUG_CPU) += omap-hotplug.o
 obj-$(CONFIG_ARCH_OMAP4) += omap44xx-smc.o omap4-common.o

-AFLAGS_omap-headsmp.o :=-Wa,-march=armv7-a
-AFLAGS_omap44xx-smc.o :=-Wa,-march=armv7-a
+plus_sec := $(call as-instr,.arch_extension sec,+sec)
+AFLAGS_omap-headsmp.o :=-Wa,-march=armv7-a$(plus_sec)
+AFLAGS_omap44xx-smc.o :=-Wa,-march=armv7-a$(plus_sec)

 # Functions loaded to SRAM
 obj-$(CONFIG_ARCH_OMAP2420) += sram242x.o

Revision history for this message
Matthias Klose (doko) wrote :

closing the gcc-4.5 task

Changed in gcc-4.5 (Ubuntu):
status: New → Invalid
Revision history for this message
Ricardo Salveti (rsalveti) wrote :
Revision history for this message
Ricardo Salveti (rsalveti) wrote :

Robert, were you able to check if these patches fix your issue?

Revision history for this message
Robert Nelson (robertcnelson) wrote :

Hi Ricardo,

Yeap, this patch fixes the issue i was seeing with building both 2.6.35 and 2.6.37-rc's in natty.. and no regressions on the old userspaces, (lenny/karmic)..

I haven't seen a need for the 2nd one, "AFLAGS_sleep44xx.o :=-Wa,-march=armv7-a$(plus_sec)" as i don't have the omap4 power management stuff as you guys..

With the merge 2.6.38 merge on the horizon, we better get this in.. ;)

Revision history for this message
Jeremy Foshee (jeremyfoshee) wrote :

Hi Robert,

Please be sure to confirm this issue exists with the latest development release of Ubuntu. ISO CD images are available from http://cdimage.ubuntu.com/daily/current/ . If the issue remains, please run the following command from a Terminal (Applications->Accessories->Terminal). It will automatically gather and attach updated debug information to this report.

apport-collect -p linux 669912

Also, if you could test the latest upstream kernel available that would be great. It will allow additional upstream developers to examine the issue. Refer to https://wiki.ubuntu.com/KernelMainlineBuilds . Once you've tested the upstream kernel, please remove the 'needs-upstream-testing' tag. This can be done by clicking on the yellow pencil icon next to the tag located at the bottom of the bug description and deleting the 'needs-upstream-testing' text. Please let us know your results.

Thanks in advance.

    [This is an automated message. Apologies if it has reached you inappropriately; please just reply to this message indicating so.]

tags: added: needs-kernel-logs
tags: added: needs-upstream-testing
tags: added: kj-triage
Changed in linux (Ubuntu):
status: New → Incomplete
John Rigby (jcrigby)
Changed in linux (Ubuntu):
status: Incomplete → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.