예제 #1
0
def main():
    tmp_dir = tempfile.mkdtemp()
    adb_pull('/system/lib/libc.so', tmp_dir)
    adb_pull('/system/lib/libm.so', tmp_dir)

    current = symbols.GetFromAndroidSo(['libc.so', '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'])

    missing_symbols = current - device
    compat_not_covered = missing_symbols - compat_lib

    for symbol in sorted(compat_not_covered):
        print symbol
  '__res_mkquery': 'res_mkquery',
  '__res_query': 'res_query',
  '__res_search': 'res_search',
  '__xpg_basename': '__gnu_basename',
}

glibc = symbols.GetFromSystemSo([
    'libc.so.*',
    'librt.so.*',
    'libpthread.so.*',
    'libresolv.so.*',
    'libm.so.*',
    'libutil.so.*',
])

bionic = symbols.GetFromAndroidSo(['libc.so', 'libm.so'])
this_dir = os.path.dirname(os.path.realpath(__file__))
posix = symbols.GetFromTxt(os.path.join(this_dir, 'posix-2013.txt'))
ndk_ignored = GetNdkIgnored(arch)

glibc = set(map(MangleGlibcNameToBionic, glibc))

# bionic includes various BSD symbols to ease porting other BSD-licensed code.
bsd_stuff = set([
  'basename_r',
  'dirname_r',
  'fgetln',
  'fpurge',
  'funopen',
  'gamma_r',
  'gammaf_r',