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

5.8k views Asked by At

I am trying to build a C++ program for ARM in an ODROID X2 board by using Linaro 12.11. In the compiling process, I found this type of error, in which I couldn't find the answer:

/tmp/ccsPcPGU.s: Assembler messages:

/tmp/ccsPcPGU.s:5488: Error: selected processor does not support Thumb mode `swp r3,sl,[fp]'

I don't even remember using Thumb mode here. Is there any suggestion how I can solve this problem?

Update:

@auselen This is what I got for 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)

I still got the same problem when I tried to compile each project constructor file by using gcc -c, so I am going to believe that there is a problem with my arm-linux-gnueabihf.

2

There are 2 answers

1
unixsmurf On

The SWP/SWPB instructions do not exist in the Thumb instruction set.

If the Linaro 12.11 toolchain defaults to Thumb, you are probably missing (or have an incorrect) instruction state directive in the assembly code.

Depending on what is causing the error (an inline asm statement included in C, or a .S file that has been preprocessed), all or parts of your project will need to be built as ARM instructions.

0
Igor Skochinsky On

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