android sdk linux 16.04 编译 兼容性出问题 x86_64

编译出现的错误:
/home/elinksoft/code/8163/alps/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6/bin/../lib/gcc/x86_64-linux/4.6/../../../../x86_64-linux/bin/ld: error: out/host/linux-x86/obj32/STATIC_LIBRARIES/libcompiler_rt_intermediates/libcompiler_rt.a(eprintf.o): unsupported reloc 43 against global symbol stderr
external/compiler-rt/lib/builtins/eprintf.c:32: error: unsupported reloc 43
collect2: ld returned 1 exit status
build/core/host_shared_library_internal.mk:44: recipe for target 'out/host/linux-x86/obj32/lib/libcompiler_rt.so' failed
make: *** [out/host/linux-x86/obj32/lib/libcompiler_rt.so] Error 1
make: *** Waiting for unfinished jobs....
host C++: libnativehelper_32 <= libnativehelper/JNIHelp.cpp
make: *** wait: No child processes. Stop.

#### make failed to build some targets (34:11 (mm:ss)) ####

解决办法:
修改:
在build/core/clang/Host_x86_common.mk
在第7 - 11行左右位置
ifeq ($(HOST_OS),linux)
CLANG_CONFIG_x86_LINUX_HOST_EXTRA_ASFLAGS := \
--gcc-toolchain=$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG) \
--sysroot=$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/sysroot \
-B$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/x86_64-linux/bin \
-no-integrated-as
添加 -B$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/x86_64-linux/bin \ 这行

猜你喜欢

转载自blog.csdn.net/fmc088/article/details/80333697