diff options
-rw-r--r-- | cc/afdo.go | 4 | ||||
-rw-r--r-- | cc/cc.go | 11 | ||||
-rw-r--r-- | cc/library.go | 8 |
3 files changed, 19 insertions, 4 deletions
diff --git a/cc/afdo.go b/cc/afdo.go index 03dc2713e..828e494e1 100644 --- a/cc/afdo.go +++ b/cc/afdo.go @@ -65,8 +65,8 @@ func (afdo *afdo) isAfdoCompile(ctx ModuleContext) bool { } func getFdoProfilePathFromDep(ctx ModuleContext) string { - fdoProfileDeps := ctx.GetDirectDepsWithTag(FdoProfileTag) - if len(fdoProfileDeps) > 0 && fdoProfileDeps[0] != nil { + fdoProfileDeps := ctx.GetDirectDepsProxyWithTag(FdoProfileTag) + if len(fdoProfileDeps) > 0 { if info, ok := android.OtherModuleProvider(ctx, fdoProfileDeps[0], FdoProfileProvider); ok { return info.Path.String() } @@ -93,6 +93,11 @@ type BinaryDecoratorInfo struct{} type LibraryDecoratorInfo struct { ExportIncludeDirs proptools.Configurable[[]string] } + +type LibraryInfo struct { + StubsVersion string +} + type TestBinaryInfo struct { Gtest bool } @@ -106,6 +111,7 @@ type CcInfo struct { CmakeSnapshotSupported bool CompilerInfo *CompilerInfo LinkerInfo *LinkerInfo + LibraryInfo *LibraryInfo } var CcInfoProvider = blueprint.NewProvider[CcInfo]() @@ -2227,6 +2233,11 @@ func (c *Module) GenerateAndroidBuildActions(actx android.ModuleContext) { ccInfo.LinkerInfo.ObjectLinkerInfo = &ObjectLinkerInfo{} } } + if c.library != nil { + ccInfo.LibraryInfo = &LibraryInfo{ + StubsVersion: c.library.stubsVersion(), + } + } android.SetProvider(ctx, CcInfoProvider, ccInfo) c.setOutputFiles(ctx) diff --git a/cc/library.go b/cc/library.go index be27b0191..c9114fdd7 100644 --- a/cc/library.go +++ b/cc/library.go @@ -1216,7 +1216,7 @@ func (library *libraryDecorator) linkShared(ctx ModuleContext, // Visits the stub variants of the library and returns a struct containing the stub .so paths func addStubDependencyProviders(ctx ModuleContext) []SharedStubLibrary { stubsInfo := []SharedStubLibrary{} - stubs := ctx.GetDirectDepsWithTag(stubImplDepTag) + stubs := ctx.GetDirectDepsProxyWithTag(stubImplDepTag) if len(stubs) > 0 { for _, stub := range stubs { stubInfo, ok := android.OtherModuleProvider(ctx, stub, SharedLibraryInfoProvider) @@ -1225,8 +1225,12 @@ func addStubDependencyProviders(ctx ModuleContext) []SharedStubLibrary { continue } flagInfo, _ := android.OtherModuleProvider(ctx, stub, FlagExporterInfoProvider) + ccInfo, ok := android.OtherModuleProvider(ctx, stub, CcInfoProvider) + if !ok || ccInfo.LibraryInfo == nil { + panic(fmt.Errorf("couldn't find library info for %s", stub)) + } stubsInfo = append(stubsInfo, SharedStubLibrary{ - Version: moduleLibraryInterface(stub).stubsVersion(), + Version: ccInfo.LibraryInfo.StubsVersion, SharedLibraryInfo: stubInfo, FlagExporterInfo: flagInfo, }) |