编译Rk3288源码

记录一下编译RK3288的过程,编译参考官方网站官方社区

获取源码

git reset

编译内核

compie-kernel

make-kernel

kernel-success

编译系统

build-sh

make-error

change-jdk

make-success

编译过程中的问题

错误详情1:

1
2
prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6//x86_64-linux/bin/ld: error: out/host/linux-x86/obj32/SHARED_LIBRARIES/libnativehelper_intermediates/JNIHelp.o: unsupported reloc 43 against global symbol std::string::_Rep::_S_empty_rep_storage
prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6//x86_64-linux/bin/ld: error: out/host/linux-x86/obj32/SHARED_LIBRARIES/libnativehelper_intermediates/JNIHelp.o: unsupported reloc 43 against global symbol std::string::_Rep::_S_empty_rep_storage
  • 解决办法:
    1
    2
    3
    cd prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6/x86_64-linux/bin/
    mv ld ld.old
    ln -s /usr/bin/ld.gold ld

错误详情2:

1
build/core/droiddoc.mk:158: recipe for target 'out/target/common/docs/system-api-stubs-timestamp' failed
  • 解决办法:
    修改droiddc.mk的194行
    1
    vim build/core/droiddoc.mk

修改之后如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
##
##
## standard doclet only
##
##
$(full_target): $(full_src_files) $(full_java_lib_deps)
@echo Docs javadoc: $(PRIVATE_OUT_DIR)
##@mkdir -p $(dir $@)
@mkdir -p $@
$(call prepare-doc-source-list,$(PRIVATE_SRC_LIST_FILE),$(PRIVATE_JAVA_FILES), \
$(PRIVATE_SOURCE_INTERMEDIATES_DIR) $(PRIVATE_ADDITIONAL_JAVA_DIR))
$(hide) ( \
javadoc \
-encoding UTF-8 \
$(PRIVATE_DROIDDOC_OPTIONS) \
\@$(PRIVATE_SRC_LIST_FILE) \
-J-Xmx1024m \
-XDignore.symbol.file \
$(PRIVATE_PROFILING_OPTIONS) \
$(addprefix -classpath ,$(PRIVATE_CLASSPATH)) \
$(addprefix -bootclasspath ,$(PRIVATE_BOOTCLASSPATH)) \
-sourcepath $(PRIVATE_SOURCE_PATH)$(addprefix :,$(PRIVATE_CLASSPATH)) \
-d $(PRIVATE_OUT_DIR) \
-quiet \
&& touch -f $@ \
) || (rm -rf $(PRIVATE_OUT_DIR) $(PRIVATE_SRC_LIST_FILE); exit 45)

错误详情3

1
2
3
4
5
6
7
8
9
10
11
12
13
target thumb C++: hwcomposer.rk30board <= hardware/rockchip/hwcomposer/rk_hwcomposer.cpp
target thumb C++: hwcomposer.rk30board <= hardware/rockchip/hwcomposer/rk_hwc_com.cpp
arm-linux-androideabi-g++: error: update: No such file or directory
arm-linux-androideabi-g++: error: RKUpdateService_box.apk: No such file or directory
arm-linux-androideabi-g++: error: for: No such file or directory
arm-linux-androideabi-g++: error: fix: No such file or directory
arm-linux-androideabi-g++: error: crach: No such file or directory
arm-linux-androideabi-g++: error: when: No such file or directory
arm-linux-androideabi-g++: error: check: No such file or directory
arm-linux-androideabi-g++: error: update": No such file or directory
build/core/binary.mk:620: recipe for target 'out/target/product/rk3288_box/obj/SHARED_LIBRARIES/hwcomposer.rk30board_intermediates/rk_hwcomposer.o' failed
make: *** [out/target/product/rk3288_box/obj/SHARED_LIBRARIES/hwcomposer.rk30board_intermediates/rk_hwcomposer.o] Error 1
make: *** Waiting for unfinished jobs....
  • 解决办法: 对hardware/rockchip/hwcomposer下的文件转换文本格式:find . -type f -exec dos2unix {} \;