I have a phone (Samsung Galaxy A320F (AKA "A3 (2017)") with the stock ROM that contains a 64-bit armv8l kernel (Linux 3.18.14) and 32-bit userspace with 32-bit Android 8.0.0 platform. Some Android applications provide only 64-bit NDK-based libraries, which makes them incompatible with this setup.
I've tried transferring a few ELF64 binaries to the phone, like gdb
, strace
, gphoto2
along with libc.so.6
, ld-linux-aarch64.so.1
and other parts of glibc. They run fine, so I'm confident in the kernel's ability to handle such binaries.
Now I'd like to try and make the Android platform 64-bit capable. In particular, I'm interested in making the 64-bit-only APK able to communicate with the display, touchscreen and a USB device attached to the phone. I have root access (via Magisk), so in principle, I can hack the system however I like.
My question is now: what components actually make the Android platform 32- or 64-bit? Is it just the VM, or maybe some additional libraries? Or does there have to also be a 64-bit part of the HAL? How many of these components could be taken from e.g. Lineage OS without actually installing the complete Lineage OS? Has anyone even tried to do a similar mod?
app_process
binary), linker and libc. Daemon executables (AOSP's and vendor HALs) includinginit
and other tools in/bin
directories are also 64 bit. But some daemons and HALs might still be 32-bit even on a 64-bit ROM (I quoted an example in my answer). So 64-bit ROMs include both sets of libraries (in/lib
and/lib64
) though this may change in future.armv8l
means your kernel is 64b but the userspace process querying the architecture is running in 32b personality. So what you need to run 64b-only apps (as Google is pushing developers towards 64b) is to recompile your ROM for 64b. That's not impossible but would be challenging. As I said, some core platform components were not ready for 64b and Google developers left them 32b to be ported in future (not sure about latest situation in 10 and 11). Untilzygote
is not running in 64b mode, it won't be possible to run apps built only with 64b libraries