diff options
Diffstat (limited to 'cc/linker.go')
-rw-r--r-- | cc/linker.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/cc/linker.go b/cc/linker.go index ae5ee0ac3..f65d7c8d3 100644 --- a/cc/linker.go +++ b/cc/linker.go @@ -491,7 +491,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 } |