当前位置:   article > 正文

解决: AOSP 编译AndroidQ preview 失败_double_loadable

double_loadable

拉了网上最新的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
  • 1
  • 2
  • 3
  • 4

难道是我的本地代码有问题?然后我执行:

python repo forall -c git reset --hard
python repo sync
  • 1
  • 2

结果之后编译还是报错。

然后百度了一下,发现,好吧,不行。

还是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",
    ],
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19

增加了 double_loadable:true,

注意:
如果你的报错和我的不太一样,你要看你的报错的地方,他会告诉你哪个地方没有设置double_loadable

 links a library "libselinux" which is not LL-NDK, VNDK-SP, or explicitly marked as 'double_loadable:true'. 
  • 1

总结:

1.其实编译报错,哪里出错,人家都说了。你要尝试去理解。 解决问题的关键一定在报错里面。

2.自己英文还是太差。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/不正经/article/detail/294135
推荐阅读
相关标签
  

闽ICP备14008679号