gpt4 book ai didi

android - ubuntu 15.10 64位构建Android源码5.0版本

转载 作者:太空宇宙 更新时间:2023-11-04 05:56:38 24 4
gpt4 key购买 nike

我该如何解决这个问题?当我使用 构建 5.0 的 Android 源代码时'make -j4',它引起了问题。这是错误日志:

Install: out/host/linux-x86/bin/acp
Yacc: aidl <= frameworks/base/tools/aidl/aidl_language_y.y
prebuilts/misc/linux-x86/bison/bison -d -o out/host/linux-x86/obj32/EXECUTABLES/aidl_intermediates/aidl_language_y.cpp frameworks/base/tools/aidl/aidl_language_y.y
Lex: aidl <= frameworks/base/tools/aidl/aidl_language_l.l
logtags: out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/src/core/java/android/content/EventLogTags.java <= frameworks/base/core/java/android/content/EventLogTags.logtags
prebuilts/misc/linux-x86/bison/bison: m4 子进程失败
build/core/binary.mk:539: recipe for target 'out/host/linux-x86/obj32/EXECUTABLES/aidl_intermediates/aidl_language_y.cpp' failed
make: *** [out/host/linux-x86/obj32/EXECUTABLES/aidl_intermediates/aidl_language_y.cpp] Error 1
make: *** 正在等待未完成的任务....
frameworks/base/tools/aidl/aidl_language_l.l:55: warning, 无法匹配规则
flex-2.5.39: fatal internal error, exec of /usr/bin/m4 failed
build/core/binary.mk:576: recipe for target 'out/host/linux-x86/obj32/EXECUTABLES/aidl_intermediates/aidl_language_l.cpp' failed
make: *** [out/host/linux-x86/obj32/EXECUTABLES/aidl_intermediates/aidl_language_l.cpp] Error 1
make: *** Deleting file 'out/host/linux-x86/obj32/EXECUTABLES/aidl_intermediates/aidl_language_l.cpp'
logtags: out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/src/core/java/android/speech/tts/EventLogTags.java <= frameworks/base/core/java/android/speech/tts/EventLogTags.logtags

最佳答案

就我而言,构建棉花糖时出现类似的错误 6.0.1_r1在 Ubuntu 18.04 中。

如果您遇到类似的错误:

build/core/binary.mk:646: recipe for target 'out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_l.cpp' failed
make: *** [out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_l.cpp] Aborted (core dumped)

仔细看这一行,是core dumped ,所以我使用 coredumpctl list ,使用 G 导航到列表末尾,然后找出核心转储执行路径(右列)为 prebuilts/misc/linux-x86/flex/flex-2.5.39

还有PREBUILT文件显示:

xb@dnxb:~/my_android_src/prebuilts/misc/linux-x86/flex$ cat PREBUILT 
The objects in this prebuilt directory can be rebuilt
using the source archive hosted at

http://sourceforge.net/projects/flex/files/

Commands:

./configure
make CFLAGS="-static" LDFLAGS="-static"
# (Disregard the errors at the end of the build)
rm flex
make CFLAGS="-static" LDFLAGS="-static" flex
# Copy the linker command line, replace it with static libm.a
gcc -static -static -o flex ccl.o dfa.o ecs.o scanflags.o gen.o main.o misc.o nfa.o parse.o scan.o skel.o sym.o tblcmp.o yylex.o options.o scanopt.o buf.o tables.o tables_shared.o filter.o regex.o /usr/lib/x86_64-linux-gnu/libm.a
xb@dnxb:~/my_android_src/prebuilts/misc/linux-x86/flex$

就是这样,前两行表示,如果自此 flex-2.5.39 以来出现问题,您可能需要重建自己。二进制文件是在另一个平台中预先构建的。

所以只需解压 flex-2.5.39.tar.gz该目录的,转到提取的 flex-2.5.39目录,然后是 PREBUILT上面的说明。

简而言之,您需要执行以下步骤:

    cd <ANDROID_TREE_DIR>/prebuilts/misc/linux-x86/flex
tar -zxvf flex-2.5.39.tar.gz
cd flex-2.5.39
make CFLAGS="-static" LDFLAGS="-static"
rm flex
make CFLAGS="-static" LDFLAGS="-static" flex
/bin/bash ./libtool --tag=CC --mode=link gcc -static -static -o flex ccl.o dfa.o ecs.o scanflags.o gen.o main.o misc.o nfa.o parse.o scan.o skel.o sym.o tblcmp.o yylex.o options.o scanopt.o buf.o tables.o tables_shared.o filter.o regex.o lib/libcompat.la /usr/lib/x86_64-linux-gnu/libm.a
cd ..
cp flex-2.5.39/flex .
mv flex flex-2.5.39
ls -la
flex-2.5.39 #### <<- YOUR new generated file
flex-2.5.39.tar.gz
MODULE_LICENSE_BSD_LIKE
NOTICE
PREBUILT

现在尝试做make <module> -j4再次,不再因此类错误而中止。

p/s:替代方法是 LANG=C make pm -j4如果您看到类似 LC_* 的内容错误消息。

p/s2:我还需要符号链接(symbolic link) ld如下固定'out/host/linux-x86/obj/lib/libart.so' failederror: unsupported reloc 42 :

xb@dnxb:~/my_android_src$ cp prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8//x86_64-linux/bin/ld ../ld_bk #backup android source's ld first
xb@dnxb:~/my_android_src$ rm prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8//x86_64-linux/bin/ld #remove android source's ld
xb@dnxb:~/my_android_src$ ln -s /usr/bin/ld.gold prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8//x86_64-linux/bin/ld #create symlink for android source's ld to system's ld.gold

关于android - ubuntu 15.10 64位构建Android源码5.0版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36618935/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com