ubuntu16.04 64bit编译android5.1错误

来源:互联网 发布:筹码分布软件 编辑:程序博客网 时间:2024/06/06 01:21

之前使用ubuntu12.04 64bit编译android时并没有出现较大的错误,将平台更换到16.04时编译出错,且该错误并不好查找,因此特意记录下来。

libnativehelper/JniConstants.cpp:103: error: unsupported reloc 43libnativehelper/JniConstants.cpp:104: error: unsupported reloc 43libnativehelper/JniConstants.cpp:105: error: unsupported reloc 43libnativehelper/JniConstants.cpp:106: error: unsupported reloc 43libnativehelper/JniConstants.cpp:107: error: unsupported reloc 43libnativehelper/JniConstants.cpp:108: error: unsupported reloc 43libnativehelper/JniConstants.cpp:109: error: unsupported reloc 43libnativehelper/JniConstants.cpp:110: error: unsupported reloc 43libnativehelper/JniConstants.cpp:111: error: unsupported reloc 43libnativehelper/JniConstants.cpp:112: error: unsupported reloc 43libnativehelper/JniConstants.cpp:113: error: unsupported reloc 43libnativehelper/JniConstants.cpp:114: error: unsupported reloc 43libnativehelper/JniConstants.cpp:115: error: unsupported reloc 43libnativehelper/JniConstants.cpp:116: error: unsupported reloc 43libnativehelper/JniConstants.cpp:117: error: unsupported reloc 43libnativehelper/JniConstants.cpp:118: error: unsupported reloc 43libnativehelper/JniConstants.cpp:119: error: unsupported reloc 43libnativehelper/JniConstants.cpp:120: error: unsupported reloc 43libnativehelper/JniConstants.cpp:121: error: unsupported reloc 43libnativehelper/JniConstants.cpp:122: error: unsupported reloc 43libnativehelper/JniConstants.cpp:123: error: unsupported reloc 43libnativehelper/JniConstants.cpp:124: error: unsupported reloc 43libnativehelper/JniConstants.cpp:125: error: unsupported reloc 43libnativehelper/JniConstants.cpp:126: error: unsupported reloc 43libnativehelper/JniConstants.cpp:127: error: unsupported reloc 43libnativehelper/JniConstants.cpp:128: error: unsupported reloc 43libnativehelper/JniConstants.cpp:129: error: unsupported reloc 43libnativehelper/JniConstants.cpp:130: error: unsupported reloc 43libnativehelper/JniConstants.cpp:131: error: unsupported reloc 43libnativehelper/JniConstants.cpp:132: error: unsupported reloc 43libnativehelper/JniConstants.cpp:133: error: unsupported reloc 43libnativehelper/JniConstants.cpp:134: error: unsupported reloc 43libnativehelper/JniConstants.cpp:135: error: unsupported reloc 43libnativehelper/JniConstants.cpp:136: error: unsupported reloc 43libnativehelper/JniConstants.cpp:137: error: unsupported reloc 43libnativehelper/JniConstants.cpp:138: error: unsupported reloc 43libnativehelper/JniConstants.cpp:139: error: unsupported reloc 43libnativehelper/JniConstants.cpp:140: error: unsupported reloc 43libnativehelper/toStringArray.cpp:21: error: unsupported reloc 43libnativehelper/toStringArray.cpp:21: error: unsupported reloc 43libnativehelper/JniInvocation.cpp:40: error: unsupported reloc 43libnativehelper/JniInvocation.cpp:45: error: unsupported reloc 43libnativehelper/JniInvocation.cpp:165: error: unsupported reloc 43libnativehelper/JniInvocation.cpp:165: error: unsupported reloc 43libnativehelper/JniInvocation.cpp:165: error: unsupported reloc 43libnativehelper/JniInvocation.cpp:165: error: unsupported reloc 43clang: error: linker command failed with exit code 1 (use -v to see invocation)host C++: libc++ <= external/libcxx/src/algorithm.cpphost C++: libc++ <= external/libcxx/src/bind.cppbuild/core/host_shared_library_internal.mk:44: recipe for target 'out/host/linux-x86/obj32/lib/libnativehelper.so' failedmake: *** [out/host/linux-x86/obj32/lib/libnativehelper.so] Error 1make: *** 正在等待未完成的任务....

source_android代表你的android源码根目录

1.修改

cd  <source_android>/art/build/vim Android.common_build.mk    //修改第119行修改前:# Host.ART_HOST_CLANG := falseifneq ($(WITHOUT_HOST_CLANG),true)# By default, host builds use clang for better warnings.ART_HOST_CLANG := trueendif修改后:# Host.ART_HOST_CLANG := falseifneq ($(WITHOUT_HOST_CLANG),false)# By default, host builds use clang for better warnings.ART_HOST_CLANG := trueendif

2.修改
经过第一次修改之后发现编译还是报同样的错误,执行下面:

 cp /usr/bin/ld.gold   <source_android>/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6/x86_64-linux/bin/ld 

3.修改过上述代码后,最好执行一次make update-api,在make

1 0
原创粉丝点击