We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1737

Summary: Error: selected processor does not support `swp r3,r2,[r0]'
Product: SDL Reporter: 60059
Component: atomicAssignee: Sam Lantinga <slouken>
Status: RESOLVED INVALID QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: gabomdq
Version: 2.0.0   
Hardware: ARM   
OS: Android (All)   

Description 60059 2013-03-02 04:50:56 UTC
I'm trying to compile a very simple SDL app on android using the NDK (last revision,  8) , and when trying to compile ,  I got the following errors 

Compile thumb  : SDL2 <= SDL_spinlock.c
/tmp/cc6QMei3.s: Assembler messages:
/tmp/cc6QMei3.s:37: Error: selected processor does not support `swp r3,r2,[r0]'
make: *** [obj/local/armeabi/objs/SDL2/src/atomic/SDL_spinlock.o] Error 1


This, whatever if compiling with gcc4.4.3,  gcc4.6 or gcc4.7 or even clang3.1
Comment 1 Gabriel Jacobo 2013-03-02 06:50:30 UTC
That's strange, SDL's buildbot seems to compile just fine ( http://buildbot.libsdl.org/waterfall ), and I've also compiled it lately without issues...

Are you using SDL's default Android.mk? Any other particulars from your set up that differ from the standard?
Comment 2 60059 2013-03-02 08:56:45 UTC
no i'm using directly the android-project in the SDL2 archive 

After I also find strange that i'm the only one to get that errors. Do you need some command output, to check if there's any difference between my environnement and yours and the buildbot one ?
Comment 3 Gabriel Jacobo 2013-03-02 11:44:57 UTC
I just double checked with the NDK 8b and 8d, both work fine.

What I did notice is that I'm getting:

Compile arm    : SDL2 <= SDL_spinlock.c

While you are getting:

Compile thumb  : SDL2 <= SDL_spinlock.c

The Android.mk file that comes with SDL should handle this for you, because it states:

$(LOCAL_PATH)/src/atomic/SDL_spinlock.c.arm

Which forces compilation of that file in ARM mode, versus thumb mode. (See the second answer here: http://stackoverflow.com/questions/2380152/android-ndk-does-it-support-straight-arm-code-or-just-thumb)

Can you double check what are the contents of your Android.mk?
Comment 4 60059 2013-03-02 15:57:32 UTC
Ok my bad,  I've misread the README.android , i thought it was simply copying the  src and include folder, so yes after that was not including the android.mk at the root of the SDL folder , so everything was failing 

sorry for the waste of time