diff options
Diffstat (limited to 'apex/apex.go')
-rw-r--r-- | apex/apex.go | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/apex/apex.go b/apex/apex.go index 428d57e08..d98cfae32 100644 --- a/apex/apex.go +++ b/apex/apex.go @@ -2570,7 +2570,7 @@ func (a *apexBundle) checkStaticLinkingToStubLibraries(ctx android.ModuleContext fromName := ctx.OtherModuleName(from) toName := ctx.OtherModuleName(to) - // The dynamic linker and crash_dump tool in the runtime APEX is the only + // The dynamic linker and crash_dump tool in the runtime APEX is an // exception to this rule. It can't make the static dependencies dynamic // because it can't do the dynamic linking for itself. // Same rule should be applied to linkerconfig, because it should be executed @@ -2579,6 +2579,15 @@ func (a *apexBundle) checkStaticLinkingToStubLibraries(ctx android.ModuleContext return false } + // b/389067742 adds libz as an exception to this check. Although libz is + // a part of NDK and thus provides a stable interface, it never was the + // intention because the upstream zlib provides neither ABI- nor behavior- + // stability. Therefore, we want to allow portable components like APEXes to + // bundle libz by statically linking to it. + if toName == "libz" { + return false + } + isStubLibraryFromOtherApex := info.HasStubsVariants && !librariesDirectlyInApex[toName] if isStubLibraryFromOtherApex && !externalDep { ctx.ModuleErrorf("%q required by %q is a native library providing stub. "+ |