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 Android.mk 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 Android.mk file currently looks like this:

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


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?
paulscode
Experienced Developer
Experienced Developer
 
Posts: 79
Joined: Thu Nov 11, 2010 3:57 pm

Top

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 androi.mk is

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE :=hello-jni
LOCAL_SRC_FILE:=hello-jni.c
LOCAL_SHARED_LIBRARY := ndk
include $(BUILD_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := ndk
NDK_MODULE_PATH := $(LOCAL_PATH)
LOCAL_SRC_FILES := libndk.so
include $(PREBUILT_SHARED_LIBRARY)

hello-jni.c calls functions from libndk.so(ARM 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 ashish_vijayvirgiya@yahoo.com
if you want some additional information then you tell me.

thanks.
aashishvijayvirgiya
Freshman
Freshman
 
Posts: 8
Joined: Tue May 31, 2011 8:30 am

Top

Return to NDK Problems

Who is online

Users browsing this forum: No registered users and 5 guests