之前使用ubuntu12.04 64bit编译Android时并没有出现较大的错误,将平台更换到16.04时编译出错,且该错误并不好查找,因此特意记录下来。
libnativehelper/JniConstants.cpp:103: @H_502_6@error: unsupported reloc 43
libnativehelper/JniConstants.cpp:104: @H_502_6@error: unsupported reloc 43
libnativehelper/JniConstants.cpp:105: @H_502_6@error: unsupported reloc 43
libnativehelper/JniConstants.cpp:106: @H_502_6@error: unsupported reloc 43
libnativehelper/JniConstants.cpp:107: @H_502_6@error: unsupported reloc 43
libnativehelper/JniConstants.cpp:108: @H_502_6@error: unsupported reloc 43
libnativehelper/JniConstants.cpp:109: @H_502_6@error: unsupported reloc 43
libnativehelper/JniConstants.cpp:110: @H_502_6@error: unsupported reloc 43
libnativehelper/JniConstants.cpp:111: @H_502_6@error: unsupported reloc 43
libnativehelper/JniConstants.cpp:112: @H_502_6@error: unsupported reloc 43
libnativehelper/JniConstants.cpp:113: @H_502_6@error: unsupported reloc 43
libnativehelper/JniConstants.cpp:114: @H_502_6@error: unsupported reloc 43
libnativehelper/JniConstants.cpp:115: @H_502_6@error: unsupported reloc 43
libnativehelper/JniConstants.cpp:116: @H_502_6@error: unsupported reloc 43
libnativehelper/JniConstants.cpp:117: @H_502_6@error: unsupported reloc 43
libnativehelper/JniConstants.cpp:118: @H_502_6@error: unsupported reloc 43
libnativehelper/JniConstants.cpp:119: @H_502_6@error: unsupported reloc 43
libnativehelper/JniConstants.cpp:120: @H_502_6@error: unsupported reloc 43
libnativehelper/JniConstants.cpp:121: @H_502_6@error: unsupported reloc 43
libnativehelper/JniConstants.cpp:122: @H_502_6@error: unsupported reloc 43
libnativehelper/JniConstants.cpp:123: @H_502_6@error: unsupported reloc 43
libnativehelper/JniConstants.cpp:124: @H_502_6@error: unsupported reloc 43
libnativehelper/JniConstants.cpp:125: @H_502_6@error: unsupported reloc 43
libnativehelper/JniConstants.cpp:126: @H_502_6@error: unsupported reloc 43
libnativehelper/JniConstants.cpp:127: @H_502_6@error: unsupported reloc 43
libnativehelper/JniConstants.cpp:128: @H_502_6@error: unsupported reloc 43
libnativehelper/JniConstants.cpp:129: @H_502_6@error: unsupported reloc 43
libnativehelper/JniConstants.cpp:130: @H_502_6@error: unsupported reloc 43
libnativehelper/JniConstants.cpp:131: @H_502_6@error: unsupported reloc 43
libnativehelper/JniConstants.cpp:132: @H_502_6@error: unsupported reloc 43
libnativehelper/JniConstants.cpp:133: @H_502_6@error: unsupported reloc 43
libnativehelper/JniConstants.cpp:134: @H_502_6@error: unsupported reloc 43
libnativehelper/JniConstants.cpp:135: @H_502_6@error: unsupported reloc 43
libnativehelper/JniConstants.cpp:136: @H_502_6@error: unsupported reloc 43
libnativehelper/JniConstants.cpp:137: @H_502_6@error: unsupported reloc 43
libnativehelper/JniConstants.cpp:138: @H_502_6@error: unsupported reloc 43
libnativehelper/JniConstants.cpp:139: @H_502_6@error: unsupported reloc 43
libnativehelper/JniConstants.cpp:140: @H_502_6@error: unsupported reloc 43
libnativehelper/toStringArray.cpp:21: @H_502_6@error: unsupported reloc 43
libnativehelper/toStringArray.cpp:21: @H_502_6@error: unsupported reloc 43
libnativehelper/JniInvocation.cpp:40: @H_502_6@error: unsupported reloc 43
libnativehelper/JniInvocation.cpp:45: @H_502_6@error: unsupported reloc 43
libnativehelper/JniInvocation.cpp:165: @H_502_6@error: unsupported reloc 43
libnativehelper/JniInvocation.cpp:165: @H_502_6@error: unsupported reloc 43
libnativehelper/JniInvocation.cpp:165: @H_502_6@error: unsupported reloc 43
libnativehelper/JniInvocation.cpp:165: @H_502_6@error: unsupported reloc 43
clang: @H_502_6@error: linker command Failed @H_502_6@with @H_502_6@exit code 1 (use -v @H_502_6@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 @H_502_6@for target 'out/host/linux-x86/obj32/lib/libnativehelper.so' Failed
make: *** [out/host/linux-x86/obj32/@H_502_6@lib/libnativehelper.so] @H_502_6@Error 1
make: *** 正在等待未完成的任务....
source_android代表你的android源码根目录
1.修改
cd <source_android>/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.修改
经过第一次修改之后发现编译还是报同样的错误,执行下面:
@H_502_6@cp /usr/bin/@H_502_6@ld.gold <source_android>/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6/x86_64-linux/bin/@H_502_6@ld