在编译 Android 6.0 源码是,42 43 我都遇到过,亲测有效:
我的问题是error: unsupported reloc 42,修改源码根目录下的art/build/Android.common_build.mk就没问题了。
in file art/build/Android.common_build.mk, find out:
# Host.
ART_HOST_CLANG := false
ifneq ($(WITHOUT_HOST_CLANG),true)
# By default, host builds use clang for better warnings.
ART_HOST_CLANG := true
endif
change to :
# Host.
ART_HOST_CLANG := false
ifeq ($(WITHOUT_HOST_CLANG),false)
# By default, host builds use clang for better warnings.
ART_HOST_CLANG := true
endif
If it still not works,try this in your android root path:
cp /usr/bin/ld.gold prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6/x86_64-linux/bin/ld
原因:
先看ld是做什么的
ld 合并 一组 目标文件(object) 和 库文件(archive), 重定位 数据部分, 构建 符号引用(symbol reference). 一般说来, 编译 生成 可执行文件 的 最后步骤 就是 调用 ld.
ld 可以读取 用 连接器命令语言(Linker Command Language) 编写的 脚本文件, 它能够 对 连接过程 提供 精确 和 全面 的 控制. 本 手册页 不讨论 命令语言; 可参看 info' 的
ld’ 项, 或者 手册 ld: the GNU linker , 里面有 命令语言 的 细节和 其他 GNU linker 的 内容.
自己认为是连接器版本和本机不匹配,所以将本机的连接器拷贝过去。