64位Linux系统编译Android,Ubuntu 16.04 64bit编译Android 5.1错误

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

libnativehelper/JniConstants.cpp:103: error: unsupported reloc 43

libnativehelper/JniConstants.cpp:104: error: unsupported reloc 43

libnativehelper/JniConstants.cpp:105: error: unsupported reloc 43

libnativehelper/JniConstants.cpp:106: error: unsupported reloc 43

libnativehelper/JniConstants.cpp:107: error: unsupported reloc 43

libnativehelper/JniConstants.cpp:108: error: unsupported reloc 43

libnativehelper/JniConstants.cpp:109: error: unsupported reloc 43

libnativehelper/JniConstants.cpp:110: error: unsupported reloc 43

libnativehelper/JniConstants.cpp:111: error: unsupported reloc 43

libnativehelper/JniConstants.cpp:112: error: unsupported reloc 43

libnativehelper/JniConstants.cpp:113: error: unsupported reloc 43

libnativehelper/JniConstants.cpp:114: error: unsupported reloc 43

libnativehelper/JniConstants.cpp:115: error: unsupported reloc 43

libnativehelper/JniConstants.cpp:116: error: unsupported reloc 43

libnativehelper/JniConstants.cpp:117: error: unsupported reloc 43

libnativehelper/JniConstants.cpp:118: error: unsupported reloc 43

libnativehelper/JniConstants.cpp:119: error: unsupported reloc 43

libnativehelper/JniConstants.cpp:120: error: unsupported reloc 43

libnativehelper/JniConstants.cpp:121: error: unsupported reloc 43

libnativehelper/JniConstants.cpp:122: error: unsupported reloc 43

libnativehelper/JniConstants.cpp:123: error: unsupported reloc 43

libnativehelper/JniConstants.cpp:124: error: unsupported reloc 43

libnativehelper/JniConstants.cpp:125: error: unsupported reloc 43

libnativehelper/JniConstants.cpp:126: error: unsupported reloc 43

libnativehelper/JniConstants.cpp:127: error: unsupported reloc 43

libnativehelper/JniConstants.cpp:128: error: unsupported reloc 43

libnativehelper/JniConstants.cpp:129: error: unsupported reloc 43

libnativehelper/JniConstants.cpp:130: error: unsupported reloc 43

libnativehelper/JniConstants.cpp:131: error: unsupported reloc 43

libnativehelper/JniConstants.cpp:132: error: unsupported reloc 43

libnativehelper/JniConstants.cpp:133: error: unsupported reloc 43

libnativehelper/JniConstants.cpp:134: error: unsupported reloc 43

libnativehelper/JniConstants.cpp:135: error: unsupported reloc 43

libnativehelper/JniConstants.cpp:136: error: unsupported reloc 43

libnativehelper/JniConstants.cpp:137: error: unsupported reloc 43

libnativehelper/JniConstants.cpp:138: error: unsupported reloc 43

libnativehelper/JniConstants.cpp:139: error: unsupported reloc 43

libnativehelper/JniConstants.cpp:140: error: unsupported reloc 43

libnativehelper/toStringArray.cpp:21: error: unsupported reloc 43

libnativehelper/toStringArray.cpp:21: error: unsupported reloc 43

libnativehelper/JniInvocation.cpp:40: error: unsupported reloc 43

libnativehelper/JniInvocation.cpp:45: error: unsupported reloc 43

libnativehelper/JniInvocation.cpp:165: error: unsupported reloc 43

libnativehelper/JniInvocation.cpp:165: error: unsupported reloc 43

libnativehelper/JniInvocation.cpp:165: error: unsupported reloc 43

libnativehelper/JniInvocation.cpp:165: error: unsupported reloc 43

clang: error: linker command failed with exit code 1 (use -v to see invocation)

host C++: libc++ <= external/libcxx/src/algorithm.cpp

host C++: libc++ <= external/libcxx/src/bind.cpp

build/core/host_shared_library_internal.mk:44: recipe for target 'out/host/linux-x86/obj32/lib/libnativehelper.so' failed

make: *** [out/host/linux-x86/obj32/lib/libnativehelper.so] Error 1

make: *** 正在等待未完成的任务....

source_android代表你的android源码根目录

1.修改

cd  /art/build/

vim Android.common_build.mk    //修改第119行

修改前:

# Host.

ART_HOST_CLANG := false

ifneq ($(WITHOUT_HOST_CLANG),true)

# By default, host builds use clang for better warnings.

ART_HOST_CLANG := true

endif

修改后:

# Host.

ART_HOST_CLANG := false

ifneq ($(WITHOUT_HOST_CLANG),false)

# By default, host builds use clang for better warnings.

ART_HOST_CLANG := true

endif

2.修改

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

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

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

0b1331709591d260c1c78e86d0c51c18.png

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值