Build LXC failed for Android

Hi, I build LXC
1.
meson setup build/ --cross-file conf/cross-file.txt -Dprefix=/data/lxc/lxc -Dinit-script= -Dman=false -Dpam-cgroup=false -Dtests=true -Dglobal-config-path=/data/lxc/containers/ -Druntime-path=/cache/

Here is cross-file.txt

[binaries]
c = ‘/lxc/android-ndk-r20b/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android29-clang’
cpp = ‘/lxc/android-ndk-r20b/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android29-clang++’
ar = ‘/lxc/android-ndk-r20b/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar’
as = ‘/lxc/android-ndk-r20b/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-as’
ranlib = ‘/lxc/android-ndk-r20b/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-ranlib’
ld = ‘/lxc/android-ndk-r20b/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-ld.gold’
strip = ‘/lxc/android-ndk-r20b/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip’
pkgconfig = ‘true’

[host_machine]
system = ‘android’
cpu_family = ‘arm’
cpu = ‘arm’
endian = ‘little’

[built-in options]
c_args = [
‘–sysroot=/lxc/android-ndk-r20b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/’,
‘-I/build/libcap/libcap/include/’]
c_link_args = [
‘–sysroot=/lxc/android-ndk-r20b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/’,
‘-fuse-ld=gold’
]

Setup log is in the here

