Reputation: 65
I'm getting an error saying addeq should be in IT block. From what I can tell it is.
Here is a cut of the code, at line 455 of https://github.com/Jcfunk/g3_kernel/blob/lp-release/arch/arm/crypto/aesbs-core.S_shipped
ite eq @ Thumb2 thing, sanity check in ARM
addeq r6,r6,#0x10
bne .Ldec_loop
Is addeq in an IT block?
From what I've googled, If-Then block, this IT block means that if EQ then ADDEQ else BNE .Ldec_loop. I feel like ADDEQ is in the IT block, but I know nothing of arm assembly. Or possibly it's a build flag conflict.
Here is make output, make V=1 zImage-dtb , possiblly the issue is one of the flags passed to AS
scripts/gcc-wrapper.py gcc -Wp,-MD,arch/arm/crypto/.aesbs-core.o.d -nostdinc -isystem /usr/lib/gcc/arm-linux-gnueabihf/5/include -I/sdcard/build/navelA/arch/arm/include -Iarch/arm/include/generated -Iinclude -include /sdcard/build/navelA/include/linux/kconfig.h -D__KERNEL__ -mlittle-endian -Iarch/arm/mach-msm/include -D__ASSEMBLY__ -mabi=aapcs-linux -mno-thumb-interwork -funwind-tables -D__LINUX_ARM_ARCH__=7 -mcpu=cortex-a15 -include asm/unified.h -msoft-float -gdwarf-2 -c -o arch/arm/crypto/aesbs-core.o arch/arm/crypto/aesbs-core.S
I'm using GNU assembler version 2.25.1 (arm-linux-gnueabihf) using BFD version (GNU Binutils for Ubuntu) 2.25.1 gcc (Ubuntu 5.2.1-17ubuntu4) 5.2.1 20150911
This is part of Android kernel for LG G3, be built on arm device not cross-compiled
Build flags -nostdinc -isystem /usr/lib/gcc/arm-linux-gnueabihf/5/include -I/sdcard/build/navelA/arch/arm/include -Iarch/arm/include/generated -Iinclude -include ./include/linux/kconfig.h -D__KERNEL__ -mlittle-endian -Iarch/arm/mach-msm/include -Wall -DNDEBUG -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -mcpu=cortex-a15 -mtune=cortex-a15 -mfpu=neon-vfpv4 -marm -ffast-math -fsingle-precision-constant -fgcse-lm -fgcse-sm -fsched-spec-load -fforce-addr -Os -marm -fno-dwarf2-cfi-asm -fstack-protector -mabi=aapcs-linux -mno-thumb-interwork -funwind-tables -D__LINUX_ARM_ARCH__=7 -mcpu=cortex-a15 -msoft-float -Uarm -Wframe-larger-than=1024 -Wno-unused-but-set-variable -fomit-frame-pointer -gdwarf-2 -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -DCC_HAVE_ASM_GOTO -munaligned-access -fforce-addr -fsingle-precision-constant -mcpu=cortex-a15 -mtune=cortex-a15 -marm -mfpu=neon-vfpv4 -fgcse-las -fpredictive-commoning
Upvotes: 0
Views: 905
Reputation: 20934
This file builds fine as part of a normal kernel build (both ARM and Thumb), so it's clearly an issue with the way you're faking that up in your GCC command line. Running it through with -E
to look at the preprocessed output makes things pretty clear when you see this fragment near the top:
...
# 1 "include/generated/autoconf.h" 1
# 5 "./include/linux/kconfig.h" 2
# 1 "<command-line>" 2
# 1 "./arch/arm/include/asm/unified.h" 1
# 74 "./arch/arm/include/asm/unified.h"
.macro it, cond
.endm
.macro itt, cond
.endm
.macro ite, cond
.endm
...
Those headers are apparently set up for compiling as ARM code, so these macros hide the Thumb it
instruction for the benefit of crusty old assemblers which might choke on them as non-ARM instructions (instead of just ignoring them as a modern unified assembler should). Thus when your assembler, which has apparently been told by GCC to emit Thumb code, ends up seeing conditional instructions without a preceding it
and understandably becomes very unhappy.
Therefore, with your build command, you either need to just compile as ARM code (passing -marm
is the simplest way) or dig through KBuild some more and find the necessary stuff to define to convince the kernel headers that they're building the "kernel" in Thumb mode (probably involving CONFIG_THUMB2_KERNEL
).
Upvotes: 0