为什么即使我设置了-march = armv6,也为armv7构建了库?

时间:2017-08-11 17:54:18

标签: gcc arm cross-compiling x264

我试图为armv6构建libx264,但我得到的似乎是为armv7构建的。我正在使用此配置行:

./configure --host=arm-linux-gnueabihf --enable-static --cross-prefix=${CCPREFIX} --prefix=... --extra-cflags='-march=armv6' --extra-ldflags='-march=armv6' --extra-asflags='-march=armv6'

会产生如下输出:

[...]
arm-linux-gnueabihf-gcc -Wno-maybe-uninitialized -Wshadow -O3 -ffast-math  -Wall -I. -I. -march=armv6 -std=gnu99 -D_GNU_SOURCE -fomit-frame-pointer -fno-tree-vectorize   -c -o common/opencl.o common/opencl.c
arm-linux-gnueabihf-gcc -Wno-maybe-uninitialized -Wshadow -O3 -ffast-math  -Wall -I. -I. -march=armv6 -std=gnu99 -D_GNU_SOURCE -fomit-frame-pointer -fno-tree-vectorize   -c -o encoder/slicetype-cl.o encoder/slicetype-cl.c
arm-linux-gnueabihf-gcc -I. -I. -march=armv6 -c -DSTACK_ALIGNMENT=4 -DHIGH_BIT_DEPTH=0 -DBIT_DEPTH=8 -o common/arm/cpu-a.o common/arm/cpu-a.S
[...]

现在这就是我所看到的:

$ readelf -A x264
Attribute Section: aeabi
File Attributes
  Tag_CPU_name: "7-A"
  Tag_CPU_arch: v7
  Tag_CPU_arch_profile: Application
  Tag_ARM_ISA_use: Yes
  Tag_THUMB_ISA_use: Thumb-2
  Tag_FP_arch: VFPv3
  Tag_Advanced_SIMD_arch: NEONv1
  Tag_ABI_PCS_wchar_t: 4
  Tag_ABI_FP_denormal: Needed
  Tag_ABI_FP_exceptions: Needed
  Tag_ABI_FP_number_model: IEEE 754
  Tag_ABI_align_needed: 8-byte
  Tag_ABI_enum_size: int
  Tag_ABI_HardFP_use: Deprecated
  Tag_ABI_VFP_args: VFP registers
  Tag_CPU_unaligned_access: v6
  Tag_DIV_use: Not allowed

我也看到了这一点:

$ readelf -A encoder/slicetype-cl.o
Attribute Section: aeabi
File Attributes
  Tag_CPU_name: "6"
  Tag_CPU_arch: v6
  Tag_ARM_ISA_use: Yes
  Tag_THUMB_ISA_use: Thumb-1
  Tag_FP_arch: VFPv2
  Tag_ABI_PCS_wchar_t: 4
  Tag_ABI_FP_number_model: Finite
  Tag_ABI_align_needed: 8-byte
  Tag_ABI_align_preserved: 8-byte, except leaf SP
  Tag_ABI_enum_size: int
  Tag_ABI_HardFP_use: Deprecated
  Tag_ABI_VFP_args: VFP registers
  Tag_ABI_optimization_goals: Aggressive Speed
  Tag_CPU_unaligned_access: v6

但:

$ readelf -A common/arm/cpu-a.o
Attribute Section: aeabi
File Attributes
  Tag_CPU_name: "7-A"
  Tag_CPU_arch: v7
  Tag_CPU_arch_profile: Application
  Tag_ARM_ISA_use: Yes
  Tag_THUMB_ISA_use: Thumb-2
  Tag_FP_arch: VFPv3
  Tag_Advanced_SIMD_arch: NEONv1

有人可以解释为什么这些命令似乎只输出一次armv6二进制文件而在另一种情况下输出一个armv7二进制文件?这可能是生成的二进制文件被标记为armv7的原因吗? 谢谢你的任何解释。

0 个答案:

没有答案