记一次使用OLLVM增加so文件的分析难度(2)——解决arm64-v8a编译出错

22 篇文章 0 订阅
11 篇文章 0 订阅

上一篇我用的是android-ndk-r10d的ndk,编译arm64-v8a是有问题的,解决了下面那个“错误提示1”的问题之后,还会有个一个新问题的,问题如下:

/opt/android-ndk-r10d/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/lib/gcc/aarch64-linux-android/4.9/../../../../aarch64-linux-android/bin/ld: unrecognized option '--fix-cortex-a53-843419'
/opt/android-ndk-r10d/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/lib/gcc/aarch64-linux-android/4.9/../../../../aarch64-linux-android/bin/ld: use the --help option for usage information
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [/opt/obj/local/arm64-v8a/libhello.so] Error 1

 

现在这篇我的ndk版本是android-ndk-r10e的NDK(http://dl.google.com/android/ndk/android-ndk-r10e-linux-x86_64.bin

一定要用这个,一定要用这个,一定要用这个,要不然各种苦逼的错误,我试了很多个版本了,就这个版本是编译成功的

错误提示1:

aarch64-linux-android-g++: error: unrecognized command line option '-mllvm'
aarch64-linux-android-g++: error: unrecognized command line option '-fla'
aarch64-linux-android-g++: error: unrecognized command line option '-mllvm'
aarch64-linux-android-g++: error: unrecognized command line option '-sub'
make: *** [/opt/obj/local/arm64-v8a/objs/hello/hello.o] Error 1

 

解决办法:

去ndk的目录 /opt/android-ndk-r10e/build/core  找到setup-toolchain.mk这个文件进行修改,添加你的工具链名称标识

 

最后终于编译成功,耗时3天,途中各种ndk的版本都试过,苦逼

 

ndk-build命令的常用参数:

ndk-build -B 重新编译

ndk-build V=1 打印出编译命令

ndk-build APP_ABI="arm64-v8a"  指定编译的目标平台类型

 

参考来源:

http://www.qingpingshan.com/m/view.php?aid=222774

https://stackoverflow.com/questions/39030293/o-llvm-unrecognized-command-line-option-sub-for-64bits

https://blog.csdn.net/wangbaochu/article/details/45370543

https://www.cnblogs.com/jkcx/p/7232931.html

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值