Building for armeabi-v7a

Put problems with the Android NDK in this forum.

Building for armeabi-v7a

Postby paulscode » Sat Dec 18, 2010 11:15 pm

Hello, again! I am building a project which includes an assembly file with instructions specific to ARM 7a (i.e. not ARM 5 or THUMB). I've been digging around on the internet to get my setting right, but I can't seem to get the builder to do put in the right flags (or I should say not put in flags that shouldn't be there). I'm starting with a very simple test project to try and work out the problem, before I apply what I learn to my larger project. In this test project, the only source file is the assembly code. My file currently looks like this:

Code: Select all
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE   := linkage_arm
APP_ABI         := armeabi-v7a
TARGET_CPU_ABI   := armeabi-v7a
LOCAL_SRC_FILES := linkage_arm.S

One would think that this should be obvious to the builder that this is for ARM v7a only. However, when I run the build, it does the following:

Code: Select all
Compile arm    : linkage_arm <= /home/paul/workspace/HelloAndroid/jni/linkage_arm.S
/home/paul/workspace/HelloAndroid/obj/local/armeabi/objs/linkage_arm/linkage_arm.o: In function `.A8':
/home/paul/bin/android-ndk-r4b/build/prebuilt/linux-x86/arm-eabi-4.4.0/bin/arm-eabi-gcc -I/home/paul/bin/android-ndk-r4b/build/platforms/android-8/arch-arm/usr/include -fpic -mthumb-interwork -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__  -Wno-psabi -march=armv5te -mtune=xscale -msoft-float -O2 -fomit-frame-pointer -fstrict-aliasing -funswitch-loops -finline-limit=300  -I/home/paul/workspace/HelloAndroid/jni -DANDROID  -Wa,--noexecstack -O2 -DNDEBUG -g -c -MMD -MP -MF /home/paul/workspace/HelloAndroid/obj/local/armeabi/objs/linkage_arm/linkage_arm.o.d /home/paul/workspace/HelloAndroid/jni/linkage_arm.S -o /home/paul/workspace/HelloAndroid/obj/local/armeabi/objs/linkage_arm/linkage_arm.o

As you can see, there are several flags in there which are wrong:
1) The "-march=armv5te" flag should be "-march=armv7-a" instead
2) The "-mthumb-interwork" flag should not be there at all
3) All the "-D__ARM_ARCH_5*" may be a problem (seems like these should not be there either)

I seriously can't figure out where these are coming from. Any ideas how to fix this?
Experienced Developer
Experienced Developer
Posts: 79
Joined: Thu Nov 11, 2010 3:57 pm


Re: Building for armeabi-v7a

Postby aashishvijayvirgiya » Wed Jun 01, 2011 10:45 am

new to android.
working on android jni(ndk).done some sample projects based on prebuilt library, having same problems
my is

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE :=hello-jni

include $(CLEAR_VARS)

hello-jni.c calls functions from lib.)

this project run successfully several times but when i restarted the eclipse and again run the project from eclipse.
emulator load the project. but having the problem calling funtions from shared library. it stopped unexpectedly. when i debug in logcat view it show unsatisfied linker error.
please help me out this problem.
attached the project also

my email address is
if you want some additional information then you tell me.

Posts: 8
Joined: Tue May 31, 2011 8:30 am


Return to NDK Problems

Who is online

Users browsing this forum: No registered users and 1 guest