0

我收到一条错误消息,说 addeq 应该在 IT 块中。据我所知。

这是代码的一部分,位于https://github.com/Jcfunk/g3_kernel/blob/lp-release/arch/arm/crypto/aesbs-core.S_shipped的第 455 行

    ite eq              @ Thumb2 thing, sanity check in ARM
    addeq   r6,r6,#0x10
    bne .Ldec_loop

addeq 在 IT 块中吗?

从我用谷歌搜索的内容来看,If-Then 块,这个 IT 块意味着 if EQ then ADDEQ else BNE .Ldec_loop。我觉得 ADDEQ 在 IT 模块中,但我对手臂组装一无所知。或者可能是构建标志冲突。

这是 make 输出, make V=1 zImage-dtb ,可能问题是传递给 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

我正在使用 GNU 汇编器版本 2.25.1 (arm-linux-gnueabihf) 使用 BFD 版本 (GNU Binutils for Ubuntu) 2.25.1 gcc (Ubuntu 5.2.1-17ubuntu4) 5.2.1 20150911

这是 LG G3 的 Android 内核的一部分,构建在未交叉编译的 arm 设备上

构建标志 -nostdinc -isystem /usr/lib/gcc/arm-linux-gnueabihf/5/include -I/sdcard/build/navelA/arch/arm/include -Iarch/arm/include/generated -Iinclude -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-签名 -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

4

1 回答 1

0

该文件作为正常内核构建(ARM 和 Thumb)的一部分构建得很好,所以这显然是您在 GCC 命令行中伪造它的方式的问题。当您在顶部附近看到此片段时,运行它-E以查看预处理的输出会使事情变得非常清楚:

...
# 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
...

这些标头显然是为编译为 ARM 代码而设置的,因此这些宏隐藏了 Thumbit指令,以利于顽固的旧汇编器,这些汇编器可能会像非 ARM 指令那样扼杀它们(而不是像现代统一汇编器应该忽略它们)。因此,当您的汇编器(显然已被 GCC 告知要发出 Thumb 代码)最终看到没有前面的条件指令时,it并且可以理解地变得非常不高兴。

因此,使用您的构建命令,您要么只需要编译为 ARM 代码(传递-marm是最简单的方法),要么进一步挖掘 KBuild 并找到必要的东西来定义以说服内核头文件他们正在构建“内核”在拇指模式(可能涉及CONFIG_THUMB2_KERNEL)。

于 2015-09-23T12:36:10.240 回答