2

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

/tmp/ccsPcPGU.s:汇编程序消息:

/tmp/ccsPcPGU.s:5488: 错误: 所选处理器不支持 Thumb 模式`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.

4

2 回答 2

1

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

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

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

于 2013-09-05T07:24:01.510 回答
0

It seems the culprit is include/refmem/atomic.h and updating the compiler should fix it: https://github.com/cmyth/cmyth/issues/11

EDIT: according to this bug entry, the fix is available in libgc (1:6.8-1.2ubuntu2).

于 2013-09-10T16:06:45.930 回答