RFR: 8370659: [mobile] enable static-libs-image for Android [v2]

Johan Vos jvos at openjdk.org
Thu Jan 8 08:28:13 UTC 2026


On Wed, 7 Jan 2026 12:43:58 GMT, Julian Waters <jwaters at openjdk.org> wrote:

> > There were a lot of these BIONIC ifdefs. I must admit I don't even know what bionic is; it seems to be the android libc? Maybe we should make it more explicit, like ANDROID_LIBC or ANDROID_BIONIC?
> 
> Bionic is indeed the Android C runtime library. Not sure if that's a built in compiler define or if it's defined by a header though?

In practice, Android uses the bionic libc, although the 1-1 coupling is in theory not required. I try to check on __ANDROID__  when dealing with platform-code, and check on __BIONIC__ when dealing with libc code.

__BIONIC__ is defined in the standard headers of the (Android) NDK. This is similar to how __GLIBC__ is defined.
In e.g. os_linux.cpp, there are a number of checks on __GLIBC__, __MUSL_LIBC and __BIONIC__ because the corresponding libc variants are slightly different. Note that in case of musl, there is no built-in equivalent of __GLIBC__ and __BIONIC__, so that one is set in flags-cflags.m4

-------------

PR Comment: https://git.openjdk.org/mobile/pull/40#issuecomment-3722758768


More information about the mobile-dev mailing list