diff options
| -rw-r--r-- | cc/cc.go | 5 | ||||
| -rw-r--r-- | cc/library.go | 12 |
2 files changed, 9 insertions, 8 deletions
@@ -92,6 +92,7 @@ type LinkerInfo struct { type BinaryDecoratorInfo struct{} type LibraryDecoratorInfo struct { ExportIncludeDirs proptools.Configurable[[]string] + InjectBsslHash bool } type LibraryInfo struct { @@ -2220,7 +2221,9 @@ func (c *Module) GenerateAndroidBuildActions(actx android.ModuleContext) { case *binaryDecorator: ccInfo.LinkerInfo.BinaryDecoratorInfo = &BinaryDecoratorInfo{} case *libraryDecorator: - ccInfo.LinkerInfo.LibraryDecoratorInfo = &LibraryDecoratorInfo{} + ccInfo.LinkerInfo.LibraryDecoratorInfo = &LibraryDecoratorInfo{ + InjectBsslHash: Bool(c.linker.(*libraryDecorator).Properties.Inject_bssl_hash), + } case *testBinary: ccInfo.LinkerInfo.TestBinaryInfo = &TestBinaryInfo{ Gtest: decorator.testDecorator.gtest(), diff --git a/cc/library.go b/cc/library.go index c9114fdd7..5c2cb5db2 100644 --- a/cc/library.go +++ b/cc/library.go @@ -1195,7 +1195,7 @@ func (library *libraryDecorator) linkShared(ctx ModuleContext, library.linkSAbiDumpFiles(ctx, deps, objs, fileName, unstrippedOutputFile) var transitiveStaticLibrariesForOrdering depset.DepSet[android.Path] - if static := ctx.GetDirectDepsWithTag(staticVariantTag); len(static) > 0 { + if static := ctx.GetDirectDepsProxyWithTag(staticVariantTag); len(static) > 0 { s, _ := android.OtherModuleProvider(ctx, static[0], StaticLibraryInfoProvider) transitiveStaticLibrariesForOrdering = s.TransitiveStaticLibrariesForOrdering } @@ -2409,13 +2409,11 @@ func maybeInjectBoringSSLHash(ctx android.ModuleContext, outputFile android.Modu inject *bool, fileName string) android.ModuleOutPath { // TODO(b/137267623): Remove this in favor of a cc_genrule when they support operating on shared libraries. injectBoringSSLHash := Bool(inject) - ctx.VisitDirectDeps(func(dep android.Module) { + ctx.VisitDirectDepsProxy(func(dep android.ModuleProxy) { if tag, ok := ctx.OtherModuleDependencyTag(dep).(libraryDependencyTag); ok && tag.static() { - if cc, ok := dep.(*Module); ok { - if library, ok := cc.linker.(*libraryDecorator); ok { - if Bool(library.Properties.Inject_bssl_hash) { - injectBoringSSLHash = true - } + if ccInfo, ok := android.OtherModuleProvider(ctx, dep, CcInfoProvider); ok && ccInfo.LinkerInfo.LibraryDecoratorInfo != nil { + if ccInfo.LinkerInfo.LibraryDecoratorInfo.InjectBsslHash { + injectBoringSSLHash = true } } } |