Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ef6dfea6 authored by Liz Kammer's avatar Liz Kammer
Browse files

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
parent 5831f70d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2918,8 +2918,8 @@ func orderStaticModuleDeps(staticDeps []StaticLibraryInfo, sharedDeps []SharedLi
		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()
+6 −8
Original line number Diff line number Diff line
@@ -1352,18 +1352,16 @@ func (library *libraryDecorator) linkShared(ctx ModuleContext,
	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,
		TransitiveStaticLibrariesForOrdering: transitiveStaticLibrariesForOrdering,
		Target:                               ctx.Target(),
	})

+5 −6
Original line number Diff line number Diff line
@@ -306,13 +306,12 @@ func HeaderDepTag() blueprint.DependencyTag {
// SharedLibraryInfo is a provider to propagate information about a shared C++ library.
type SharedLibraryInfo struct {
	SharedLibrary android.Path
	UnstrippedSharedLibrary android.Path
	Target        android.Target

	TableOfContents android.OptionalPath
	CoverageSharedLibrary android.OptionalPath

	StaticAnalogue *StaticLibraryInfo
	// should be obtained from static analogue
	TransitiveStaticLibrariesForOrdering *android.DepSet
}

var SharedLibraryInfoProvider = blueprint.NewProvider(SharedLibraryInfo{})
+2 −3
Original line number Diff line number Diff line
@@ -187,7 +187,6 @@ func (ndk *ndkPrebuiltStlLinker) link(ctx ModuleContext, flags Flags,
	} else {
		ctx.SetProvider(SharedLibraryInfoProvider, SharedLibraryInfo{
			SharedLibrary: lib,
			UnstrippedSharedLibrary: lib,
			Target:        ctx.Target(),
		})
	}
+2 −3
Original line number Diff line number Diff line
@@ -184,7 +184,6 @@ func (p *prebuiltLibraryLinker) link(ctx ModuleContext,

			ctx.SetProvider(SharedLibraryInfoProvider, SharedLibraryInfo{
				SharedLibrary: outputFile,
				UnstrippedSharedLibrary: p.unstrippedOutputFile,
				Target:        ctx.Target(),

				TableOfContents: p.tocFile,
Loading