diff options
| -rw-r--r-- | OWNERS | 6 | ||||
| -rw-r--r-- | android/androidmk.go | 2 | ||||
| -rw-r--r-- | apex/builder.go | 2 | ||||
| -rw-r--r-- | bp2build/Android.bp | 2 | ||||
| -rw-r--r-- | bp2build/cc_prebuilt_library_conversion_test.go | 4 | ||||
| -rw-r--r-- | cc/ndk_abi.go | 2 | ||||
| -rw-r--r-- | cc/ndk_library.go | 34 | ||||
| -rw-r--r-- | cc/prebuilt.go | 11 | ||||
| -rw-r--r-- | provenance/provenance_singleton.go | 17 |
9 files changed, 62 insertions, 18 deletions
@@ -2,12 +2,13 @@ # approving build related projects. # AMER -ahumesky@google.com +agespino@google.com alexmarquez@google.com asmundak@google.com ccross@android.com colefaust@google.com cparsons@google.com +dacek@google.com delmerico@google.com dwillemsen@google.com eakammer@google.com @@ -17,13 +18,12 @@ lamontjones@google.com spandandas@google.com tradical@google.com usta@google.com +vinhdaitran@google.com weiwli@google.com yudiliu@google.com -yuntaoxu@google.com # APAC jingwen@google.com -ruperts@google.com # EMEA hansson@google.com diff --git a/android/androidmk.go b/android/androidmk.go index e9c63fb70..5c715b473 100644 --- a/android/androidmk.go +++ b/android/androidmk.go @@ -578,7 +578,7 @@ func (a *AndroidMkEntries) fillInEntries(ctx fillInEntriesContext, mod blueprint } } - if !base.InRamdisk() && !base.InVendorRamdisk() { + if !base.InVendorRamdisk() { a.AddPaths("LOCAL_FULL_INIT_RC", base.initRcPaths) } if len(base.vintfFragmentsPaths) > 0 { diff --git a/apex/builder.go b/apex/builder.go index 293f388ea..abbf8ad25 100644 --- a/apex/builder.go +++ b/apex/builder.go @@ -388,7 +388,7 @@ func (a *apexBundle) buildUnflattenedApex(ctx android.ModuleContext) { imageDir := android.PathForModuleOut(ctx, "image"+suffix) - installSymbolFiles := !ctx.Config().KatiEnabled() || a.ExportedToMake() + installSymbolFiles := (!ctx.Config().KatiEnabled() || a.ExportedToMake()) && a.installable() // b/140136207. When there are overriding APEXes for a VNDK APEX, the symbols file for the overridden // APEX and the overriding APEX will have the same installation paths at /apex/com.android.vndk.v<ver> diff --git a/bp2build/Android.bp b/bp2build/Android.bp index 8f78968e4..e0ce19477 100644 --- a/bp2build/Android.bp +++ b/bp2build/Android.bp @@ -45,7 +45,9 @@ bootstrap_go_package { "cc_library_shared_conversion_test.go", "cc_library_static_conversion_test.go", "cc_object_conversion_test.go", + "cc_prebuilt_library_conversion_test.go", "cc_prebuilt_library_shared_test.go", + "cc_prebuilt_library_static_test.go", "conversion_test.go", "filegroup_conversion_test.go", "genrule_conversion_test.go", diff --git a/bp2build/cc_prebuilt_library_conversion_test.go b/bp2build/cc_prebuilt_library_conversion_test.go index 818331634..3cf896903 100644 --- a/bp2build/cc_prebuilt_library_conversion_test.go +++ b/bp2build/cc_prebuilt_library_conversion_test.go @@ -136,7 +136,7 @@ cc_prebuilt_library { }, bazel_module: { bp2build_available: true }, }`, - expectedErr: fmt.Errorf("Expected at most once source file"), + expectedErr: fmt.Errorf("Expected at most one source file"), }) } @@ -159,7 +159,7 @@ cc_prebuilt_library { }, bazel_module: { bp2build_available: true }, }`, - expectedErr: fmt.Errorf("Expected at most once source file"), + expectedErr: fmt.Errorf("Expected at most one source file"), }) } 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) diff --git a/cc/prebuilt.go b/cc/prebuilt.go index 4ad8a9030..f54c6f8d6 100644 --- a/cc/prebuilt.go +++ b/cc/prebuilt.go @@ -527,7 +527,16 @@ var _ prebuiltLinkerInterface = (*prebuiltObjectLinker)(nil) func (p *prebuiltObjectLinker) link(ctx ModuleContext, flags Flags, deps PathDeps, objs Objects) android.Path { if len(p.properties.Srcs) > 0 { - return p.Prebuilt.SingleSourcePath(ctx) + // Copy objects to a name matching the final installed name + in := p.Prebuilt.SingleSourcePath(ctx) + outputFile := android.PathForModuleOut(ctx, ctx.ModuleName()+".o") + ctx.Build(pctx, android.BuildParams{ + Rule: android.CpExecutable, + Description: "prebuilt", + Output: outputFile, + Input: in, + }) + return outputFile } return nil } diff --git a/provenance/provenance_singleton.go b/provenance/provenance_singleton.go index ae96e1f70..e49f3d4f3 100644 --- a/provenance/provenance_singleton.go +++ b/provenance/provenance_singleton.go @@ -60,29 +60,32 @@ func provenanceInfoSingletonFactory() android.Singleton { } type provenanceInfoSingleton struct { + mergedMetaDataFile android.OutputPath } -func (b *provenanceInfoSingleton) GenerateBuildActions(context android.SingletonContext) { +func (p *provenanceInfoSingleton) GenerateBuildActions(context android.SingletonContext) { allMetaDataFiles := make([]android.Path, 0) context.VisitAllModulesIf(moduleFilter, func(module android.Module) { if p, ok := module.(ProvenanceMetadata); ok { allMetaDataFiles = append(allMetaDataFiles, p.ProvenanceMetaDataFile()) } }) - mergedMetaDataFile := android.PathForOutput(context, "provenance_metadata.textproto") + p.mergedMetaDataFile = android.PathForOutput(context, "provenance_metadata.textproto") context.Build(pctx, android.BuildParams{ Rule: mergeProvenanceMetaData, Description: "merge provenance metadata", Inputs: allMetaDataFiles, - Output: mergedMetaDataFile, + Output: p.mergedMetaDataFile, }) context.Build(pctx, android.BuildParams{ Rule: blueprint.Phony, Description: "phony rule of merge provenance metadata", - Inputs: []android.Path{mergedMetaDataFile}, + Inputs: []android.Path{p.mergedMetaDataFile}, Output: android.PathForPhony(context, "provenance_metadata"), }) + + context.Phony("droidcore", android.PathForPhony(context, "provenance_metadata")) } func moduleFilter(module android.Module) bool { @@ -110,3 +113,9 @@ func GenerateArtifactProvenanceMetaData(ctx android.ModuleContext, artifactPath return artifactMetaDataFile } + +func (p *provenanceInfoSingleton) MakeVars(ctx android.MakeVarsContext) { + ctx.DistForGoal("droidcore", p.mergedMetaDataFile) +} + +var _ android.SingletonMakeVarsProvider = (*provenanceInfoSingleton)(nil) |