diff options
author | Hsin-Yi Chen <hsinyichen@google.com> | 2018-03-02 11:38:02 +0800 |
---|---|---|
committer | Hsin-Yi Chen <hsinyichen@google.com> | 2018-03-16 11:05:21 +0000 |
commit | 8554463403ae46d0edfef3adf746e35e77114925 (patch) | |
tree | 615b62573bab2bb09221daadde22a1b4d4903fdd | |
parent | a79d7f5918e75adc05cf5ceb5a1a492d62371aec (diff) | |
download | vndk-8554463403ae46d0edfef3adf746e35e77114925.tar.gz |
Do not stop dump_abi.py when library is not found
Some VNDK libraries are not built for all architectures. If the library
is not found, dump_abi.py continues running and outputs warning message.
Bug: 73329012
Test: ./dump_abi.py vndk{VNDK_VER}/libclang_rt.ubsan_standalone-i686-android.so
Change-Id: Ic8a5c00602a736025113c723c2b4944dd582f92d
Merged-In: Ic8a5c00602a736025113c723c2b4944dd582f92d
(cherry picked from commit 0f58a08fcf08a151d27c156a76b0e7770cd4aeb7)
-rwxr-xr-x | golden/dump_abi.py | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/golden/dump_abi.py b/golden/dump_abi.py index d00ee0a..8ca30e8 100755 --- a/golden/dump_abi.py +++ b/golden/dump_abi.py @@ -227,6 +227,9 @@ def DumpAbi(output_dir, lib_names, lib_dir, object_dir, dumper_dir): object_dir: The path to the directory containing intermediate objects. dumper_dir: The path to the directory containing the vtable dumper executable and library. + + Returns: + A list of strings, the paths to the libraries not found in lib_dir. """ ar_parser = ExternalModules.ar_parser static_symbols = set() @@ -236,12 +239,18 @@ def DumpAbi(output_dir, lib_names, lib_dir, object_dir, dumper_dir): ar_name + ".a") static_symbols.update(ar_parser.ListGlobalSymbols(ar_path)) + missing_libs = [] dump_dir = os.path.join(output_dir, os.path.basename(lib_dir)) for lib_name in lib_names: lib_path = os.path.join(lib_dir, lib_name) symbol_dump_path = os.path.join(dump_dir, lib_name + "_symbol.dump") vtable_dump_path = os.path.join(dump_dir, lib_name + "_vtable.dump") print(lib_path) + if not os.path.isfile(lib_path): + missing_libs.append(lib_path) + print("Warning: Not found") + print("") + continue symbols = DumpSymbols(lib_path, symbol_dump_path, static_symbols) if symbols: print("Output: " + symbol_dump_path) @@ -254,6 +263,7 @@ def DumpAbi(output_dir, lib_names, lib_dir, object_dir, dumper_dir): else: print("No vtables") print("") + return missing_libs def main(): @@ -316,10 +326,16 @@ def main(): lib_names = [name.format(VNDK_VER="-" + vndk_version) for name in _LoadLibraryNames(args.file)] - DumpAbi(output_dir, lib_names, target_lib_dir, target_obj_dir, dumper_dir) + missing_libs = DumpAbi(output_dir, lib_names, target_lib_dir, + target_obj_dir, dumper_dir) if target_2nd_arch: - DumpAbi(output_dir, lib_names, target_2nd_lib_dir, target_2nd_obj_dir, - dumper_dir) + missing_libs += DumpAbi(output_dir, lib_names, target_2nd_lib_dir, + target_2nd_obj_dir, dumper_dir) + + if missing_libs: + print("Warning: Could not find libraries:") + for lib_path in missing_libs: + print(lib_path) if __name__ == "__main__": |