Remove CPU variant from ABI reference dump paths

This commit removes CPU variant from the paths under prebuilts/abi-dumps
so that the build system can find dumps generated from non-generic
products.

Bug: 140359871
Test: ./create_reference_dumps.py -product aosp_cf_arm64_phone \
      -libs libvndksupport

Change-Id: Ib022bbfd484e327e345b554cdfd41a48692a3c68
This commit is contained in:
Hsin-Yi Chen
2019-10-08 14:10:04 +08:00
parent 6863ada102
commit e1aa9ebe32
2 changed files with 14 additions and 9 deletions

View File

@@ -39,9 +39,9 @@ def make_libs_for_product(libs, product, variant, targets):
def get_ref_dump_dir_stem(ref_dump_dir, category, chosen_vndk_version,
binder_bitness, arch_cpu):
binder_bitness, arch):
return os.path.join(ref_dump_dir, category, chosen_vndk_version,
binder_bitness, arch_cpu)
binder_bitness, arch)
def find_and_remove_path(root_path, file_name=None):
@@ -66,7 +66,7 @@ def remove_references_for_all_arches_and_variants(ref_dump_dir,
for category in ('ndk', 'platform', 'vndk'):
dir_to_remove = get_ref_dump_dir_stem(
ref_dump_dir, category, chosen_vndk_version, binder_bitness,
target.get_arch_cpu_str())
target.get_arch_str())
if libs:
for lib in libs:
find_and_remove_path(dir_to_remove,
@@ -96,7 +96,7 @@ def find_and_copy_lib_lsdumps(ref_dump_dir, chosen_vndk_version,
for tag, path in arch_lsdump_paths:
ref_dump_dir_stem = get_ref_dump_dir_stem(
ref_dump_dir, tag_to_dir_name(tag), chosen_vndk_version,
binder_bitness, target.get_arch_cpu_str())
binder_bitness, target.get_arch_str())
copy_reference_dump(
path, os.path.join(ref_dump_dir_stem, 'source-based'), compress)
num_created += 1

View File

@@ -55,24 +55,29 @@ class Target(object):
self.arch_variant = build_vars[2]
self.cpu_variant = build_vars[3]
def get_arch_cpu_str(self):
"""Return a string that represents the architecture, the architecture
variant, and the CPU variant.
def get_arch_str(self):
"""Return a string that represents the architecture and the
architecture variant.
If TARGET_ARCH == TARGET_ARCH_VARIANT, soong makes targetArchVariant
empty. This is the case for aosp_x86_64 and aosp_x86_ab.
empty. This is the case for aosp_x86_64.
"""
if not self.arch_variant or self.arch_variant == self.arch:
arch_variant = ''
else:
arch_variant = '_' + self.arch_variant
return self.arch + arch_variant
def get_arch_cpu_str(self):
"""Return a string that represents the architecture, the architecture
variant, and the CPU variant."""
if not self.cpu_variant or self.cpu_variant == 'generic':
cpu_variant = ''
else:
cpu_variant = '_' + self.cpu_variant
return self.arch + arch_variant + cpu_variant
return self.get_arch_str() + cpu_variant
def get_module_variant_dir_name(self, variant_suffix):
"""Create module variant directory name from the architecture, the