From 62f1f9488e39b0d7675d29621958c3d1a6a76e87 Mon Sep 17 00:00:00 2001 From: Logan Chien Date: Mon, 18 Feb 2019 15:40:42 +0800 Subject: [PATCH] Add --llndk for NDK libs as well This commit add `--llndk` to the command line option for `create_reference_dumps.py` as well. Bug: 124620774 Bug: 130324828 Test: lunch aosp_arm64-userdebug && make Change-Id: I117864209b8cf8c934fd3aa1086b7691c1c449e3 --- cc/builder.go | 11 ++++++++--- cc/library.go | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/cc/builder.go b/cc/builder.go index e6435845d..65369d621 100644 --- a/cc/builder.go +++ b/cc/builder.go @@ -709,7 +709,7 @@ func UnzipRefDump(ctx android.ModuleContext, zippedRefDump android.Path, baseNam } func SourceAbiDiff(ctx android.ModuleContext, inputDump android.Path, referenceDump android.Path, - baseName, exportedHeaderFlags string, isLlndk, isVndkExt bool) android.OptionalPath { + baseName, exportedHeaderFlags string, isLlndk, isNdk, isVndkExt bool) android.OptionalPath { outputFile := android.PathForModuleOut(ctx, baseName+".abidiff") libName := strings.TrimSuffix(baseName, filepath.Ext(baseName)) @@ -719,9 +719,14 @@ func SourceAbiDiff(ctx android.ModuleContext, inputDump android.Path, referenceD if exportedHeaderFlags == "" { localAbiCheckAllowFlags = append(localAbiCheckAllowFlags, "-advice-only") } - if isLlndk { - localAbiCheckAllowFlags = append(localAbiCheckAllowFlags, "-consider-opaque-types-different") + if isLlndk || isNdk { createReferenceDumpFlags = "--llndk" + if isLlndk { + // TODO(b/130324828): "-consider-opaque-types-different" should apply to + // both LLNDK and NDK shared libs. However, a known issue in header-abi-diff + // breaks libaaudio. Remove the if-guard after the issue is fixed. + localAbiCheckAllowFlags = append(localAbiCheckAllowFlags, "-consider-opaque-types-different") + } } if isVndkExt { localAbiCheckAllowFlags = append(localAbiCheckAllowFlags, "-allow-extensions") diff --git a/cc/library.go b/cc/library.go index cf207473d..a594b911d 100644 --- a/cc/library.go +++ b/cc/library.go @@ -804,7 +804,7 @@ func (library *libraryDecorator) linkSAbiDumpFiles(ctx ModuleContext, objs Objec refAbiDumpFile := getRefAbiDumpFile(ctx, vndkVersion, fileName) if refAbiDumpFile != nil { library.sAbiDiff = SourceAbiDiff(ctx, library.sAbiOutputFile.Path(), - refAbiDumpFile, fileName, exportedHeaderFlags, ctx.isLlndk(), ctx.isVndkExt()) + refAbiDumpFile, fileName, exportedHeaderFlags, ctx.isLlndk(), ctx.isNdk(), ctx.isVndkExt()) } } }