Add a basic NDK compatibility library.

We know we can safely statically link `libm`, since it doesn't have
any dependencies on the OS or the layout of a data type that has
changed between releases (like `pthread_t`).

We can safely statically link `libc_syscalls` because the user can
check for and handle `ENOSYS`.

Update `ndk_missing_symbols.py` to account for symbols that are in the
compatibility library.

Improve `symbols.py` to be able to pull symbols from a static library.

Change-Id: Ifb0ede1e8b4a8f0f33865d9fed72fb8b4d443fbc
This commit is contained in:
Dan Albert
2015-01-21 17:50:29 -08:00
parent d1668a71df
commit 9c3fd59b00
3 changed files with 47 additions and 7 deletions

View File

@@ -33,10 +33,14 @@ def main():
adb_pull('/system/lib/libm.so', tmp_dir)
current = symbols.GetFromAndroidSo(['libc.so', 'libm.so'])
device = (symbols.GetFromSo(os.path.join(tmp_dir, 'libc.so')) |
symbols.GetFromSo(os.path.join(tmp_dir, 'libm.so')))
device = (symbols.GetFromElf(os.path.join(tmp_dir, 'libc.so')) |
symbols.GetFromElf(os.path.join(tmp_dir, 'libm.so')))
compat_lib = symbols.GetFromAndroidStaticLib(['libc_ndk.a'])
for symbol in sorted(current - device):
missing_symbols = current - device
compat_not_covered = missing_symbols - compat_lib
for symbol in sorted(compat_not_covered):
print symbol