赞
踩
拉了网上最新的AOSP 代码,编译结果报错:如下图
LLFAILED: /media/caoxinyu/TomasYu/out-x86/Out_Q/soong/build.ninja
/media/caoxinyu/TomasYu/out-x86/Out_Q/soong/.bootstrap/bin/soong_build -t -l /media/caoxinyu/TomasYu/out-x86/Out_Q/.module_paths/Android.bp.list -b /media/caoxinyu/TomasYu/out-x86/Out_Q/soong -n /media/caoxinyu/TomasYu/out-x86/Out_Q -d /media/caoxinyu/TomasYu/out-x86/Out_Q/soong/build.ninja.d -globFile /media/caoxinyu/TomasYu/out-x86/Out_Q/soong/.bootstrap/build-globs.ninja -o /media/caoxinyu/TomasYu/out-x86/Out_Q/soong/build.ninja Android.bp
error: frameworks/native/libs/gui/Android.bp:20:1: module "libgui" variant "android_x86_x86_64_core_shared_asan": links a library "libselinux" which is not LL-NDK, VNDK-SP, or explicitly marked as 'double_loadable:true'. (dependency: libgui -> libbufferhubqueue -> libpdx_default_transport -> libselinux)
09:26:01 soong bootstrap failed with: exit status 1
难道是我的本地代码有问题?然后我执行:
python repo forall -c git reset --hard
python repo sync
结果之后编译还是报错。
然后百度了一下,发现,好吧,不行。
还是google 吧。
Just adding double_loadable:true in libselinux bp solves this issue,
as in the error report suggestion. And there was no issue in bootup
upon this build image. google 论坛
https://groups.google.com/forum/#!topic/android-building/67sFi481Gto
他说可以根据报错,把libselinux bp 修改一下。但是这个在哪里,也没说。
好吧,我自己找了半天也没有找到。
最后去google 搜索:aosp libselinux
https://android.googlesource.com/platform/external/libselinux/
OK,可能是在aosp/external 下面。看了下,果然有。但是没有libselinux.bp.这下面有Android.bp
ok,修改下。编译可以了。
修改路径如下:
去aosp/external/selinux/libselinux 下修改下Android.bp
修改内容如下:
cc_library { name: "libselinux", defaults: ["libselinux_defaults"], vendor_available: true, vndk: { enabled: true, }, recovery_available: true, double_loadable:true, host_supported: true, cflags: ["-DUSE_PCRE2"], srcs: [ "src/label_file.c", "src/regex.c", ],
增加了 double_loadable:true,
注意:
如果你的报错和我的不太一样,你要看你的报错的地方,他会告诉你哪个地方没有设置double_loadable
links a library "libselinux" which is not LL-NDK, VNDK-SP, or explicitly marked as 'double_loadable:true'.
1.其实编译报错,哪里出错,人家都说了。你要尝试去理解。 解决问题的关键一定在报错里面。
2.自己英文还是太差。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。