Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What is necessary to run Linux ARM64 binaries on Android ARM64?

To run conda-forge arm64 Linux binaries on Android in termux requires proot-distro because the ABIs are slightly different FWIU.

What is necessary to run Android ARM64 binaries on Linux ARM64?

Android Studio, LineageOS or BlissOS's outdated Android containers, a runtime like vinegarhq/sober that emulates just enough of Android.

An Android binary that makes Linux compatible syscalls only (that doesn't require Android libraries that aren't compiled for Linux) won't work will it?



A fully statically compiled Linux ARM64 binary which only interacts with the kernel through syscalls should run no problem on ARM64 Android. From the kernel's perspective, there is no difference between a "Linux binary" and an "Android binary" because the kernel in Android is Linux.

Most programs want to interact with various system libraries and system services though. Android and your typical desktop Linux system share pretty much nothing aside from the kernel.


Why is it easier to run a Linux ARM64 binary on Android than to run an Android ARM64 binary on Linux?

My guess is that the reason is the same reason that there aren't official updated Android containers


I don't know what you mean by an "Android ARM64 binary". If you make an ELF file containing ARM64 machine code, it doesn't matter to Linux whether you meant for it to run on Linux in an Android system, on Linux in a desktop GNU system, or on Linux in some environment with without much of a userspace at all (such as a stripped down initramfs environment).

If you mean something like an Android app, the answer is that there's a ton of system stuff that the app depends on, it interacts with more than just the kernel.


.

  CC= clang
  CXX=clang++
  $CC hello.c -o hello_android_c
  $CXX hello.cpp -o hello_android_cpp -static-libstdc++
  $CXX hello_asm.cpp -o hello_android_cpp_asm_syscalls_only -ffreestanding -nostdlib -fuse-ld=lld
  find -name hello_android -exec readelf -l {} \;
But go binaries don't require (bionic) libc unless you compile with CGO_ENABLED=1


Only if they restrict themselves to the officially supported syscalls, otherwise Android will kill the application.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: