|
Ubuntu16.04编译Android6.0通过,步骤
发表于 2017-3-18 17:43:50
浏览:11930
|
回复:5
打印
只看该作者
[复制链接]
楼主
本帖最后由 leung先森 于 2018-10-14 00:09 编辑
按照wiki ubuntu14.04的环境安装后再进行后面操作。
16.04默认的源找不到openjdk-7 ,给添加一个源
sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update
sudo apt-get install openjdk-7-jdk
安装完后注意当前jdk版本
sudo update-alternatives --config java
sudo update-alternatives --config javac
-------------------------------------------------
上层编译
出现错误:
clang: error: linker command failed with exit code 1 (use -v to see invocation)
build/core/host_shared_library_internal.mk:51: recipe for target 'out/host/linux-x86/obj32/lib/libart.so' failed
make: *** [out/host/linux-x86/obj32/lib/libart.so] Error 1
原因:ubuntu16.04 clang编译器导致的问
1.关闭clang,修改art/build/Android.common_build.mk ,中将host 默认编辑器使用clang关掉,找到WITHOUT_HOST_CLANG
修改如下:
# Host.
ART_HOST_CLANG := false
ifneq ($(WITHOUT_HOST_CLANG),true)
# By default, host builds use clang for better warnings.
ART_HOST_CLANG := false
endif
2. 安装环境
sudo apt install git-core gnupg flex bison gperf build-essentialzip \
curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386lib32ncurses5-dev \
x11proto-core-dev libx11-dev lib32z-dev ccache libgl1-mesa-dev \
libxml2-utils xsltproc unzip m4 && sudo apt-get update
无需clean继续编译即可。
-------------------
报错:
prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8//x86_64-linux/bin/ld: error: /home/hains/android/system/out/host/linux-x86/obj32/SHARED_LIBRARIES/libart_intermediates/arch/x86/quick_entrypoints_x86.o: unsupported reloc 43 against global symbol art::Runtime::instance_
---------------------
原因:编译环境ld出错,使用系统命令代替
cp /usr/bin/ld.gold prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6/x86_64-linux/bin/ld
|
|