Only store what's used in SharedLibraryInfo
There was a reference to the static library provider, but only the
transitive static deps were used, so only store that part. Other members
were stored but unused anywhere.
Test: go test soong tests
Test: m nothing
Change-Id: I12a6b94806c052c3f0df3cab0a10f17042af1c38
diff --git a/cc/cc.go b/cc/cc.go
index 7c4ba44..d22c9da 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -2918,8 +2918,8 @@
transitiveStaticLibsBuilder.Transitive(staticDep.TransitiveStaticLibrariesForOrdering)
}
for _, sharedDep := range sharedDeps {
- if sharedDep.StaticAnalogue != nil {
- transitiveStaticLibsBuilder.Transitive(sharedDep.StaticAnalogue.TransitiveStaticLibrariesForOrdering)
+ if sharedDep.TransitiveStaticLibrariesForOrdering != nil {
+ transitiveStaticLibsBuilder.Transitive(sharedDep.TransitiveStaticLibrariesForOrdering)
}
}
transitiveStaticLibs := transitiveStaticLibsBuilder.Build()
diff --git a/cc/library.go b/cc/library.go
index c88c29a..548dd5d 100644
--- a/cc/library.go
+++ b/cc/library.go
@@ -1352,19 +1352,17 @@
library.coverageOutputFile = transformCoverageFilesToZip(ctx, objs, library.getLibName(ctx))
library.linkSAbiDumpFiles(ctx, objs, fileName, unstrippedOutputFile)
- var staticAnalogue *StaticLibraryInfo
+ var transitiveStaticLibrariesForOrdering *android.DepSet
if static := ctx.GetDirectDepsWithTag(staticVariantTag); len(static) > 0 {
s := ctx.OtherModuleProvider(static[0], StaticLibraryInfoProvider).(StaticLibraryInfo)
- staticAnalogue = &s
+ transitiveStaticLibrariesForOrdering = s.TransitiveStaticLibrariesForOrdering
}
ctx.SetProvider(SharedLibraryInfoProvider, SharedLibraryInfo{
- TableOfContents: android.OptionalPathForPath(tocFile),
- SharedLibrary: unstrippedOutputFile,
- UnstrippedSharedLibrary: library.unstrippedOutputFile,
- CoverageSharedLibrary: library.coverageOutputFile,
- StaticAnalogue: staticAnalogue,
- Target: ctx.Target(),
+ TableOfContents: android.OptionalPathForPath(tocFile),
+ SharedLibrary: unstrippedOutputFile,
+ TransitiveStaticLibrariesForOrdering: transitiveStaticLibrariesForOrdering,
+ Target: ctx.Target(),
})
stubs := ctx.GetDirectDepsWithTag(stubImplDepTag)
diff --git a/cc/linkable.go b/cc/linkable.go
index b583b69..0a5d16c 100644
--- a/cc/linkable.go
+++ b/cc/linkable.go
@@ -305,14 +305,13 @@
// SharedLibraryInfo is a provider to propagate information about a shared C++ library.
type SharedLibraryInfo struct {
- SharedLibrary android.Path
- UnstrippedSharedLibrary android.Path
- Target android.Target
+ SharedLibrary android.Path
+ Target android.Target
- TableOfContents android.OptionalPath
- CoverageSharedLibrary android.OptionalPath
+ TableOfContents android.OptionalPath
- StaticAnalogue *StaticLibraryInfo
+ // should be obtained from static analogue
+ TransitiveStaticLibrariesForOrdering *android.DepSet
}
var SharedLibraryInfoProvider = blueprint.NewProvider(SharedLibraryInfo{})
diff --git a/cc/ndk_prebuilt.go b/cc/ndk_prebuilt.go
index b91c737..51ec6b8 100644
--- a/cc/ndk_prebuilt.go
+++ b/cc/ndk_prebuilt.go
@@ -186,9 +186,8 @@
})
} else {
ctx.SetProvider(SharedLibraryInfoProvider, SharedLibraryInfo{
- SharedLibrary: lib,
- UnstrippedSharedLibrary: lib,
- Target: ctx.Target(),
+ SharedLibrary: lib,
+ Target: ctx.Target(),
})
}
diff --git a/cc/prebuilt.go b/cc/prebuilt.go
index bea1782..fd310a2 100644
--- a/cc/prebuilt.go
+++ b/cc/prebuilt.go
@@ -183,9 +183,8 @@
})
ctx.SetProvider(SharedLibraryInfoProvider, SharedLibraryInfo{
- SharedLibrary: outputFile,
- UnstrippedSharedLibrary: p.unstrippedOutputFile,
- Target: ctx.Target(),
+ SharedLibrary: outputFile,
+ Target: ctx.Target(),
TableOfContents: p.tocFile,
})
diff --git a/cc/snapshot_prebuilt.go b/cc/snapshot_prebuilt.go
index 81590a5..3a382a1 100644
--- a/cc/snapshot_prebuilt.go
+++ b/cc/snapshot_prebuilt.go
@@ -642,9 +642,8 @@
transformSharedObjectToToc(ctx, in, tocFile, builderFlags)
ctx.SetProvider(SharedLibraryInfoProvider, SharedLibraryInfo{
- SharedLibrary: in,
- UnstrippedSharedLibrary: p.unstrippedOutputFile,
- Target: ctx.Target(),
+ SharedLibrary: in,
+ Target: ctx.Target(),
TableOfContents: p.tocFile,
})
diff --git a/cc/vndk_prebuilt.go b/cc/vndk_prebuilt.go
index 141f438..da34f36 100644
--- a/cc/vndk_prebuilt.go
+++ b/cc/vndk_prebuilt.go
@@ -168,9 +168,8 @@
}
ctx.SetProvider(SharedLibraryInfoProvider, SharedLibraryInfo{
- SharedLibrary: in,
- UnstrippedSharedLibrary: p.unstrippedOutputFile,
- Target: ctx.Target(),
+ SharedLibrary: in,
+ Target: ctx.Target(),
TableOfContents: p.tocFile,
})
diff --git a/rust/library.go b/rust/library.go
index 1a56ef6..747a29d 100644
--- a/rust/library.go
+++ b/rust/library.go
@@ -503,9 +503,8 @@
if library.shared() {
ctx.SetProvider(cc.SharedLibraryInfoProvider, cc.SharedLibraryInfo{
- SharedLibrary: outputFile,
- UnstrippedSharedLibrary: outputFile,
- Target: ctx.Target(),
+ SharedLibrary: outputFile,
+ Target: ctx.Target(),
})
}