English 中文(简体)
编译和roid jni 样本时出错: 无效 - march= 选项 :'armv5te
原标题:Error while compiling android jni sample: invalid -march= option: `armv5te
  • 时间:2012-05-26 22:37:24
  •  标签:
  • android

当我试图编集一些 和机器人的Dndk样本时, 我总是得到这个错误:

$ cd ~/Dev/Android/ndk/samples/hello-jni
$ ~/Dev/Android/ndk/ndk-build
Gdbserver      : [arm-linux-androideabi-4.4.3] libs/armeabi/gdbserver
Gdbsetup       : libs/armeabi/gdb.setup
Compile thumb  : hello-jni <= hello-jni.c
Assembler messages:
Fatal error: invalid -march= option: `armv5te 
make: *** [obj/local/armeabi/objs-debug/hello-jni/hello-jni.o] Error 1

我和我的系统有什么问题?

问题回答

我找到了一个解决办法:

$ ln -s $NDK_PATH/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-as $NDK_PATH/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/libexec/gcc/arm-linux-androideabi/4.4.3/as

首先,我运行了建筑商, 并有选项显示正在执行的逗号 :

$ ndk-build -B V=1

这样我发现它如何执行编译器, 并传递相同的命令 来推进

strace arm-linux-androideabi-gcc -MMD -MP -MF ./obj/local/armeabi/objs-debug/hello-jni/hello-jni.o.d -fpic -ffunction-sections -funwind-tables -fstack-protector -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__  -Wno-psabi -march=armv5te -mtune=xscale -msoft-float -mthumb -Os -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -Ijni -DANDROID  -Wa,--noexecstack -O0 -g -I/home/aleck/Dev/Android/ndk/platforms/android-8/arch-arm/usr/include -c  jni/hello-jni.c -o ./obj/local/armeabi/objs-debug/hello-jni/hello-jni.o

这表明,由于某种未知的原因,臂-linux-androideabi-gcc 使得按一种标准来搜索组装程序,但在此情况下,无效的名称代替臂-linux-androideabi as

stat64("/home/aleck/Dev/Android/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../libexec/gcc/arm-linux-androideabi/4.4.3/as", 0xbfedea68) = -1 ENOENT (No such file or directory)
stat64("/home/aleck/Dev/Android/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../libexec/gcc/as", 0xbfedea68) = -1 ENOENT (No such file or directory)
stat64("/home/aleck/Dev/Android/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin/arm-linux-androideabi/4.4.3/as", 0xbfedea68) = -1 ENOENT (No such file or directory)
stat64("/home/aleck/Dev/Android/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin/as", 0xbfedea68) = -1 ENOENT (No such file or directory)
vfork()                                 = 6931
waitpid(6931, Assembler messages:
Fatal error: invalid -march= option: `armv5te 

所以我做了一个软链接 命名为 最初它被预期的位置。





相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...

热门标签