Support boringssl hash injection on binaries and make it transitive

Move handling the inject_bssl_hash property to a helper function,
and also treat it as set if any static libraries have it set.

Bug: 137267623
Test: m checkbuild
Change-Id: Icb12cfffb20797c807b410daffbf7fcccb1b1975
This commit is contained in:
Colin Cross
2019-09-05 14:26:33 -07:00
parent c3233c291f
commit d7227f99eb
2 changed files with 41 additions and 12 deletions

View File

@@ -50,6 +50,9 @@ type BinaryLinkerProperties struct {
// binaries would be installed by default (in PRODUCT_PACKAGES) the other binary will be removed
// from PRODUCT_PACKAGES.
Overrides []string
// Inject boringssl hash into the shared library. This is only intended for use by external/boringssl.
Inject_bssl_hash *bool `android:"arch_variant"`
}
func init() {
@@ -342,6 +345,8 @@ func (binary *binaryDecorator) link(ctx ModuleContext,
flagsToBuilderFlags(flags), afterPrefixSymbols)
}
outputFile = maybeInjectBoringSSLHash(ctx, outputFile, binary.Properties.Inject_bssl_hash, fileName)
if Bool(binary.baseLinker.Properties.Use_version_lib) {
if ctx.Host() {
versionedOutputFile := outputFile