summaryrefslogtreecommitdiff
path: root/cc/library_sdk_member.go
diff options
context:
space:
mode:
author Martin Stjernholm <mast@google.com> 2020-03-24 01:19:52 +0000
committer Martin Stjernholm <mast@google.com> 2020-03-25 23:19:37 +0000
commit10566a035f648cd85b9af444b06cc2eb9975a9ef (patch)
tree490f3cba210d2d39bb8be13c5f0c058a80b7fb4d /cc/library_sdk_member.go
parentb358ebb7598dc941213ad3a9445e035c5f768fcc (diff)
Propagate empty vs unspecified system_shared_libs correctly.
Necessary to get correct prebuilts for many Bionic libs. Cleaned up numerious "system_shared_libs: []" from test fixtures, since they otherwise would need correction in the expected results, and it is better to have a single test focused on testing system_shared_libs propagation. Test: m nothing Bug: 152255951 Change-Id: If2e8a5296223e6281d833312660e8e9e4cd184c0
Diffstat (limited to 'cc/library_sdk_member.go')
-rw-r--r--cc/library_sdk_member.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/cc/library_sdk_member.go b/cc/library_sdk_member.go
index 49674552f..0a11af126 100644
--- a/cc/library_sdk_member.go
+++ b/cc/library_sdk_member.go
@@ -212,7 +212,9 @@ func addPossiblyArchSpecificProperties(sdkModuleContext android.ModuleContext, b
outputProperties.AddPropertyWithTag("shared_libs", libInfo.SharedLibs, builder.SdkMemberReferencePropertyTag(false))
}
- if len(libInfo.SystemSharedLibs) > 0 {
+ // SystemSharedLibs needs to be propagated if it's a list, even if it's empty,
+ // so check for non-nil instead of nonzero length.
+ if libInfo.SystemSharedLibs != nil {
outputProperties.AddPropertyWithTag("system_shared_libs", libInfo.SystemSharedLibs, builder.SdkMemberReferencePropertyTag(false))
}
@@ -327,7 +329,8 @@ type nativeLibInfoProperties struct {
// This field is exported as its contents may not be arch specific.
SharedLibs []string
- // The set of system shared libraries
+ // The set of system shared libraries. Note nil and [] are semantically
+ // distinct - see BaseLinkerProperties.System_shared_libs.
//
// This field is exported as its contents may not be arch specific.
SystemSharedLibs []string