How to add new or missing native ndk function
Our libc-shim wrapper are split across multiple cpp files, all have a structure like https://github.com/minecraft-linux/libc-shim/blob/master/src/common.cpp#L334-L350.
"__errno"
is the name of the libc symbolbionic::get_errno
is a function or global pointer with the same type and calling convention as the ndk provided function. Linux armhf has a different calling convention than android armeabi-v7a, you have to wrap all functions with floating point arguments or return values, useARMHFREWRITE(bionic::get_errno)
to automatically wrap it in c++. Windows uses different calling conventions than linux, macOS and Android.
Stub libraries are libraries without the need of an android shared library file, which implements symbols of real shared libraries. You can call linker::dlopen
and linker::dlsym
on them to get the pointer of the function or global object.
"__errno"
is the name of the symbolbionic::get_errno
is a function or global pointer with the same type and calling convention as the ndk provided function. Linux armhf has a different calling convention than android armeabi-v7a, you have to wrap all functions with floating point arguments or return values, useARMHFREWRITE(bionic::get_errno)
to automatically wrap it in c++. Windows uses different calling conventions than linux, macOS and Android.