diff options
author | Dan Albert <danalbert@google.com> | 2022-04-20 19:19:07 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2022-04-20 19:19:07 +0000 |
commit | e31a071389c2fdecbe4bb7bf56db94662fbd3a4a (patch) | |
tree | ab33012f6fbc66edb962269db1d8fca0011bca77 /cc | |
parent | 0c9d27c4636cc3c47b27b19966b40192af054976 (diff) | |
parent | f71006a96264a95938fe0b212751302d69dd9121 (diff) | |
download | soong-e31a071389c2fdecbe4bb7bf56db94662fbd3a4a.tar.gz |
Merge changes from topic "abigail-werror"
* changes:
Disable ABI dumping for hwasan builds.
Abort on abitidy errors.
Diffstat (limited to 'cc')
-rw-r--r-- | cc/ndk_abi.go | 2 | ||||
-rw-r--r-- | cc/ndk_library.go | 34 |
2 files changed, 30 insertions, 6 deletions
diff --git a/cc/ndk_abi.go b/cc/ndk_abi.go index 927fa2ec5..3456c32bb 100644 --- a/cc/ndk_abi.go +++ b/cc/ndk_abi.go @@ -46,7 +46,7 @@ func (n *ndkAbiDumpSingleton) GenerateBuildActions(ctx android.SingletonContext) if m, ok := module.(*Module); ok { if installer, ok := m.installer.(*stubDecorator); ok { - if canDumpAbi() { + if canDumpAbi(ctx.Config()) { depPaths = append(depPaths, installer.abiDumpPath) } } diff --git a/cc/ndk_library.go b/cc/ndk_library.go index fc682ff70..5ef41eae5 100644 --- a/cc/ndk_library.go +++ b/cc/ndk_library.go @@ -53,9 +53,9 @@ var ( abitidy = pctx.AndroidStaticRule("abitidy", blueprint.RuleParams{ - Command: "$abitidy --all -i $in -o $out", + Command: "$abitidy --all $flags -i $in -o $out", CommandDeps: []string{"$abitidy"}, - }) + }, "flags") abidiff = pctx.AndroidStaticRule("abidiff", blueprint.RuleParams{ @@ -104,6 +104,12 @@ type libraryProperties struct { // used. This is only needed to work around platform bugs like // https://github.com/android-ndk/ndk/issues/265. Unversioned_until *string + + // If true, does not emit errors when APIs lacking type information are + // found. This is false by default and should not be enabled outside bionic, + // where it is enabled pending a fix for http://b/190554910 (no debug info + // for asm implemented symbols). + Allow_untyped_symbols *bool } type stubDecorator struct { @@ -315,8 +321,18 @@ func (this *stubDecorator) findPrebuiltAbiDump(ctx ModuleContext, } // Feature flag. -func canDumpAbi() bool { - return runtime.GOOS != "darwin" +func canDumpAbi(config android.Config) bool { + if runtime.GOOS == "darwin" { + return false + } + // abidw doesn't currently handle top-byte-ignore correctly. Disable ABI + // dumping for those configs while we wait for a fix. We'll still have ABI + // checking coverage from non-hwasan builds. + // http://b/190554910 + if android.InList("hwaddress", config.SanitizeDevice()) { + return false + } + return true } // Feature flag to disable diffing against prebuilts. @@ -339,14 +355,22 @@ func (this *stubDecorator) dumpAbi(ctx ModuleContext, symbolList android.Path) { "symbolList": symbolList.String(), }, }) + this.abiDumpPath = getNdkAbiDumpInstallBase(ctx).Join(ctx, this.apiLevel.String(), ctx.Arch().ArchType.String(), this.libraryName(ctx), "abi.xml") + untypedFlag := "--abort-on-untyped-symbols" + if proptools.BoolDefault(this.properties.Allow_untyped_symbols, false) { + untypedFlag = "" + } ctx.Build(pctx, android.BuildParams{ Rule: abitidy, Description: fmt.Sprintf("abitidy %s", implementationLibrary), Input: abiRawPath, Output: this.abiDumpPath, + Args: map[string]string{ + "flags": untypedFlag, + }, }) } @@ -444,7 +468,7 @@ func (c *stubDecorator) compile(ctx ModuleContext, flags Flags, deps PathDeps) O nativeAbiResult := parseNativeAbiDefinition(ctx, symbolFile, c.apiLevel, "") objs := compileStubLibrary(ctx, flags, nativeAbiResult.stubSrc) c.versionScriptPath = nativeAbiResult.versionScript - if canDumpAbi() { + if canDumpAbi(ctx.Config()) { c.dumpAbi(ctx, nativeAbiResult.symbolList) if canDiffAbi() { c.diffAbi(ctx) |