Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

assembly - Linking Android C-code and ARM Assembler

I have written an Android app. It uses a main C-code module and a linked-in C-code module. Now I want to replace the linked-in module with an ARM assembler module. Anyone have a simple example?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Here's an example of Android.mk file that will build sourcetree containing assembly. To see a complete example check the hello-neon sample distributed in the NDK package.

LOCAL_PATH:= $(call my-dir)

include $(CLEAR_VARS)

LOCAL_ARM_MODE := arm  # remove this if you want thumb mode
LOCAL_ARM_NEON := true # remove this if you want armv5 mode

LOCAL_CFLAGS :=  -std=c99 -pedantic -v

LOCAL_SRC_FILES := # list your C, C++ and assembly sources here.
           # assembly source files ends with extension .S
           # add .arm after the extension if you want to compile in armv5 mode (default is thumb)
           # add .arm.neon to compile in armv7 mode

LOCAL_C_INCLUDES := $(LOCAL_PATH)

LOCAL_LDLIBS := -llog

LOCAL_MODULE := #the name of your shared library

include $(BUILD_SHARED_LIBRARY)

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...