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
diff --git a/libc/tools/ndk_missing_symbols.py b/libc/tools/ndk_missing_symbols.py
index 7b22ca8..a9f92b1 100755
--- a/libc/tools/ndk_missing_symbols.py
+++ b/libc/tools/ndk_missing_symbols.py
@@ -33,10 +33,14 @@
     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