aboutsummaryrefslogtreecommitdiff
path: root/cc/sabi.go
diff options
context:
space:
mode:
authorYo Chiang <yochiang@google.com>2020-11-30 20:00:42 +0800
committerYo Chiang <yochiang@google.com>2020-12-14 03:43:06 +0000
commitd737d3f2a631a584bbad4df3111574e9d4d91b30 (patch)
treecf19b15fc4559fb63bd8ada047633bff5ad1030f /cc/sabi.go
parent2bbadfaef7617187485e157e91856a23cd023e41 (diff)
downloadsoong-d737d3f2a631a584bbad4df3111574e9d4d91b30.tar.gz
Refine ABI check and enable ABI check on APEX exported libs
* Don't check ramdisk and recovery variants. * Don't check bionic libraries of bootstrap variant. * Don't check uninstallable libraries. * Check APEX exported libraries. Bug: 145608479 Test: Presubmit Test: diff lsdump_paths.txt, verify the changes are as expected. Change-Id: Ie540dba563277307c51b533cd982d7317796b48b
Diffstat (limited to 'cc/sabi.go')
-rw-r--r--cc/sabi.go28
1 files changed, 19 insertions, 9 deletions
diff --git a/cc/sabi.go b/cc/sabi.go
index c65832980..99e718e60 100644
--- a/cc/sabi.go
+++ b/cc/sabi.go
@@ -130,6 +130,16 @@ func shouldCreateSourceAbiDumpForLibrary(ctx android.BaseModuleContext) bool {
// Module is shared library type.
+ // Don't check uninstallable modules.
+ if m.IsSkipInstall() {
+ return false
+ }
+
+ // Don't check ramdisk or recovery variants. Only check core, vendor or product variants.
+ if m.InRamdisk() || m.InVendorRamdisk() || m.InRecovery() {
+ return false
+ }
+
// Don't create ABI dump for prebuilts.
if m.Prebuilt() != nil || m.isSnapshotPrebuilt() {
return false
@@ -150,17 +160,17 @@ func shouldCreateSourceAbiDumpForLibrary(ctx android.BaseModuleContext) bool {
return false
}
- // Special case for APEX variants.
- if !ctx.Provider(android.ApexInfoProvider).(android.ApexInfo).IsForPlatform() {
- // Don't create ABI dump if this library is for APEX but isn't exported.
- if !m.HasStubsVariants() {
+ isPlatformVariant := ctx.Provider(android.ApexInfoProvider).(android.ApexInfo).IsForPlatform()
+ if isPlatformVariant {
+ // Bionic libraries that are installed to the bootstrap directory are not ABI checked.
+ // Only the runtime APEX variants, which are the implementation libraries of bionic NDK stubs,
+ // are checked.
+ if InstallToBootstrap(m.BaseModuleName(), ctx.Config()) {
return false
}
- if !m.library.headerAbiCheckerEnabled() {
- // Skip ABI checks if this library is for APEX and did not explicitly enable
- // ABI checks.
- // TODO(b/145608479): ABI checks should be enabled by default. Remove this
- // after evaluating the extra build time.
+ } else {
+ // Don't create ABI dump if this library is for APEX but isn't exported.
+ if !m.HasStubsVariants() {
return false
}
}