Thanks for your query. On 20/06/23 12:45PM, Pengcheng Xu wrote: > Have you figured out _why_ Android is not booting? I can think of a bunch of reasons, such as missing dependencies for a dynamically-linked executable, crashing on execution, etc. Simply saying "would not boot Android" does not convey any information. The binary exits after execution in the container. Also, it is a static binary. > Besides, I don't think you need NDK for something as low-level as an init; you shouldn’t need one as long as the code does not use Android-specific functions or call into Android service (e.g. vold). You should be able to get away with something standard, i.e. newlib/musl/glibc. I haven't read the source code though, and I might be wrong here; do your survey. I had the same thoughts/arguments regarding using NDK for init. Also as far as I can tell, it does not depend any Android-specific functions either. But even then, using Gentoo's libc does not produce a working binary. Couple of things to keep in mind regarding the NDK setup: - It uses clang instead of gcc - Uses a different sysroot, which is provided/bundled in NDK itself (it is bundled according to the API level). - It uses a different STL (again, bundled with NDK). > You may try with bionic toolchain, but just as I said, so long as no Android-specific APIs are involved, libc should not be the problem. I would argue the same actually, but using Bionic is the closest we can get to have a NDK like environment without actually using NDK. If required, I could also have this week devoted entirely in rewriting `bootstrap-init`, but this would be counter-productive since the same code-base produces working binaries using a different build-system. I am open to any new advices on this topic. Regards, Gunwant > > Regards, > -- > Pengcheng Xu > https://jsteward.moe