Add --llndk to create_reference_dumps.py for llndk libraries.

Currently, we do abi checks on the system variants of llndk libraries.
Therefore, add an 'llndk' flag to specify that the system variant should be
built.

Bug: 77101345

Test: utils/create_reference_dumps.py --llndk -l libdl produces
      libdl references.

Merged-In: Id4c607674f096daf041520d4a1ca43199d4451da
Change-Id: Id4c607674f096daf041520d4a1ca43199d4451da
(cherry picked from commit cd0e8aff22)
This commit is contained in:
Jayant Chowdhary
2018-03-27 11:27:47 -07:00
parent a1109bd6e5
commit 9675149096
3 changed files with 21 additions and 7 deletions

View File

@@ -83,6 +83,8 @@ For more command line options, run `header-abi-diff --help`.
`utils/create_reference_dumps.py` may be used to create reference ABI dumps. `utils/create_reference_dumps.py` may be used to create reference ABI dumps.
#For VNDK libraries
For example, the command below creates reference ABI dumps for all VNDK shared For example, the command below creates reference ABI dumps for all VNDK shared
libraries on arm, arm64, x86, and x86_64 architectures: libraries on arm, arm64, x86, and x86_64 architectures:
@@ -96,7 +98,16 @@ To create reference ABI dumps for a specific library, run the command below:
$ python3 create_reference_dumps.py -l libfoo $ python3 create_reference_dumps.py -l libfoo
``` ```
This will create reference dumps for `libfoo`, assuming `libfoo` is a VNDK or This will create reference dumps for `libfoo`, assuming `libfoo` is a VNDK
LLNDK library. library.
# For LLNDK libraries
```
$ python3 create_reference_dumps.py -l libfoo --llndk
```
This will create reference dumps for `libfoo`, assuming `libfoo` is an LLNDK
library.
For more command line options, run `utils/create_reference_dumps.py --help`. For more command line options, run `utils/create_reference_dumps.py --help`.

View File

@@ -84,12 +84,12 @@ def get_ref_dump_dir_stem(args, vndk_or_ndk, product, chosen_vndk_version):
return ref_dump_dir_stem return ref_dump_dir_stem
def make_libs_for_all_arches_and_variants(libs): def make_libs_for_all_arches_and_variants(libs, llndk_mode):
for product in PRODUCTS: for product in PRODUCTS:
get_lsdump_paths_file(product) get_lsdump_paths_file(product)
if libs: if libs:
print('making libs for product:', product) print('making libs for product:', product)
make_libraries(libs, product) make_libraries(libs, product, llndk_mode)
else: else:
print('making all libs for product: ', product) print('making all libs for product: ', product)
make_tree(product) make_tree(product)
@@ -154,6 +154,8 @@ def main():
parser.add_argument('--version', help='VNDK version') parser.add_argument('--version', help='VNDK version')
parser.add_argument('--no-make-lib', help='no m -j lib.vendor while \ parser.add_argument('--no-make-lib', help='no m -j lib.vendor while \
creating reference', default=False, action='store_true') creating reference', default=False, action='store_true')
parser.add_argument('--llndk', help='The libs specified by -l are llndk',
default=False, action='store_true')
parser.add_argument('-libs', help='libs to create references for', parser.add_argument('-libs', help='libs to create references for',
action='append') action='append')
parser.add_argument('-ref-dump-dir', parser.add_argument('-ref-dump-dir',
@@ -174,7 +176,7 @@ def main():
remove_references_for_all_arches_and_variants(args, chosen_vndk_version) remove_references_for_all_arches_and_variants(args, chosen_vndk_version)
# make all the libs specified / the entire vndk_package if none specified # make all the libs specified / the entire vndk_package if none specified
if (args.no_make_lib == False): if (args.no_make_lib == False):
make_libs_for_all_arches_and_variants(args.libs) make_libs_for_all_arches_and_variants(args.libs, args.llndk)
for product in PRODUCTS: for product in PRODUCTS:
num_processed += create_source_abi_reference_dumps( num_processed += create_source_abi_reference_dumps(
soong_dir, args, product, chosen_vndk_version) soong_dir, args, product, chosen_vndk_version)

View File

@@ -136,12 +136,13 @@ def make_targets(targets, product):
subprocess.check_call(make_cmd, cwd=AOSP_DIR, stdout=subprocess.DEVNULL, subprocess.check_call(make_cmd, cwd=AOSP_DIR, stdout=subprocess.DEVNULL,
stderr=subprocess.STDOUT) stderr=subprocess.STDOUT)
def make_libraries(libs, product): def make_libraries(libs, product, llndk_mode):
# To aid creation of reference dumps. Makes lib.vendor for the current # To aid creation of reference dumps. Makes lib.vendor for the current
# configuration. # configuration.
lib_targets = [] lib_targets = []
for lib in libs: for lib in libs:
lib_targets.append(lib + VENDOR_SUFFIX) lib = lib if llndk_mode else lib + VENDOR_SUFFIX
lib_targets.append(lib)
make_targets(lib_targets, product) make_targets(lib_targets, product)
def find_lib_lsdumps(target_arch, target_arch_variant, def find_lib_lsdumps(target_arch, target_arch_variant,