diff options
Diffstat (limited to 'cc')
-rw-r--r-- | cc/androidmk.go | 2 | ||||
-rw-r--r-- | cc/builder.go | 4 | ||||
-rw-r--r-- | cc/cc.go | 13 | ||||
-rw-r--r-- | cc/compiler.go | 13 | ||||
-rw-r--r-- | cc/fuzz.go | 2 | ||||
-rw-r--r-- | cc/library.go | 19 | ||||
-rw-r--r-- | cc/linker.go | 2 | ||||
-rw-r--r-- | cc/llndk_library.go | 11 | ||||
-rw-r--r-- | cc/makevars.go | 2 | ||||
-rw-r--r-- | cc/ndk_abi.go | 4 | ||||
-rw-r--r-- | cc/ndk_library.go | 2 | ||||
-rw-r--r-- | cc/ndk_sysroot.go | 2 | ||||
-rw-r--r-- | cc/sabi.go | 6 | ||||
-rw-r--r-- | cc/sanitize.go | 39 | ||||
-rw-r--r-- | cc/tidy.go | 2 | ||||
-rw-r--r-- | cc/vndk.go | 9 |
16 files changed, 88 insertions, 44 deletions
diff --git a/cc/androidmk.go b/cc/androidmk.go index ef2636625..071d829bf 100644 --- a/cc/androidmk.go +++ b/cc/androidmk.go @@ -88,7 +88,7 @@ func (c *Module) AndroidMkEntries() []android.AndroidMkEntries { ExtraEntries: []android.AndroidMkExtraEntriesFunc{ func(ctx android.AndroidMkExtraEntriesContext, entries *android.AndroidMkEntries) { if len(c.Properties.Logtags) > 0 { - entries.AddStrings("LOCAL_LOGTAGS_FILES", c.Properties.Logtags...) + entries.AddStrings("LOCAL_SOONG_LOGTAGS_FILES", c.logtagsPaths.Strings()...) } // Note: Pass the exact value of AndroidMkSystemSharedLibs to the Make // world, even if it is an empty list. In the Make world, diff --git a/cc/builder.go b/cc/builder.go index e78b8c0de..e255cbebb 100644 --- a/cc/builder.go +++ b/cc/builder.go @@ -608,6 +608,10 @@ func transformSourceToObj(ctx ModuleContext, subdir string, srcFiles, noTidySrcs ccCmd = "clang++" moduleFlags = cppflags moduleToolingFlags = toolingCppflags + case ".rs": + // A source provider (e.g. rust_bindgen) may provide both rs and c files. + // Ignore the rs files. + continue case ".h", ".hpp": ctx.PropertyErrorf("srcs", "Header file %s is not supported, instead use export_include_dirs or local_include_dirs.", srcFile) continue @@ -320,7 +320,7 @@ type BaseProperties struct { // *.logtags files, to combine together in order to generate the /system/etc/event-log-tags // file - Logtags []string + Logtags []string `android:"path"` // Make this module available when building for ramdisk. // On device without a dedicated recovery partition, the module is only @@ -909,6 +909,8 @@ type Module struct { // Aconfig files for all transitive deps. Also exposed via TransitiveDeclarationsInfo mergedAconfigFiles map[string]android.Paths + + logtagsPaths android.Paths } func (c *Module) AddJSONData(d *map[string]interface{}) { @@ -1998,6 +2000,11 @@ func (d *Defaults) GenerateAndroidBuildActions(ctx android.ModuleContext) { func (c *Module) GenerateAndroidBuildActions(actx android.ModuleContext) { ctx := moduleContextFromAndroidModuleContext(actx, c) + c.logtagsPaths = android.PathsForModuleSrc(actx, c.Properties.Logtags) + android.SetProvider(ctx, android.LogtagsProviderKey, &android.LogtagsInfo{ + Logtags: c.logtagsPaths, + }) + // If Test_only is set on a module in bp file, respect the setting, otherwise // see if is a known test module type. testOnly := c.testModule || c.testLibrary() @@ -2509,7 +2516,7 @@ func (c *Module) shouldUseApiSurface() bool { } func (c *Module) DepsMutator(actx android.BottomUpMutatorContext) { - if !c.Enabled() { + if !c.Enabled(actx) { return } @@ -2757,7 +2764,7 @@ func (c *Module) DepsMutator(actx android.BottomUpMutatorContext) { } func BeginMutator(ctx android.BottomUpMutatorContext) { - if c, ok := ctx.Module().(*Module); ok && c.Enabled() { + if c, ok := ctx.Module().(*Module); ok && c.Enabled(ctx) { c.beginMutator(ctx) } } diff --git a/cc/compiler.go b/cc/compiler.go index 9a961cfb9..a1b329e2c 100644 --- a/cc/compiler.go +++ b/cc/compiler.go @@ -141,6 +141,19 @@ type BaseCompilerProperties struct { Flags []string } + // Populated by aidl_interface CPP backend to let other modules (e.g. cc_cmake_snapshot) + // access actual source files and not generated cpp intermediary sources. + AidlInterface struct { + // list of aidl_interface sources + Sources []string `blueprint:"mutated"` + + // AIDL backend language (e.g. "cpp", "ndk") + Lang string `blueprint:"mutated"` + + // list of flags passed to AIDL generator + Flags []string `blueprint:"mutated"` + } `blueprint:"mutated"` + Renderscript struct { // list of directories that will be added to the llvm-rs-cc include paths Include_dirs []string diff --git a/cc/fuzz.go b/cc/fuzz.go index 2436f33d2..b3e663962 100644 --- a/cc/fuzz.go +++ b/cc/fuzz.go @@ -433,7 +433,7 @@ func (s *ccRustFuzzPackager) GenerateBuildActions(ctx android.SingletonContext) return } // Discard non-fuzz targets. - if ok := fuzz.IsValid(ccModule.FuzzModuleStruct()); !ok { + if ok := fuzz.IsValid(ctx, ccModule.FuzzModuleStruct()); !ok { return } diff --git a/cc/library.go b/cc/library.go index a436649d0..12ecc131a 100644 --- a/cc/library.go +++ b/cc/library.go @@ -1322,7 +1322,7 @@ func currRefAbiDumpSdkVersion(ctx ModuleContext) string { // sourceAbiDiff registers a build statement to compare linked sAbi dump files (.lsdump). func (library *libraryDecorator) sourceAbiDiff(ctx android.ModuleContext, sourceDump, referenceDump android.Path, - baseName, nameExt string, isLlndkOrNdk, allowExtensions bool, + baseName, nameExt string, isLlndk, allowExtensions bool, sourceVersion, errorMessage string) { extraFlags := []string{"-target-version", sourceVersion} @@ -1334,7 +1334,7 @@ func (library *libraryDecorator) sourceAbiDiff(ctx android.ModuleContext, "-allow-unreferenced-changes", "-allow-unreferenced-elf-symbol-changes") } - if isLlndkOrNdk { + if isLlndk { extraFlags = append(extraFlags, "-consider-opaque-types-different") } if allowExtensions { @@ -1350,23 +1350,23 @@ func (library *libraryDecorator) sourceAbiDiff(ctx android.ModuleContext, func (library *libraryDecorator) crossVersionAbiDiff(ctx android.ModuleContext, sourceDump, referenceDump android.Path, - baseName string, isLlndkOrNdk bool, sourceVersion, prevVersion string) { + baseName string, isLlndk bool, sourceVersion, prevVersion string) { errorMessage := "error: Please follow https://android.googlesource.com/platform/development/+/main/vndk/tools/header-checker/README.md#configure-cross_version-abi-check to resolve the ABI difference between your source code and version " + prevVersion + "." library.sourceAbiDiff(ctx, sourceDump, referenceDump, baseName, prevVersion, - isLlndkOrNdk, true /* allowExtensions */, sourceVersion, errorMessage) + isLlndk, true /* allowExtensions */, sourceVersion, errorMessage) } func (library *libraryDecorator) sameVersionAbiDiff(ctx android.ModuleContext, sourceDump, referenceDump android.Path, - baseName, nameExt string, isLlndkOrNdk bool) { + baseName, nameExt string, isLlndk bool) { libName := strings.TrimSuffix(baseName, filepath.Ext(baseName)) errorMessage := "error: Please update ABI references with: $$ANDROID_BUILD_TOP/development/vndk/tools/header-checker/utils/create_reference_dumps.py -l " + libName library.sourceAbiDiff(ctx, sourceDump, referenceDump, baseName, nameExt, - isLlndkOrNdk, false /* allowExtensions */, "current", errorMessage) + isLlndk, false /* allowExtensions */, "current", errorMessage) } func (library *libraryDecorator) optInAbiDiff(ctx android.ModuleContext, @@ -1381,7 +1381,7 @@ func (library *libraryDecorator) optInAbiDiff(ctx android.ModuleContext, } library.sourceAbiDiff(ctx, sourceDump, referenceDump, baseName, nameExt, - false /* isLlndkOrNdk */, false /* allowExtensions */, "current", errorMessage) + false /* isLlndk */, false /* allowExtensions */, "current", errorMessage) } func (library *libraryDecorator) linkSAbiDumpFiles(ctx ModuleContext, deps PathDeps, objs Objects, fileName string, soFile android.Path) { @@ -1436,7 +1436,6 @@ func (library *libraryDecorator) linkSAbiDumpFiles(ctx ModuleContext, deps PathD dumpDir := filepath.Join("prebuilts", "abi-dumps", dumpDirName) isLlndk := (tag == llndkLsdumpTag) isApex := (tag == apexLsdumpTag) - isNdk := (tag == ndkLsdumpTag) binderBitness := ctx.DeviceConfig().BinderBitness() nameExt := "" if isLlndk { @@ -1468,7 +1467,7 @@ func (library *libraryDecorator) linkSAbiDumpFiles(ctx ModuleContext, deps PathD prevDumpFile := getRefAbiDumpFile(ctx, prevDumpDir, fileName) if prevDumpFile.Valid() { library.crossVersionAbiDiff(ctx, sourceDump, prevDumpFile.Path(), - fileName, isLlndk || isNdk, currVersion, nameExt+prevVersion) + fileName, isLlndk, currVersion, nameExt+prevVersion) } // Check against the current version. sourceDump = implDump @@ -1488,7 +1487,7 @@ func (library *libraryDecorator) linkSAbiDumpFiles(ctx ModuleContext, deps PathD currDumpFile := getRefAbiDumpFile(ctx, currDumpDir, fileName) if currDumpFile.Valid() { library.sameVersionAbiDiff(ctx, sourceDump, currDumpFile.Path(), - fileName, nameExt, isLlndk || isNdk) + fileName, nameExt, isLlndk) } } // Check against the opt-in reference dumps. diff --git a/cc/linker.go b/cc/linker.go index 9686697c8..56a68b2ce 100644 --- a/cc/linker.go +++ b/cc/linker.go @@ -330,6 +330,7 @@ func (linker *baseLinker) linkerDeps(ctx DepsContext, deps Deps) Deps { deps.StaticLibs = removeListFromList(deps.StaticLibs, linker.Properties.Target.Vendor.Exclude_static_libs) deps.HeaderLibs = append(deps.HeaderLibs, linker.Properties.Target.Vendor.Header_libs...) deps.HeaderLibs = removeListFromList(deps.HeaderLibs, linker.Properties.Target.Vendor.Exclude_header_libs) + deps.ReexportHeaderLibHeaders = removeListFromList(deps.ReexportHeaderLibHeaders, linker.Properties.Target.Vendor.Exclude_header_libs) deps.ReexportStaticLibHeaders = removeListFromList(deps.ReexportStaticLibHeaders, linker.Properties.Target.Vendor.Exclude_static_libs) deps.WholeStaticLibs = removeListFromList(deps.WholeStaticLibs, linker.Properties.Target.Vendor.Exclude_static_libs) deps.RuntimeLibs = removeListFromList(deps.RuntimeLibs, linker.Properties.Target.Vendor.Exclude_runtime_libs) @@ -342,6 +343,7 @@ func (linker *baseLinker) linkerDeps(ctx DepsContext, deps Deps) Deps { deps.StaticLibs = append(deps.StaticLibs, linker.Properties.Target.Product.Static_libs...) deps.StaticLibs = removeListFromList(deps.StaticLibs, linker.Properties.Target.Product.Exclude_static_libs) deps.HeaderLibs = removeListFromList(deps.HeaderLibs, linker.Properties.Target.Product.Exclude_header_libs) + deps.ReexportHeaderLibHeaders = removeListFromList(deps.ReexportHeaderLibHeaders, linker.Properties.Target.Product.Exclude_header_libs) deps.ReexportStaticLibHeaders = removeListFromList(deps.ReexportStaticLibHeaders, linker.Properties.Target.Product.Exclude_static_libs) deps.WholeStaticLibs = removeListFromList(deps.WholeStaticLibs, linker.Properties.Target.Product.Exclude_static_libs) deps.RuntimeLibs = removeListFromList(deps.RuntimeLibs, linker.Properties.Target.Product.Exclude_runtime_libs) diff --git a/cc/llndk_library.go b/cc/llndk_library.go index ae9da9851..5b86c6478 100644 --- a/cc/llndk_library.go +++ b/cc/llndk_library.go @@ -121,6 +121,11 @@ func (txt *llndkLibrariesTxtModule) GenerateAndroidBuildActions(ctx android.Modu } func (txt *llndkLibrariesTxtModule) GenerateSingletonBuildActions(ctx android.SingletonContext) { + if txt.outputFile.String() == "" { + // Skip if target file path is empty + return + } + ctx.VisitAllModules(func(m android.Module) { if c, ok := m.(*Module); ok && c.VendorProperties.IsLLNDK && !c.Header() && !c.IsVndkPrebuiltLibrary() { filename, err := getVndkFileName(c) @@ -181,7 +186,7 @@ func llndkMutator(mctx android.BottomUpMutatorContext) { return } - if shouldSkipLlndkMutator(m) { + if shouldSkipLlndkMutator(mctx, m) { return } @@ -201,8 +206,8 @@ func llndkMutator(mctx android.BottomUpMutatorContext) { } // Check for modules that mustn't be LLNDK -func shouldSkipLlndkMutator(m *Module) bool { - if !m.Enabled() { +func shouldSkipLlndkMutator(mctx android.BottomUpMutatorContext, m *Module) bool { + if !m.Enabled(mctx) { return true } if !m.Device() { diff --git a/cc/makevars.go b/cc/makevars.go index 9251d6a49..51bcbf090 100644 --- a/cc/makevars.go +++ b/cc/makevars.go @@ -279,7 +279,7 @@ func makeVarsToolchain(ctx android.MakeVarsContext, secondPrefix string, sanitizerLibs := android.SortedStringValues(sanitizerVariables) var sanitizerLibStems []string ctx.VisitAllModules(func(m android.Module) { - if !m.Enabled() { + if !m.Enabled(ctx) { return } diff --git a/cc/ndk_abi.go b/cc/ndk_abi.go index 86166dcbb..5beeab1ee 100644 --- a/cc/ndk_abi.go +++ b/cc/ndk_abi.go @@ -40,7 +40,7 @@ type ndkAbiDumpSingleton struct{} func (n *ndkAbiDumpSingleton) GenerateBuildActions(ctx android.SingletonContext) { var depPaths android.Paths ctx.VisitAllModules(func(module android.Module) { - if !module.Enabled() { + if !module.Enabled(ctx) { return } @@ -78,7 +78,7 @@ type ndkAbiDiffSingleton struct{} func (n *ndkAbiDiffSingleton) GenerateBuildActions(ctx android.SingletonContext) { var depPaths android.Paths ctx.VisitAllModules(func(module android.Module) { - if m, ok := module.(android.Module); ok && !m.Enabled() { + if m, ok := module.(android.Module); ok && !m.Enabled(ctx) { return } diff --git a/cc/ndk_library.go b/cc/ndk_library.go index 25231fdf5..f32606814 100644 --- a/cc/ndk_library.go +++ b/cc/ndk_library.go @@ -148,7 +148,7 @@ func ndkLibraryVersions(ctx android.BaseMutatorContext, from android.ApiLevel) [ } func (this *stubDecorator) stubsVersions(ctx android.BaseMutatorContext) []string { - if !ctx.Module().Enabled() { + if !ctx.Module().Enabled(ctx) { return nil } if ctx.Target().NativeBridge == android.NativeBridgeEnabled { diff --git a/cc/ndk_sysroot.go b/cc/ndk_sysroot.go index e815172ae..3c48f6881 100644 --- a/cc/ndk_sysroot.go +++ b/cc/ndk_sysroot.go @@ -150,7 +150,7 @@ func (n *ndkSingleton) GenerateBuildActions(ctx android.SingletonContext) { var installPaths android.Paths var licensePaths android.Paths ctx.VisitAllModules(func(module android.Module) { - if m, ok := module.(android.Module); ok && !m.Enabled() { + if m, ok := module.(android.Module); ok && !m.Enabled(ctx) { return } diff --git a/cc/sabi.go b/cc/sabi.go index cd9bf6393..edd9cfe80 100644 --- a/cc/sabi.go +++ b/cc/sabi.go @@ -31,7 +31,6 @@ type lsdumpTag string const ( apexLsdumpTag lsdumpTag = "APEX" llndkLsdumpTag lsdumpTag = "LLNDK" - ndkLsdumpTag lsdumpTag = "NDK" platformLsdumpTag lsdumpTag = "PLATFORM" productLsdumpTag lsdumpTag = "PRODUCT" vendorLsdumpTag lsdumpTag = "VENDOR" @@ -42,8 +41,6 @@ func (tag *lsdumpTag) dirName() string { switch *tag { case apexLsdumpTag: return "platform" - case ndkLsdumpTag: - return "ndk" case llndkLsdumpTag: return "vndk" case platformLsdumpTag: @@ -137,9 +134,6 @@ func classifySourceAbiDump(ctx android.BaseModuleContext) []lsdumpTag { if m.isImplementationForLLNDKPublic() { result = append(result, llndkLsdumpTag) } - if m.IsNdk(ctx.Config()) { - result = append(result, ndkLsdumpTag) - } // APEX and opt-in platform dumps are placed in the same directory. if m.library.hasStubsVariants() { result = append(result, apexLsdumpTag) diff --git a/cc/sanitize.go b/cc/sanitize.go index 2a1ee3c5f..1a94729c6 100644 --- a/cc/sanitize.go +++ b/cc/sanitize.go @@ -82,7 +82,7 @@ var ( hwasanGlobalOptions = []string{"heap_history_size=1023", "stack_history_size=512", "export_memory_stats=0", "max_malloc_fill_size=131072", "malloc_fill_byte=0"} memtagStackCommonFlags = []string{"-march=armv8-a+memtag"} - memtagStackLlvmFlags = []string{"-dom-tree-reachability-max-bbs-to-explore=128"} + memtagStackLlvmFlags = []string{"-dom-tree-reachability-max-bbs-to-explore=128"} hostOnlySanitizeFlags = []string{"-fno-sanitize-recover=all"} deviceOnlySanitizeFlags = []string{"-fsanitize-trap=all"} @@ -176,11 +176,11 @@ func (t SanitizerType) name() string { func (t SanitizerType) registerMutators(ctx android.RegisterMutatorsContext) { switch t { - case cfi, Hwasan, Asan, tsan, Fuzzer, scs: + case cfi, Hwasan, Asan, tsan, Fuzzer, scs, Memtag_stack: sanitizer := &sanitizerSplitMutator{t} ctx.TopDown(t.variationName()+"_markapexes", sanitizer.markSanitizableApexesMutator) ctx.Transition(t.variationName(), sanitizer) - case Memtag_heap, Memtag_stack, Memtag_globals, intOverflow: + case Memtag_heap, Memtag_globals, intOverflow: // do nothing default: panic(fmt.Errorf("unknown SanitizerType %d", t)) @@ -407,6 +407,7 @@ func init() { android.RegisterMakeVarsProvider(pctx, cfiMakeVarsProvider) android.RegisterMakeVarsProvider(pctx, hwasanMakeVarsProvider) + android.RegisterMakeVarsProvider(pctx, memtagStackMakeVarsProvider) } func (sanitize *sanitize) props() []interface{} { @@ -683,10 +684,14 @@ func (sanitize *sanitize) begin(ctx BaseModuleContext) { s.Diag.Cfi = nil } - // HWASan ramdisk (which is built from recovery) goes over some bootloader limit. - // Keep libc instrumented so that ramdisk / vendor_ramdisk / recovery can run hwasan-instrumented code if necessary. - if (ctx.inRamdisk() || ctx.inVendorRamdisk() || ctx.inRecovery()) && !strings.HasPrefix(ctx.ModuleDir(), "bionic/libc") { - s.Hwaddress = nil + if ctx.inRamdisk() || ctx.inVendorRamdisk() || ctx.inRecovery() { + // HWASan ramdisk (which is built from recovery) goes over some bootloader limit. + // Keep libc instrumented so that ramdisk / vendor_ramdisk / recovery can run hwasan-instrumented code if necessary. + if !strings.HasPrefix(ctx.ModuleDir(), "bionic/libc") { + s.Hwaddress = nil + } + // Memtag stack in ramdisk makes pKVM unhappy. + s.Memtag_stack = nil } if ctx.staticBinary() { @@ -858,7 +863,7 @@ func (s *sanitize) flags(ctx ModuleContext, flags Flags) Flags { flags.Local.CFlags = append(flags.Local.CFlags, cfiCflags...) flags.Local.AsFlags = append(flags.Local.AsFlags, cfiAsflags...) - flags.CFlagsDeps = append(flags.CFlagsDeps, android.PathForSource(ctx, cfiBlocklistPath + "/" + cfiBlocklistFilename)) + flags.CFlagsDeps = append(flags.CFlagsDeps, android.PathForSource(ctx, cfiBlocklistPath+"/"+cfiBlocklistFilename)) if Bool(s.Properties.Sanitize.Config.Cfi_assembly_support) { flags.Local.CFlags = append(flags.Local.CFlags, cfiAssemblySupportFlag) } @@ -1310,6 +1315,8 @@ func (s *sanitizerSplitMutator) Mutate(mctx android.BottomUpMutatorContext, vari hwasanStaticLibs(mctx.Config()).add(c, c.Module().Name()) } else if s.sanitizer == cfi { cfiStaticLibs(mctx.Config()).add(c, c.Module().Name()) + } else if s.sanitizer == Memtag_stack { + memtagStackStaticLibs(mctx.Config()).add(c, c.Module().Name()); } } } else if c.IsSanitizerEnabled(s.sanitizer) { @@ -1378,7 +1385,7 @@ func sanitizerRuntimeDepsMutator(mctx android.TopDownMutatorContext) { // Add the dependency to the runtime library for each of the sanitizer variants func sanitizerRuntimeMutator(mctx android.BottomUpMutatorContext) { if c, ok := mctx.Module().(*Module); ok && c.sanitize != nil { - if !c.Enabled() { + if !c.Enabled(mctx) { return } var sanitizers []string @@ -1559,7 +1566,7 @@ func sanitizerRuntimeMutator(mctx android.BottomUpMutatorContext) { addStaticDeps(config.BuiltinsRuntimeLibrary(toolchain), true) } - if runtimeSharedLibrary != "" && (toolchain.Bionic() || toolchain.Musl() || c.sanitize.Properties.UbsanRuntimeDep) { + if runtimeSharedLibrary != "" && (toolchain.Bionic() || toolchain.Musl()) { // UBSan is supported on non-bionic linux host builds as well // Adding dependency to the runtime library. We are using *FarVariation* @@ -1722,6 +1729,14 @@ func hwasanStaticLibs(config android.Config) *sanitizerStaticLibsMap { }).(*sanitizerStaticLibsMap) } +var memtagStackStaticLibsKey = android.NewOnceKey("memtagStackStaticLibs") + +func memtagStackStaticLibs(config android.Config) *sanitizerStaticLibsMap { + return config.Once(memtagStackStaticLibsKey, func() interface{} { + return newSanitizerStaticLibsMap(Memtag_stack) + }).(*sanitizerStaticLibsMap) +} + func enableMinimalRuntime(sanitize *sanitize) bool { if sanitize.isSanitizerEnabled(Asan) { return false @@ -1768,3 +1783,7 @@ func cfiMakeVarsProvider(ctx android.MakeVarsContext) { func hwasanMakeVarsProvider(ctx android.MakeVarsContext) { hwasanStaticLibs(ctx.Config()).exportToMake(ctx) } + +func memtagStackMakeVarsProvider(ctx android.MakeVarsContext) { + memtagStackStaticLibs(ctx.Config()).exportToMake(ctx) +} diff --git a/cc/tidy.go b/cc/tidy.go index 76ac7d583..ec1e8a206 100644 --- a/cc/tidy.go +++ b/cc/tidy.go @@ -220,7 +220,7 @@ func collectTidyObjModuleTargets(ctx android.SingletonContext, module android.Mo // (1) Collect all obj/tidy files into OS-specific groups. ctx.VisitAllModuleVariants(module, func(variant android.Module) { - if ctx.Config().KatiEnabled() && android.ShouldSkipAndroidMkProcessing(variant) { + if ctx.Config().KatiEnabled() && android.ShouldSkipAndroidMkProcessing(ctx, variant) { return } if m, ok := variant.(*Module); ok { diff --git a/cc/vndk.go b/cc/vndk.go index 50e6d4b96..548992d37 100644 --- a/cc/vndk.go +++ b/cc/vndk.go @@ -322,8 +322,8 @@ func processVndkLibrary(mctx android.BottomUpMutatorContext, m *Module) { } // Check for modules that mustn't be VNDK -func shouldSkipVndkMutator(m *Module) bool { - if !m.Enabled() { +func shouldSkipVndkMutator(ctx android.ConfigAndErrorContext, m *Module) bool { + if !m.Enabled(ctx) { return true } if !m.Device() { @@ -338,7 +338,7 @@ func shouldSkipVndkMutator(m *Module) bool { } func IsForVndkApex(mctx android.BottomUpMutatorContext, m *Module) bool { - if shouldSkipVndkMutator(m) { + if shouldSkipVndkMutator(mctx, m) { return false } @@ -369,7 +369,7 @@ func VndkMutator(mctx android.BottomUpMutatorContext) { return } - if shouldSkipVndkMutator(m) { + if shouldSkipVndkMutator(mctx, m) { return } @@ -548,6 +548,7 @@ func (txt *vndkLibrariesTxt) SubDir() string { func (txt *vndkLibrariesTxt) OutputFiles(tag string) (android.Paths, error) { return android.Paths{txt.outputFile}, nil } + func getVndkFileName(m *Module) (string, error) { if library, ok := m.linker.(*libraryDecorator); ok { return library.getLibNameHelper(m.BaseModuleName(), true, false) + ".so", nil |