DEPRECATION: “pkgconfig” entry is deprecated and should be replaced by “pkg-config”
The Meson build system
Version: 1.4.0
Source dir: /lxc/lxcsrc
Build dir: /lxc/lxcsrc/build
Build type: cross build
Project name: lxc
Project version: 6.0.0
C compiler for the host machine: /lxc/android-ndk-r20b/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android29-clang (clang 8.0.7 “Android (5220042 based on r346389c) clang version 8.0.7 (toolchain/clang - Git at Google b55f2d4ebfd35bf643d27dbca1bb228957008617) (toolchain/llvm - Git at Google 3c393fe7a7e13b0fba4ac75a01aa683d7a5b11cd) (based on LLVM 8.0.7svn)”)
C linker for the host machine: /lxc/android-ndk-r20b/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android29-clang ld.gold 2.27.0.20170315
C compiler for the build machine: cc (gcc 9.4.0 “cc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0”)
C linker for the build machine: cc ld.bfd 2.34
Build machine cpu family: x86_64
Build machine cpu: x86_64
Host machine cpu family: arm
Host machine cpu: arm
Target machine cpu family: arm
Target machine cpu: arm
Compiler for C supports link arguments -Wl,–no-as-needed: YES
Compiler for C supports link arguments -Wl,–gc-sections: YES
Compiler for C supports link arguments -Wl,-z,relro: YES
Compiler for C supports link arguments -Wl,-z,now: YES
Compiler for C supports link arguments -fstack-protector: YES
Compiler for C supports link arguments -fstack-protector-strong: YES
Compiler for C supports link arguments -Wl,-fuse-ld=gold: YES
Compiler for C supports link arguments -Wl,–warn-common: YES
Compiler for C supports arguments -Wno-format-signedness: NO
Compiler for C supports arguments -Wno-missing-field-initializers: YES
Compiler for C supports arguments -Wno-unused-parameter: YES
Compiler for C supports arguments -Wvla: YES
Compiler for C supports arguments -Wimplicit-fallthrough=5: NO
Compiler for C supports arguments -Wcast-align: YES
Compiler for C supports arguments -Wstrict-prototypes: YES
Compiler for C supports arguments -fno-strict-aliasing: YES
Compiler for C supports arguments -fstack-clash-protection: NO
Compiler for C supports arguments --param=ssp-buffer-size=4: YES
Compiler for C supports arguments --mcet -fcf-protection: NO
Compiler for C supports arguments -Werror=implicit-function-declaration: YES
Compiler for C supports arguments -Wlogical-op: NO
Compiler for C supports arguments -Wmissing-include-dirs: YES
Compiler for C supports arguments -Wold-style-definition: YES
Compiler for C supports arguments -Winit-self: YES
Compiler for C supports arguments -Wunused-but-set-variable: NO
Compiler for C supports arguments -Wno-unused-parameter: YES (cached)
Compiler for C supports arguments -Wfloat-equal: YES
Compiler for C supports arguments -Wsuggest-attribute=noreturn: NO
Compiler for C supports arguments -Werror=return-type: YES
Compiler for C supports arguments -Werror=incompatible-pointer-types: YES
Compiler for C supports arguments -Wformat=2: YES
Compiler for C supports arguments -Wshadow: YES
Compiler for C supports arguments -Wendif-labels: YES
Compiler for C supports arguments -Werror=overflow: YES
Compiler for C supports arguments -fdiagnostics-show-option: YES
Compiler for C supports arguments -Werror=shift-count-overflow: YES
Compiler for C supports arguments -Werror=shift-overflow=2: NO
Compiler for C supports arguments -Wdate-time: YES
Compiler for C supports arguments -Wnested-externs: YES
Compiler for C supports arguments -fasynchronous-unwind-tables: YES
Compiler for C supports arguments -fexceptions: YES
Compiler for C supports arguments -Warray-bounds: YES
Compiler for C supports arguments -Wrestrict: NO
Compiler for C supports arguments -Wreturn-local-addr: NO
Compiler for C supports arguments -fsanitize=cfi: NO
Compiler for C supports arguments -Wstringop-overflow: NO
Compiler for C supports arguments -Wno-typedef-redefinition: YES
Compiler for C supports arguments -Wno-gnu-variable-sized-type-not-at-end: YES
meson.build:262: WARNING: add_languages is missing native:, assuming languages are wanted for both host and build.
C++ compiler for the build machine: c++ (gcc 9.4.0 “c++ (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0”)
C++ linker for the build machine: c++ ld.bfd 2.34
C++ compiler for the host machine: /lxc/android-ndk-r20b/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android29-clang++ (clang 8.0.7 “Android (5220042 based on r346389c) clang version 8.0.7 (toolchain/clang - Git at Google b55f2d4ebfd35bf643d27dbca1bb228957008617) (toolchain/llvm - Git at Google 3c393fe7a7e13b0fba4ac75a01aa683d7a5b11cd) (based on LLVM 8.0.7svn)”)
C++ linker for the host machine: /lxc/android-ndk-r20b/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android29-clang++ ld.bfd 2.27.0.20170315
Compiler for C++ supports arguments -Wno-format-signedness: NO
Compiler for C++ supports arguments -Wno-missing-field-initializers: YES
Compiler for C++ supports arguments -Wno-unused-parameter: YES
Found pkg-config: YES (/usr/bin/true) true (GNU coreutils) 8.30
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later https://gnu.org/licenses/gpl.html.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Jim Meyering.
Run-time dependency dbus-1 found: YES
Program sh found: YES (/usr/bin/sh)
Program date found: YES (/usr/bin/date)
Program git found: NO
Program docbook2x-man found: YES 0.8.8 0.8.8 (/usr/bin/docbook2x-man)
Run-time dependency threads found: YES
Run-time dependency libseccomp found: YES
Checking for size of “scmp_filter_ctx” with dependency libseccomp: -1
Checking for size of “struct seccomp_notif_sizes” with dependency libseccomp: -1
Checking for size of “struct clone_args” with dependency libseccomp: -1
Run-time dependency libselinux found: YES
Run-time dependency libapparmor found: YES
Run-time dependency openssl found: YES
Run-time dependency libcap found: YES
Checking for function “cap_get_file” with dependency libcap: NO
Run-time dependency libcap found: YES
Library util found: NO
Has header “security/pam_modules.h” : NO
Checking for function “fmemopen” : YES
Checking for function “openpty” with dependency -lutil: YES
Checking for function “pthread_setcancelstate” : NO
Checking for function “rand_r” : YES
Checking for function “strchrnul” : YES
Checking for function “strerror_r” : YES
Checking if “strerror_r() returns char *” compiles: YES
Compiler for C supports function attribute fallthrough: NO
Compiler for C supports function attribute nonnull: YES
Compiler for C supports function attribute returns_nonnull: YES
Checking for size of “__aligned_u64” : 8
Checking for size of “struct clone_args” : -1
Checking for size of “struct open_how” : -1
Checking for size of “struct rtnl_link_stats64” : 192
Checking for size of “struct mount_attr” : -1
Fetching value of define “FSCONFIG_SET_FLAG” : (undefined)
Fetching value of define “FS_CONFIG_SET_STRING” : (undefined)
Fetching value of define “FS_CONFIG_SET_BINARY” : (undefined)
Fetching value of define “FS_CONFIG_SET_PATH_EMPTY” : (undefined)
Fetching value of define “FS_CONFIG_SET_PATH_FD” : (undefined)
Fetching value of define “FS_CONFIG_SET_CMD_CREATE” : (undefined)
Fetching value of define “FS_CONFIG_SET_CMD_RECONFIGURE” : (undefined)
Checking for function “bpf” : NO
Checking for function “close_range” : NO
Checking for function “execveat” : NO
Checking for function “endmntent” : YES
Checking for function “faccessat” : YES
Checking for function “fexecve” : YES
Checking for function “fgetln” : YES
Checking for function “fsconfig” : NO
Checking for function “fsmount” : NO
Checking for function “fsopen” : NO
Checking for function “fspick” : NO
Checking for function “getgrgid_r” : YES
Checking for function “getline” : YES
Checking for function “getsubopt” : YES
Checking for function “gettid” : YES
Checking for function “hasmntopt” : YES
Checking for function “kcmp” : NO
Checking for function “keyctl” : NO
Checking for function “memfd_create” : NO
Checking for function “mount_setattr” : NO
Checking for function “move_mount” : NO
Checking for function “openat2” : NO
Checking for function “open_tree” : NO
Checking for function “personality” : YES
Checking for function “pidfd_open” : NO
Checking for function “pidfd_send_signal” : NO
Checking for function “pivot_root” : NO
Checking for function “prlimit” : YES
Checking for function “prlimit64” : YES
Checking for function “renameat2” : NO
Checking for function “sethostname” : YES
Checking for function “setmntent” : YES
Checking for function “setns” : YES
Checking for function “sigdescr_np” : NO
Checking for function “signalfd” : YES
Checking for function “statvfs” : YES
Checking for function “statx” : NO
Checking for function “strchrnul” : YES (cached)
Checking for function “strlcat” : YES
Checking for function “strlcpy” : YES
Checking for function “unshare” : YES
Has header “sys/resource.h” : YES
Has header “sys/memfd.h” : NO
Has header “sys/personality.h” : YES
Has header “sys/pidfd.h” : NO
Has header “sys/signalfd.h” : YES
Has header “sys/timerfd.h” : YES
Has header “pty.h” : YES
Has header “utmpx.h” : NO
Configuring config.h using configuration
Configuring attach_options.h using configuration
Configuring lxccontainer.h using configuration
Configuring version.h using configuration
Configuring lxc.functions using configuration
Configuring lxc-containers using configuration
Configuring usr.bin.lxc-start using configuration
Configuring usr.bin.lxc-copy using configuration
Configuring container-base using configuration
Configuring start-container using configuration
Configuring lxc-default using configuration
Configuring lxc-default-cgns using configuration
Configuring lxc-default-with-mounting using configuration
Configuring lxc-default-with-nesting using configuration
Configuring _lxc using configuration
Configuring default.conf using configuration
Configuring lxc-containers using configuration
Configuring lxc-net using configuration
Configuring lxc-apparmor-load using configuration
Configuring lxc using configuration
Configuring lxc.if using configuration
Configuring lxc.te using configuration
Configuring common.seccomp using configuration
Configuring common.conf using configuration
Configuring nesting.conf using configuration
Configuring oci.common.conf using configuration
Configuring userns.conf using configuration
Configuring README using configuration
Configuring lxc-patch.py using configuration
Configuring lxc-complex.conf using configuration
Configuring lxc-empty-netns.conf using configuration
Configuring lxc-macvlan.conf using configuration
Configuring lxc-no-netns.conf using configuration
Configuring lxc-phys.conf using configuration
Configuring lxc-veth.conf using configuration
Configuring lxc-vlan.conf using configuration
Configuring seccomp-v1.conf using configuration
Configuring seccomp-v2.conf using configuration
Configuring seccomp-v2-denylist.conf using configuration
Configuring README using configuration
Configuring clonehostname using configuration
Configuring dhclient-script using configuration
Configuring dhclient using configuration
Configuring mountecryptfsroot using configuration
Configuring nvidia using configuration
Configuring squid-deb-proxy-client using configuration
Configuring ubuntu-cloud-prep using configuration
Configuring lxc-checkconfig using configuration
Configuring lxc-update-config using configuration
Configuring lxc-test-apparmor-generated using configuration
Configuring lxc-test-apparmor-mount using configuration
Configuring lxc-test-automount using configuration
Configuring lxc-test-autostart using configuration
Configuring lxc-test-checkpoint-restore using configuration
Configuring lxc-test-cloneconfig using configuration
Configuring lxc-test-createconfig using configuration
Configuring lxc-test-exit-code using configuration
Configuring lxc-test-lxc-attach using configuration
Configuring lxc-test-no-new-privs using configuration
Configuring lxc-test-procsys using configuration
Configuring lxc-test-rootfs using configuration
Configuring lxc-test-snapdeps using configuration
Configuring lxc-test-symlink using configuration
Configuring lxc-test-unpriv using configuration
Configuring lxc-test-usernic using configuration
Configuring lxc-test-usernsexec using configuration
Configuring lxc-busybox using configuration
Configuring lxc-download using configuration
Configuring lxc-local using configuration
Configuring lxc-oci using configuration
Configuring lxc.spec using configuration
Message: lxc 6.0.0
Meson version: 1.4.0
prefix directory: /data/lxc/lxc
bin directory: /data/lxc/lxc/bin
data directory: /data/lxc/lxc/share
doc directory: /data/lxc/lxc/share/doc/lxc
include directory: /data/lxc/lxc/include
lib directory: /data/lxc/lxc/lib
libexec directory: /data/lxc/lxc/libexec
local state directory: /var
sbin directory: /data/lxc/lxc/sbin
sysconf directory: /data/lxc/lxc/etc
lxc cgroup pattern:
lxc init directory: /data/lxc/lxc/libexec
runtime path: /cache/
lxc default config: /data/lxc/containers/default.conf
lxc global config: /data/lxc/containers/lxc.conf
lxc hook directory: /data/lxc/lxc/share/lxc/hooks
lxc hook bin directory: /data/lxc/lxc/libexec/lxc/hooks
lxc rootfs mount directory: /data/lxc/lxc/lib/lxc/rootfs
log path: /var/log/lxc
lxc path: /var/lib/lxc
lxc template config: /data/lxc/lxc/share/lxc/config
lxc template directory: /data/lxc/lxc/share/lxc/templates
lxc user network config: /data/lxc/lxc/etc/lxc/lxc-usernet
lxc user network database: /cache/lxc/nics
time epoch: 1713324890 (2024-04-17T03:34:50+00:00)

 supported dependencies:	AppArmor, SECCOMP, SELinux, libcap, static libcap, openssl
 
 unsupported dependencies:	pam, liburing
 
 
 supported headers:	sys/resource.h, sys/personality.h, sys/signalfd.h, sys/timerfd.h, pty.h
 
 unsupported headers:	sys/memfd.h, sys/pidfd.h, utmpx.h
 
 
 supported calls:	strchrnul, strerror_r
 
 unsupported calls:	bpf, close_range, endmntent, execveat, faccessat, fgetln, fsconfig, fsmount, fsopen, fspick, getgrgid_r, getline, getsubopt, gettid, hasmntopt, kcmp, keyctl, memfd_create, mount_setattr, move_mount, openat2, open_tree, personality, pidfd_open, pidfd_send_signal, pivot_root, prlimit, prlimit64, renameat2, sethostname, setmntent, setns, sigdescr_np, signalfd, statx, statvfs, strlcat, strlcpy, unshare
 
 
 supported types:	__aligned_u64, struct rtnl_link_stats64
 
 unsupported types:	scmp_filter_ctx, struct seccomp_notif_sizes, struct clone_args, struct open_how, struct mount_attr (sys/mount.h), FSCONFIG_SET_FLAG (sys/mount.h), FS_CONFIG_SET_STRING (sys/mount.h), FS_CONFIG_SET_BINARY (sys/mount.h), FS_CONFIG_SET_PATH_EMPTY (sys/mount.h), FS_CONFIG_SET_PATH_FD (sys/mount.h), FS_CONFIG_SET_CMD_CREATE (sys/mount.h), FS_CONFIG_SET_CMD_RECONFIGURE (sys/mount.h)

Build targets in project: 70
NOTICE: Future-deprecated features used:

  • 1.1.0: {‘“boolean option” keyword argument “value” of type str’}

lxc 6.0.0

User defined options
Cross files : conf/cross-file.txt
prefix : /data/lxc/lxc
global-config-path: /data/lxc/containers/
init-script :
man : false
pam-cgroup : false
runtime-path : /cache/
tests : true

Found ninja-1.11.1.git.kitware.jobserver-1 at /usr/local/bin/ninja

=====

ninja -C build
Build log is in here

ninja: Entering directory `build’
[1/1261] Compiling C object src/lxc/liblxc.a.p/lsm_lsm.c.o
FAILED: src/lxc/liblxc.a.p/lsm_lsm.c.o
/lxc/android-ndk-r20b/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android29-clang -Isrc/lxc/liblxc.a.p -Isrc/lxc -I…/src/lxc -I. -I… -Isrc -I…/src -Isrc/include -I…/src/include -I…/src/lxc/cgroups -I…/src/lxc/storage -I/build/libcap/libcap/include/ -flto=thin -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu11 -O0 -g -Wno-missing-field-initializers -Wno-unused-parameter -Wvla -Wcast-align -Wstrict-prototypes -fno-strict-aliasing --param=ssp-buffer-size=4 -Werror=implicit-function-declaration -Wmissing-include-dirs -Wold-style-definition -Winit-self -Wno-unused-parameter -Wfloat-equal -Werror=return-type -Werror=incompatible-pointer-types -Wformat=2 -Wshadow -Wendif-labels -Werror=overflow -fdiagnostics-show-option -Werror=shift-count-overflow -Wdate-time -Wnested-externs -fasynchronous-unwind-tables -fexceptions -Warray-bounds -Wno-typedef-redefinition -Wno-gnu-variable-sized-type-not-at-end -include config.h --sysroot=/lxc/android-ndk-r20b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/ -fPIC -pthread -fvisibility=default -DIN_LIBLXC -MD -MQ src/lxc/liblxc.a.p/lsm_lsm.c.o -MF src/lxc/liblxc.a.p/lsm_lsm.c.o.d -o src/lxc/liblxc.a.p/lsm_lsm.c.o -c …/src/lxc/lsm/lsm.c
In file included from …/src/lxc/lsm/lsm.c:12:
In file included from …/src/lxc/conf.h:18:
…/src/lxc/caps.h:22:42: error: unknown type name ‘cap_value_t’
__hidden extern bool lxc_proc_cap_is_set(cap_value_t cap, cap_flag_t flag);
^
…/src/lxc/caps.h:22:59: error: unknown type name ‘cap_flag_t’
__hidden extern bool lxc_proc_cap_is_set(cap_value_t cap, cap_flag_t flag);
^
…/src/lxc/caps.h:23:60: error: unknown type name ‘cap_value_t’
__hidden extern bool lxc_file_cap_is_set(const char *path, cap_value_t cap, cap_flag_t flag);
^
…/src/lxc/caps.h:23:77: error: unknown type name ‘cap_flag_t’
__hidden extern bool lxc_file_cap_is_set(const char *path, cap_value_t cap, cap_flag_t flag);
^
In file included from …/src/lxc/lsm/lsm.c:12:
In file included from …/src/lxc/conf.h:22:
…/src/lxc/lxcseccomp.h:12:10: fatal error: ‘seccomp.h’ file not found
#include <seccomp.h>
^~~~~~~~~~~
5 errors generated.

====

I have already installed libcap-dev. But can’t find it?
Anyone can help?.Thanks.