选定的处理器不支持拇指模式"swp r3,sl,[fp]"

selected processor does not support Thumb mode `swp r3,sl,[fp]'

本文关键字:swp r3 fp sl 模式 处理器 不支持      更新时间:2023-10-16

我正在尝试使用 Linaro 12.11 在 ODROID X2 开发板中为 ARM 构建一个C++程序。在编译过程中,我发现了这种类型的错误,其中我找不到答案:

/

tmp/ccsPcPGU.s: 汇编器消息:

/

tmp/ccsPcPGU.s:5488:错误:选定的处理器不支持拇指模式"swp r3,sl,[fp]"

我什至不记得在这里使用拇指模式。有什么建议可以解决这个问题吗?

更新:

@auselen 这就是我得到的gcc -v

root@linaro-ubuntu-desktop:/# gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/4.6/lto-wrapper Target: arm-linux-gnueabihf Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.3-1ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --enable-multilib --disable-sjlj-exceptions --with-arch=armv7-a --with-float=hard --with-fpu=vfpv3-d16 --with-mode=thumb --disable-werror --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf Thread model: posix gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)

当我尝试使用 gcc -c 编译每个项目构造函数文件时,我仍然遇到同样的问题,所以我会相信我的arm-linux-gnueabihf有问题。

SWP/SWPB 指令在 Thumb 指令集中不存在。

如果 Linaro 12.11 工具链默认为 Thumb,则汇编代码中可能缺少(或指令状态指令不正确)。

取决于导致错误的原因(C 中包含的内联 asm 语句或 .已预处理的 S 文件),需要将项目的全部或部分内容构建为 ARM 指令。

似乎罪魁祸首是include/refmem/atomic.h,更新编译器应该可以修复它:https://github.com/cmyth/cmyth/issues/11

编辑:根据这个错误条目,修复程序在libgc(1:6.8-1.2ubuntu2)中可用。