赞
踩
1、初始化android P源码编译环境
参见 Ubuntu 18.04编译Android8.1 automotive
源码下载:
repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest -b android-p-preview-4
2、lunch选择
lunch aosp_cf_x86_auto-userdebug
3、编译出现的问题
(1)device/google/cuttlefish_common/guest/hals/gralloc/legacy/gralloc_vsoc_priv.h:163:3: error: use of undeclared identifier 'memset'
memset(out, 0, sizeof(*out));
^
1 error generated.
[ 7% 4278/60968] target C++: vdc <= system/vold/vdc.cpp
ninja: build stopped: subcommand failed.
缺少 memset 函数定义,修改文件device/google/cuttlefish_common/guest/hals/gralloc/legacy/gralloc_vsoc_priv.h,增加
#include <string.h>
(2)external/f2fs-tools/lib/libf2fs_io.c:302:5: error: incompatible pointer types passing 'int (void *, const void *, int, unsigned int, unsigned int)' to parameter of type 'int (*)(void *, const void *, size_t, unsigned int, unsigned int)' (aka 'int (*)(void *, const void *, unsigned int, unsigned int, unsigned int)') [-Werror,-Wincompatible-pointer-types]
ninja: build stopped: subcommand failed.
与 sparse.h 定义的参数类型不匹配,修改文件external/f2fs-tools/lib/libf2fs_io.c,函数参数 int len 更改为 size len
- #static int sparse_import_segment(void *UNUSED(priv), const void *data, int len, unsigned int block, unsigned int nr_blocks)
- static int sparse_import_segment(void *UNUSED(priv), const void *data, size_t len, unsigned int block, unsigned int nr_blocks)
(3)external/e2fsprogs/lib/ext2fs/sparse_io.c:114:9: error: incompatible pointer types passing 'int (void *, const void *, int, unsigned int, unsigned int)' to parameter of type 'int (*)(void *, const void *, size_t, unsigned int, unsigned int)' (aka 'int (*)(void *, const void *, unsigned int, unsigned int, unsigned int)') [-Werror,-Wincompatible-pointer-types]
sparse_import_segment, sm);
^~~~~~~~~~~~~~~~~~~~~
system/core/libsparse/include/sparse/sparse.h:227:8: note: passing argument to parameter 'write' here
int (*write)(void *priv, const void *data, size_t len, unsigned int block,
^
1 error generated.
[ 8% 4857/54001] //external/e2fsprogs/lib/ext2fs:libext2fs clang unix_io.c
ninja: build stopped: subcommand failed.
与 sparse.h 定义的参数类型不匹配,修改文件external/e2fsprogs/lib/ext2fs/sparse_io.c,函数参数 int len 更改为 size len
- #static int sparse_import_segment(void *priv, const void *data, int len, unsigned int block, unsigned int nr_blocks)
- static int sparse_import_segment(void *priv, const void *data, size_t len, unsigned int block, unsigned int nr_blocks)
(4)FAILED: out/target/product/vsoc_x86/obj/ETC/sepolicy_neverallows_intermediates/sepolicy_neverallows
ninja: build stopped: subcommand failed.
SEAndroid 安全策略冲突,更改system/sepolicy/public/domain.te,更改代码 sysfs_type 为 -sysfs_type 如下:
- neverallow domain {
- proc_type
- -sysfs_type
- }:dir { add_name create link remove_name rename reparent rmdir write };
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。