summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHsin-Yi Chen <hsinyichen@google.com>2018-03-02 11:38:02 +0800
committerHsin-Yi Chen <hsinyichen@google.com>2018-03-05 11:32:20 +0800
commit0f58a08fcf08a151d27c156a76b0e7770cd4aeb7 (patch)
tree71ca7699cd467971e95c250ab45ea6ed05fc1b57
parent06f7ecffcb9b791e27f8c59ac7bdce4e5c4f8b5f (diff)
downloadvndk-0f58a08fcf08a151d27c156a76b0e7770cd4aeb7.tar.gz
Do not stop dump_abi.py when library is not foundandroid-p-preview-1android-o-mr1-iot-preview-7o-mr1-iot-preview-7
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
-rwxr-xr-xgolden/dump_abi.py22
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__":