def _find_lib_lsdumps_workaround(dir_name, lsdump_paths, libs): dir_name_platform = dir_name + '_platform' matched_lsdump_paths = set( find_lib_lsdumps(dir_name, lsdump_paths, libs)) matched_lsdump_paths_platform = set( find_lib_lsdumps(dir_name_platform, lsdump_paths, libs)) # Pick the lsdump file with latest modification time if both of them # exist. matched_lsdump_paths_replaced = set( path.replace(dir_name, dir_name_platform) for path in matched_lsdump_paths) both = matched_lsdump_paths_replaced & matched_lsdump_paths_platform for path_platform in both: path = path_platform.replace(dir_name_platform, dir_name) if os.stat(path).st_mtime >= os.stat(path_platform).st_mtime: matched_lsdump_paths_platform.remove(path_platform) else: matched_lsdump_paths.remove(path) return sorted(matched_lsdump_paths | matched_lsdump_paths_platform)
def find_and_copy_lib_lsdumps(target, ref_dump_dir_stem, ref_dump_dir_insertion, core_or_vendor_shared_str, libs, lsdump_paths): arch_lsdump_paths = find_lib_lsdumps(target.arch, target.arch_variant, target.cpu_variant, lsdump_paths, core_or_vendor_shared_str, libs) # Copy the contents of the lsdump into it's corresponding # reference directory. return copy_reference_dumps(arch_lsdump_paths, ref_dump_dir_stem, ref_dump_dir_insertion, get_lib_arch_str(target))
def find_and_copy_lib_lsdumps(ref_dump_dir, chosen_vndk_version, binder_bitness, target, libs, lsdump_paths, compress): arch_lsdump_paths = find_lib_lsdumps(lsdump_paths, libs, target) num_created = 0 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_str()) copy_reference_dump( path, os.path.join(ref_dump_dir_stem, 'source-based'), compress) num_created += 1 return num_created
def create_source_abi_reference_dumps(soong_dir, args): ref_dump_dir_stem = os.path.join(args.ref_dump_dir, args.version) ref_dump_dir_insertion = 'source-based' num_libs_copied = 0 for target in [Target(True), Target(False)]: arch_lsdump_paths = find_lib_lsdumps(target.arch, target.arch_variant, target.cpu_variant, soong_dir) # Copy the contents of the lsdump into it's corresponding # reference directory. num_libs_copied += copy_reference_dumps(arch_lsdump_paths, ref_dump_dir_stem, ref_dump_dir_insertion, target.arch) return num_libs_copied
def find_and_copy_lib_lsdumps(target, ref_dump_dir_stem, ref_dump_dir_insertion, core_or_vendor_shared_str, libs, lsdump_paths, compress): module_variant_dir_name = get_module_variant_dir_name( target.arch, target.arch_variant, target.cpu_variant, core_or_vendor_shared_str) arch_lsdump_paths = find_lib_lsdumps( module_variant_dir_name, lsdump_paths, libs) # Copy the contents of the lsdump into their corresponding reference ABI # dumps directories. return copy_reference_dumps(arch_lsdump_paths, ref_dump_dir_stem, ref_dump_dir_insertion, get_lib_arch_str(target), compress)
def find_and_copy_lib_lsdumps(target, soong_dir, ref_dump_dir_stem, ref_dump_dir_insertion, core_or_vendor_shared_str, libs, lsdump_paths): assert (target.primary_arch != '') target_arch_variant_str = '' # if TARGET_ARCH == TARGET_ARCH_VARIANT, soong makes targetArchVariant empty # this is the case for aosp_x86_64_ab and aosp_x86 if target.arch_variant != target.arch: target_arch_variant_str = '_' + target.arch_variant arch_lsdump_paths = find_lib_lsdumps(target.arch, target.arch_variant, target.cpu_variant, lsdump_paths, core_or_vendor_shared_str, libs) # Copy the contents of the lsdump into it's corresponding # reference directory. return copy_reference_dumps(arch_lsdump_paths, ref_dump_dir_stem, ref_dump_dir_insertion, target.arch + target_arch_variant_str)
def find_and_copy_lib_lsdumps(target, ref_dump_dir_stem, ref_dump_dir_insertion, core_or_vendor_shared_str, libs, lsdump_paths): assert(target.primary_arch != '') target_arch_variant_str = '' # if TARGET_ARCH == TARGET_ARCH_VARIANT, soong makes targetArchVariant empty # this is the case for aosp_x86_64_ab and aosp_x86 if target.arch_variant != target.arch: target_arch_variant_str = '_' + target.arch_variant arch_lsdump_paths = find_lib_lsdumps(target.arch, target.arch_variant, target.cpu_variant, lsdump_paths, core_or_vendor_shared_str, libs) # Copy the contents of the lsdump into it's corresponding # reference directory. return copy_reference_dumps(arch_lsdump_paths, ref_dump_dir_stem, ref_dump_dir_insertion, target.arch + target_arch_variant_str)