I have a rooted Tas S9 Ultra (Android 14, Snapdragon 8 Gen 2, 16 GB of memory) which seems to have gunyah enabled by default as I can see /dev/gunyah
Is it possible to compile crosvm for Android under Termux? It would be great to be able to run VMs in Android.
I tried
cargo build
but it fails with
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
make: Entering directory '/data/data/com.termux/files/home/crosvm/third_party/minijail'
Using BASE_VER=0
cd "/data/data/com.termux/files/home/crosvm/target/debug/build/minijail-sys-d39457319737aa3e/out/" && make -r -I "/data/data/com.termux/files/home/crosvm/third_party/minijail" -f "/data/data/com.termux/files/home/crosvm/third_party/minijail/Makefile" SRC="/data/data/com.termux/files/home/crosvm/third_party/minijail" OUT="/data/data/com.termux/files/home/crosvm/target/debug/build/minijail-sys-d39457319737aa3e/out/" "all"
make[1]: Entering directory '/data/data/com.termux/files/home/crosvm/target/debug/build/minijail-sys-d39457319737aa3e/out'
Using BASE_VER=0
build configuration:
- OUT=/data/data/com.termux/files/home/crosvm/target/debug/build/minijail-sys-d39457319737aa3e/out/
- SRC=/data/data/com.termux/files/home/crosvm/third_party/minijail
- MODE=debug
- SPLITDEBUG=0
- NOSTRIP=1
- VALGRIND=0
- COLOR=1
- CXXEXCEPTIONS=0
- ARCH=aarch64
- QEMU_ARCH=aarch64
- USE_QEMU=0
- NEEDS_ROOT=0
- NEEDS_MOUNTS=0
- SYSROOT=/
CC libminijail.c -> libminijail.pic.o
make[1]: Leaving directory '/data/data/com.termux/files/home/crosvm/target/debug/build/minijail-sys-d39457319737aa3e/out'
make: Leaving directory '/data/data/com.termux/files/home/crosvm/third_party/minijail'
--- stderr
/data/data/com.termux/files/home/crosvm/third_party/minijail/libminijail.c:3948:3: error: call to undeclared function 'fexecve'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
3948 | fexecve(elf_fd, config->argv, child_env);
| ^
/data/data/com.termux/files/home/crosvm/third_party/minijail/libminijail.c:3948:3: note: did you mean 'execve'?
/data/data/com.termux/files/usr/include/unistd.h:103:5: note: 'execve' declared here
103 | int execve(const char* _Nonnull __file, char* _Nullable const* _Nullable __argv, char* _Nullable const* _Nullable __envp);
| ^
1 error generated.
warning: build failed, waiting for other jobs to finish...