aboutsummaryrefslogtreecommitdiffstats
path: root/cc/linker.go
diff options
context:
space:
mode:
authorMartin Stjernholm <mast@google.com>2020-03-24 01:19:52 +0000
committerPaul Duffin <paulduffin@google.com>2020-05-06 08:17:57 +0100
commitbddfbc463d9f47bf0e10835092d56470cb7e2160 (patch)
tree269ebb5ff5814e856bc389ab01b289f066c70720 /cc/linker.go
parentfcb99e07fcef950541b6165ae1816df2c4d83efc (diff)
downloadbuild_soong-bddfbc463d9f47bf0e10835092d56470cb7e2160.tar.gz
build_soong-bddfbc463d9f47bf0e10835092d56470cb7e2160.tar.bz2
build_soong-bddfbc463d9f47bf0e10835092d56470cb7e2160.zip
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 Merged-In: If2e8a5296223e6281d833312660e8e9e4cd184c0 Change-Id: If2e8a5296223e6281d833312660e8e9e4cd184c0 (cherry picked from commit 10566a035f648cd85b9af444b06cc2eb9975a9ef)
Diffstat (limited to 'cc/linker.go')
-rw-r--r--cc/linker.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/cc/linker.go b/cc/linker.go
index 9b2c1e71..d56c733c 100644
--- a/cc/linker.go
+++ b/cc/linker.go
@@ -503,7 +503,15 @@ func (linker *baseLinker) link(ctx ModuleContext,
func (linker *baseLinker) linkerSpecifiedDeps(specifiedDeps specifiedDeps) specifiedDeps {
specifiedDeps.sharedLibs = append(specifiedDeps.sharedLibs, linker.Properties.Shared_libs...)
- specifiedDeps.systemSharedLibs = append(specifiedDeps.systemSharedLibs, linker.Properties.System_shared_libs...)
+
+ // Must distinguish nil and [] in system_shared_libs - ensure that [] in
+ // either input list doesn't come out as nil.
+ if specifiedDeps.systemSharedLibs == nil {
+ specifiedDeps.systemSharedLibs = linker.Properties.System_shared_libs
+ } else {
+ specifiedDeps.systemSharedLibs = append(specifiedDeps.systemSharedLibs, linker.Properties.System_shared_libs...)
+ }
+
return specifiedDeps
}