This commit fixes prebuilt ELF checker for modules with
LOCAL_SDK_VERSIONS and depend on NDK shared libraries. This fix is
required because dynamic_binary.mk filters out NDK libraries thus those
libraries do not show up in DEPENDENCIES_ON_SHARED_LIBRARIES.
Bug: 119084334
Test: Create a prebuilt module with LOCAL_SDK_VERSION and check whether
the NDK libs in LOCAL_SHARED_LIBRARIES are passed to
check_elf_file.py.
Change-Id: I0f72ae1b0edc3e8d7e43eb70829e74d606564966
This commit strips LOCAL_CHECK_ELF_FILES before comparing it with
`false` so that developers can add comments after LOCAL_CHECK_ELF_FILES.
For example:
LOCAL_CHECK_ELF_FILES := false # disable checks due to ...
Bug: 119084334
Test: Add some spaces after LOCAL_CHECK_ELF_FILES and run
CHECK_ELF_FILES=true make check-elf-files
Change-Id: I2bfaff4807aeeea6c7af0b9d7d716742b6764cd0
This commit introduces a prebuilt ELF binaries checker. The checker
will check:
1. Whether all DT_NEEDED shared libraries are specified in
`shared_libs` (Android.bp) or `LOCAL_SHARED_LIBRARIES` (Android.mk).
2. Whether all undefined symbols in the prebuilt binary can be resolved
to defined symbols exported by its dependencies.
This ensures that prebuilt binaries won't silently become ABI
incompatible.
To check the prebuilt binaries, all of the dependencies must be
specified in `shared_libs` (Android.bp) or `LOCAL_SHARED_LIBRARIES`
(Android.mk).
If your prebuilt binaries cannot be checked for some reason, you may add
the following property to Android.bp:
check_elf_files: false,
Or, add the following setting to Android.mk:
LOCAL_CHECK_ELF_FILES := false
Bug: 119084334
Test: CHECK_ELF_FILES=true make check-elf-files
Change-Id: I523d3083f22fd4053c096d26f61f8375800281c8