blob: 9672c0fff0a0c4603e048711553e42dc195683e2 [file] [log] [blame]
Inseob Kimde5744a2020-12-02 13:14:28 +09001// Copyright 2020 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14package cc
15
16// This file defines snapshot prebuilt modules, e.g. vendor snapshot and recovery snapshot. Such
17// snapshot modules will override original source modules with setting BOARD_VNDK_VERSION, with
18// snapshot mutators and snapshot information maps which are also defined in this file.
19
20import (
21 "strings"
Inseob Kimde5744a2020-12-02 13:14:28 +090022
23 "android/soong/android"
Kiyoung Kim48f37782021-07-07 12:42:39 +090024 "android/soong/snapshot"
Jose Galmes6f843bc2020-12-11 13:36:29 -080025
Colin Crosse0edaf92021-01-11 17:31:17 -080026 "github.com/google/blueprint"
Inseob Kimde5744a2020-12-02 13:14:28 +090027)
28
Kiyoung Kim48f37782021-07-07 12:42:39 +090029// This interface overrides snapshot.SnapshotImage to implement cc module specific functions
Ivan Lozanod1dec542021-05-26 15:33:11 -040030type SnapshotImage interface {
Kiyoung Kim48f37782021-07-07 12:42:39 +090031 snapshot.SnapshotImage
Colin Crosse0edaf92021-01-11 17:31:17 -080032
33 // The image variant name for this snapshot image.
34 // For example, recovery snapshot image will return "recovery", and vendor snapshot image will
35 // return "vendor." + version.
36 imageVariantName(cfg android.DeviceConfig) string
37
38 // The variant suffix for snapshot modules. For example, vendor snapshot modules will have
39 // ".vendor" as their suffix.
40 moduleNameSuffix() string
Inseob Kimde5744a2020-12-02 13:14:28 +090041}
42
Kiyoung Kim48f37782021-07-07 12:42:39 +090043type vendorSnapshotImage struct {
44 *snapshot.VendorSnapshotImage
Inseob Kimde5744a2020-12-02 13:14:28 +090045}
46
Kiyoung Kim48f37782021-07-07 12:42:39 +090047type recoverySnapshotImage struct {
48 *snapshot.RecoverySnapshotImage
Inseob Kim7cf14652021-01-06 23:06:52 +090049}
50
Colin Crosse0edaf92021-01-11 17:31:17 -080051func (vendorSnapshotImage) imageVariantName(cfg android.DeviceConfig) string {
52 return VendorVariationPrefix + cfg.VndkVersion()
53}
54
55func (vendorSnapshotImage) moduleNameSuffix() string {
Ivan Lozanoe6d30982021-02-05 10:57:43 -050056 return VendorSuffix
Colin Crosse0edaf92021-01-11 17:31:17 -080057}
58
Colin Crosse0edaf92021-01-11 17:31:17 -080059func (recoverySnapshotImage) imageVariantName(cfg android.DeviceConfig) string {
60 return android.RecoveryVariation
61}
62
63func (recoverySnapshotImage) moduleNameSuffix() string {
64 return recoverySuffix
65}
66
Kiyoung Kim48f37782021-07-07 12:42:39 +090067// Override existing vendor and recovery snapshot for cc module specific extra functions
68var VendorSnapshotImageSingleton vendorSnapshotImage = vendorSnapshotImage{&snapshot.VendorSnapshotImageSingleton}
69var recoverySnapshotImageSingleton recoverySnapshotImage = recoverySnapshotImage{&snapshot.RecoverySnapshotImageSingleton}
70
71func RegisterVendorSnapshotModules(ctx android.RegistrationContext) {
72 ctx.RegisterModuleType("vendor_snapshot", vendorSnapshotFactory)
73 ctx.RegisterModuleType("vendor_snapshot_shared", VendorSnapshotSharedFactory)
74 ctx.RegisterModuleType("vendor_snapshot_static", VendorSnapshotStaticFactory)
75 ctx.RegisterModuleType("vendor_snapshot_header", VendorSnapshotHeaderFactory)
76 ctx.RegisterModuleType("vendor_snapshot_binary", VendorSnapshotBinaryFactory)
77 ctx.RegisterModuleType("vendor_snapshot_object", VendorSnapshotObjectFactory)
78}
79
80func RegisterRecoverySnapshotModules(ctx android.RegistrationContext) {
81 ctx.RegisterModuleType("recovery_snapshot", recoverySnapshotFactory)
82 ctx.RegisterModuleType("recovery_snapshot_shared", RecoverySnapshotSharedFactory)
83 ctx.RegisterModuleType("recovery_snapshot_static", RecoverySnapshotStaticFactory)
84 ctx.RegisterModuleType("recovery_snapshot_header", RecoverySnapshotHeaderFactory)
85 ctx.RegisterModuleType("recovery_snapshot_binary", RecoverySnapshotBinaryFactory)
86 ctx.RegisterModuleType("recovery_snapshot_object", RecoverySnapshotObjectFactory)
87}
Inseob Kimde5744a2020-12-02 13:14:28 +090088
89func init() {
Kiyoung Kim48f37782021-07-07 12:42:39 +090090 RegisterVendorSnapshotModules(android.InitRegistrationContext)
91 RegisterRecoverySnapshotModules(android.InitRegistrationContext)
Justin Yund9e05752021-07-13 11:36:24 +090092 android.RegisterMakeVarsProvider(pctx, snapshotMakeVarsProvider)
Inseob Kimde5744a2020-12-02 13:14:28 +090093}
94
95const (
Colin Crosse0edaf92021-01-11 17:31:17 -080096 snapshotHeaderSuffix = "_header."
Ivan Lozanod1dec542021-05-26 15:33:11 -040097 SnapshotSharedSuffix = "_shared."
98 SnapshotStaticSuffix = "_static."
Colin Crosse0edaf92021-01-11 17:31:17 -080099 snapshotBinarySuffix = "_binary."
100 snapshotObjectSuffix = "_object."
Ivan Lozano3149e6e2021-06-01 15:09:53 -0400101 SnapshotRlibSuffix = "_rlib."
Inseob Kimde5744a2020-12-02 13:14:28 +0900102)
103
Colin Crosse0edaf92021-01-11 17:31:17 -0800104type SnapshotProperties struct {
105 Header_libs []string `android:"arch_variant"`
106 Static_libs []string `android:"arch_variant"`
107 Shared_libs []string `android:"arch_variant"`
Ivan Lozano3149e6e2021-06-01 15:09:53 -0400108 Rlibs []string `android:"arch_variant"`
Colin Crosse0edaf92021-01-11 17:31:17 -0800109 Vndk_libs []string `android:"arch_variant"`
110 Binaries []string `android:"arch_variant"`
111 Objects []string `android:"arch_variant"`
112}
Kiyoung Kim48f37782021-07-07 12:42:39 +0900113type snapshotModule struct {
Colin Crosse0edaf92021-01-11 17:31:17 -0800114 android.ModuleBase
115
116 properties SnapshotProperties
117
Ivan Lozanod1dec542021-05-26 15:33:11 -0400118 baseSnapshot BaseSnapshotDecorator
Colin Crosse0edaf92021-01-11 17:31:17 -0800119
Ivan Lozanod1dec542021-05-26 15:33:11 -0400120 image SnapshotImage
Colin Crosse0edaf92021-01-11 17:31:17 -0800121}
122
Kiyoung Kim48f37782021-07-07 12:42:39 +0900123func (s *snapshotModule) ImageMutatorBegin(ctx android.BaseModuleContext) {
Colin Crosse0edaf92021-01-11 17:31:17 -0800124 cfg := ctx.DeviceConfig()
Kiyoung Kim48f37782021-07-07 12:42:39 +0900125 if !s.image.IsUsingSnapshot(cfg) || s.image.TargetSnapshotVersion(cfg) != s.baseSnapshot.Version() {
Colin Crosse0edaf92021-01-11 17:31:17 -0800126 s.Disable()
127 }
128}
129
Kiyoung Kim48f37782021-07-07 12:42:39 +0900130func (s *snapshotModule) CoreVariantNeeded(ctx android.BaseModuleContext) bool {
Colin Crosse0edaf92021-01-11 17:31:17 -0800131 return false
132}
133
Kiyoung Kim48f37782021-07-07 12:42:39 +0900134func (s *snapshotModule) RamdiskVariantNeeded(ctx android.BaseModuleContext) bool {
Colin Crosse0edaf92021-01-11 17:31:17 -0800135 return false
136}
137
Kiyoung Kim48f37782021-07-07 12:42:39 +0900138func (s *snapshotModule) VendorRamdiskVariantNeeded(ctx android.BaseModuleContext) bool {
Colin Crosse0edaf92021-01-11 17:31:17 -0800139 return false
140}
141
Kiyoung Kim48f37782021-07-07 12:42:39 +0900142func (s *snapshotModule) DebugRamdiskVariantNeeded(ctx android.BaseModuleContext) bool {
Inseob Kim08758f02021-04-08 21:13:22 +0900143 return false
144}
145
Kiyoung Kim48f37782021-07-07 12:42:39 +0900146func (s *snapshotModule) RecoveryVariantNeeded(ctx android.BaseModuleContext) bool {
Colin Crosse0edaf92021-01-11 17:31:17 -0800147 return false
148}
149
Kiyoung Kim48f37782021-07-07 12:42:39 +0900150func (s *snapshotModule) ExtraImageVariations(ctx android.BaseModuleContext) []string {
Colin Crosse0edaf92021-01-11 17:31:17 -0800151 return []string{s.image.imageVariantName(ctx.DeviceConfig())}
152}
153
Kiyoung Kim48f37782021-07-07 12:42:39 +0900154func (s *snapshotModule) SetImageVariation(ctx android.BaseModuleContext, variation string, module android.Module) {
Colin Crosse0edaf92021-01-11 17:31:17 -0800155}
156
Kiyoung Kim48f37782021-07-07 12:42:39 +0900157func (s *snapshotModule) GenerateAndroidBuildActions(ctx android.ModuleContext) {
Colin Crosse0edaf92021-01-11 17:31:17 -0800158 // Nothing, the snapshot module is only used to forward dependency information in DepsMutator.
159}
160
Justin Yun07b9f862021-02-26 14:00:03 +0900161func getSnapshotNameSuffix(moduleSuffix, version, arch string) string {
162 versionSuffix := version
163 if arch != "" {
164 versionSuffix += "." + arch
165 }
166 return moduleSuffix + versionSuffix
167}
Colin Crosse0edaf92021-01-11 17:31:17 -0800168
Kiyoung Kim48f37782021-07-07 12:42:39 +0900169func (s *snapshotModule) DepsMutator(ctx android.BottomUpMutatorContext) {
Justin Yun07b9f862021-02-26 14:00:03 +0900170 collectSnapshotMap := func(names []string, snapshotSuffix, moduleSuffix string) map[string]string {
Colin Crosse0edaf92021-01-11 17:31:17 -0800171 snapshotMap := make(map[string]string)
Justin Yun48138672021-02-25 18:21:27 +0900172 for _, name := range names {
173 snapshotMap[name] = name +
Justin Yun07b9f862021-02-26 14:00:03 +0900174 getSnapshotNameSuffix(snapshotSuffix+moduleSuffix,
Ivan Lozanod1dec542021-05-26 15:33:11 -0400175 s.baseSnapshot.Version(),
Jose Galmesf9523ed2021-04-06 19:48:10 -0700176 ctx.DeviceConfig().Arches()[0].ArchType.String())
Colin Crosse0edaf92021-01-11 17:31:17 -0800177 }
178 return snapshotMap
179 }
180
181 snapshotSuffix := s.image.moduleNameSuffix()
Justin Yun07b9f862021-02-26 14:00:03 +0900182 headers := collectSnapshotMap(s.properties.Header_libs, snapshotSuffix, snapshotHeaderSuffix)
183 binaries := collectSnapshotMap(s.properties.Binaries, snapshotSuffix, snapshotBinarySuffix)
184 objects := collectSnapshotMap(s.properties.Objects, snapshotSuffix, snapshotObjectSuffix)
Ivan Lozanod1dec542021-05-26 15:33:11 -0400185 staticLibs := collectSnapshotMap(s.properties.Static_libs, snapshotSuffix, SnapshotStaticSuffix)
186 sharedLibs := collectSnapshotMap(s.properties.Shared_libs, snapshotSuffix, SnapshotSharedSuffix)
Ivan Lozano3149e6e2021-06-01 15:09:53 -0400187 rlibs := collectSnapshotMap(s.properties.Rlibs, snapshotSuffix, SnapshotRlibSuffix)
Justin Yun07b9f862021-02-26 14:00:03 +0900188 vndkLibs := collectSnapshotMap(s.properties.Vndk_libs, "", vndkSuffix)
Colin Crosse0edaf92021-01-11 17:31:17 -0800189 for k, v := range vndkLibs {
190 sharedLibs[k] = v
191 }
Justin Yun07b9f862021-02-26 14:00:03 +0900192
Colin Crosse0edaf92021-01-11 17:31:17 -0800193 ctx.SetProvider(SnapshotInfoProvider, SnapshotInfo{
194 HeaderLibs: headers,
195 Binaries: binaries,
196 Objects: objects,
197 StaticLibs: staticLibs,
198 SharedLibs: sharedLibs,
Ivan Lozano3149e6e2021-06-01 15:09:53 -0400199 Rlibs: rlibs,
Colin Crosse0edaf92021-01-11 17:31:17 -0800200 })
201}
202
203type SnapshotInfo struct {
Ivan Lozano3149e6e2021-06-01 15:09:53 -0400204 HeaderLibs, Binaries, Objects, StaticLibs, SharedLibs, Rlibs map[string]string
Colin Crosse0edaf92021-01-11 17:31:17 -0800205}
206
207var SnapshotInfoProvider = blueprint.NewMutatorProvider(SnapshotInfo{}, "deps")
208
Kiyoung Kim48f37782021-07-07 12:42:39 +0900209var _ android.ImageInterface = (*snapshotModule)(nil)
Colin Crosse0edaf92021-01-11 17:31:17 -0800210
Justin Yund9e05752021-07-13 11:36:24 +0900211func snapshotMakeVarsProvider(ctx android.MakeVarsContext) {
212 snapshotSet := map[string]struct{}{}
213 ctx.VisitAllModules(func(m android.Module) {
Kiyoung Kim48f37782021-07-07 12:42:39 +0900214 if s, ok := m.(*snapshotModule); ok {
Justin Yund9e05752021-07-13 11:36:24 +0900215 if _, ok := snapshotSet[s.Name()]; ok {
216 // arch variant generates duplicated modules
217 // skip this as we only need to know the path of the module.
218 return
219 }
220 snapshotSet[s.Name()] = struct{}{}
221 imageNameVersion := strings.Split(s.image.imageVariantName(ctx.DeviceConfig()), ".")
222 ctx.Strict(
223 strings.Join([]string{strings.ToUpper(imageNameVersion[0]), s.baseSnapshot.Version(), "SNAPSHOT_DIR"}, "_"),
224 ctx.ModuleDir(s))
225 }
226 })
227}
228
Colin Crosse0edaf92021-01-11 17:31:17 -0800229func vendorSnapshotFactory() android.Module {
Ivan Lozanod67a6b02021-05-20 13:01:32 -0400230 return snapshotFactory(VendorSnapshotImageSingleton)
Colin Crosse0edaf92021-01-11 17:31:17 -0800231}
232
233func recoverySnapshotFactory() android.Module {
234 return snapshotFactory(recoverySnapshotImageSingleton)
235}
236
Ivan Lozanod1dec542021-05-26 15:33:11 -0400237func snapshotFactory(image SnapshotImage) android.Module {
Kiyoung Kim48f37782021-07-07 12:42:39 +0900238 snapshotModule := &snapshotModule{}
239 snapshotModule.image = image
240 snapshotModule.AddProperties(
241 &snapshotModule.properties,
242 &snapshotModule.baseSnapshot.baseProperties)
243 android.InitAndroidArchModule(snapshotModule, android.DeviceSupported, android.MultilibBoth)
244 return snapshotModule
Colin Crosse0edaf92021-01-11 17:31:17 -0800245}
246
Ivan Lozanod1dec542021-05-26 15:33:11 -0400247type BaseSnapshotDecoratorProperties struct {
Inseob Kimde5744a2020-12-02 13:14:28 +0900248 // snapshot version.
249 Version string
250
251 // Target arch name of the snapshot (e.g. 'arm64' for variant 'aosp_arm64')
252 Target_arch string
Jose Galmes6f843bc2020-12-11 13:36:29 -0800253
Colin Crossa8890802021-01-22 14:06:33 -0800254 // Suffix to be added to the module name when exporting to Android.mk, e.g. ".vendor".
Inseob Kim1b6fb872021-04-05 13:37:02 +0900255 Androidmk_suffix string `blueprint:"mutated"`
Colin Crossa8890802021-01-22 14:06:33 -0800256
Jose Galmes6f843bc2020-12-11 13:36:29 -0800257 // Suffix to be added to the module name, e.g., vendor_shared,
258 // recovery_shared, etc.
Colin Crosse0edaf92021-01-11 17:31:17 -0800259 ModuleSuffix string `blueprint:"mutated"`
Inseob Kimde5744a2020-12-02 13:14:28 +0900260}
261
Ivan Lozanod1dec542021-05-26 15:33:11 -0400262// BaseSnapshotDecorator provides common basic functions for all snapshot modules, such as snapshot
Inseob Kimde5744a2020-12-02 13:14:28 +0900263// version, snapshot arch, etc. It also adds a special suffix to Soong module name, so it doesn't
264// collide with source modules. e.g. the following example module,
265//
266// vendor_snapshot_static {
267// name: "libbase",
268// arch: "arm64",
269// version: 30,
270// ...
271// }
272//
273// will be seen as "libbase.vendor_static.30.arm64" by Soong.
Ivan Lozanod1dec542021-05-26 15:33:11 -0400274type BaseSnapshotDecorator struct {
275 baseProperties BaseSnapshotDecoratorProperties
Kiyoung Kim48f37782021-07-07 12:42:39 +0900276 Image SnapshotImage
Inseob Kimde5744a2020-12-02 13:14:28 +0900277}
278
Ivan Lozanod1dec542021-05-26 15:33:11 -0400279func (p *BaseSnapshotDecorator) Name(name string) string {
Inseob Kimde5744a2020-12-02 13:14:28 +0900280 return name + p.NameSuffix()
281}
282
Ivan Lozanod1dec542021-05-26 15:33:11 -0400283func (p *BaseSnapshotDecorator) NameSuffix() string {
284 return getSnapshotNameSuffix(p.moduleSuffix(), p.Version(), p.Arch())
Inseob Kimde5744a2020-12-02 13:14:28 +0900285}
286
Ivan Lozanod1dec542021-05-26 15:33:11 -0400287func (p *BaseSnapshotDecorator) Version() string {
Inseob Kimde5744a2020-12-02 13:14:28 +0900288 return p.baseProperties.Version
289}
290
Ivan Lozanod1dec542021-05-26 15:33:11 -0400291func (p *BaseSnapshotDecorator) Arch() string {
Inseob Kimde5744a2020-12-02 13:14:28 +0900292 return p.baseProperties.Target_arch
293}
294
Ivan Lozanod1dec542021-05-26 15:33:11 -0400295func (p *BaseSnapshotDecorator) moduleSuffix() string {
Colin Crosse0edaf92021-01-11 17:31:17 -0800296 return p.baseProperties.ModuleSuffix
Jose Galmes6f843bc2020-12-11 13:36:29 -0800297}
298
Ivan Lozanod1dec542021-05-26 15:33:11 -0400299func (p *BaseSnapshotDecorator) IsSnapshotPrebuilt() bool {
Inseob Kimde5744a2020-12-02 13:14:28 +0900300 return true
301}
302
Ivan Lozanod1dec542021-05-26 15:33:11 -0400303func (p *BaseSnapshotDecorator) SnapshotAndroidMkSuffix() string {
Colin Crossa8890802021-01-22 14:06:33 -0800304 return p.baseProperties.Androidmk_suffix
305}
306
Ivan Lozanod1dec542021-05-26 15:33:11 -0400307func (p *BaseSnapshotDecorator) SetSnapshotAndroidMkSuffix(ctx android.ModuleContext, variant string) {
Jose Galmes7fdc3362021-05-26 21:16:52 -0700308 // If there are any 2 or more variations among {core, product, vendor, recovery}
309 // we have to add the androidmk suffix to avoid duplicate modules with the same
310 // name.
311 variations := append(ctx.Target().Variations(), blueprint.Variation{
Bill Peckham4016d7b2021-05-20 11:54:21 -0700312 Mutator: "image",
313 Variation: android.CoreVariation})
314
Ivan Lozanod1dec542021-05-26 15:33:11 -0400315 if ctx.OtherModuleFarDependencyVariantExists(variations, ctx.Module().(LinkableInterface).BaseModuleName()) {
Kiyoung Kim48f37782021-07-07 12:42:39 +0900316 p.baseProperties.Androidmk_suffix = p.Image.moduleNameSuffix()
Bill Peckham4016d7b2021-05-20 11:54:21 -0700317 return
Inseob Kim1b6fb872021-04-05 13:37:02 +0900318 }
Bill Peckham4016d7b2021-05-20 11:54:21 -0700319
Jose Galmes7fdc3362021-05-26 21:16:52 -0700320 variations = append(ctx.Target().Variations(), blueprint.Variation{
Bill Peckham4016d7b2021-05-20 11:54:21 -0700321 Mutator: "image",
322 Variation: ProductVariationPrefix + ctx.DeviceConfig().PlatformVndkVersion()})
323
Ivan Lozanod1dec542021-05-26 15:33:11 -0400324 if ctx.OtherModuleFarDependencyVariantExists(variations, ctx.Module().(LinkableInterface).BaseModuleName()) {
Kiyoung Kim48f37782021-07-07 12:42:39 +0900325 p.baseProperties.Androidmk_suffix = p.Image.moduleNameSuffix()
Bill Peckham4016d7b2021-05-20 11:54:21 -0700326 return
327 }
328
Ivan Lozanod1dec542021-05-26 15:33:11 -0400329 images := []SnapshotImage{VendorSnapshotImageSingleton, recoverySnapshotImageSingleton}
Jose Galmes7fdc3362021-05-26 21:16:52 -0700330
331 for _, image := range images {
Kiyoung Kim48f37782021-07-07 12:42:39 +0900332 if p.Image == image {
Jose Galmes7fdc3362021-05-26 21:16:52 -0700333 continue
334 }
335 variations = append(ctx.Target().Variations(), blueprint.Variation{
336 Mutator: "image",
337 Variation: image.imageVariantName(ctx.DeviceConfig())})
338
339 if ctx.OtherModuleFarDependencyVariantExists(variations,
Ivan Lozanod1dec542021-05-26 15:33:11 -0400340 ctx.Module().(LinkableInterface).BaseModuleName()+
Jose Galmes7fdc3362021-05-26 21:16:52 -0700341 getSnapshotNameSuffix(
342 image.moduleNameSuffix()+variant,
Ivan Lozanod1dec542021-05-26 15:33:11 -0400343 p.Version(),
Jose Galmes7fdc3362021-05-26 21:16:52 -0700344 ctx.DeviceConfig().Arches()[0].ArchType.String())) {
Kiyoung Kim48f37782021-07-07 12:42:39 +0900345 p.baseProperties.Androidmk_suffix = p.Image.moduleNameSuffix()
Jose Galmes7fdc3362021-05-26 21:16:52 -0700346 return
347 }
348 }
349
Bill Peckham4016d7b2021-05-20 11:54:21 -0700350 p.baseProperties.Androidmk_suffix = ""
Inseob Kim1b6fb872021-04-05 13:37:02 +0900351}
352
Inseob Kimde5744a2020-12-02 13:14:28 +0900353// Call this with a module suffix after creating a snapshot module, such as
354// vendorSnapshotSharedSuffix, recoverySnapshotBinarySuffix, etc.
Ivan Lozanod1dec542021-05-26 15:33:11 -0400355func (p *BaseSnapshotDecorator) Init(m LinkableInterface, image SnapshotImage, moduleSuffix string) {
Kiyoung Kim48f37782021-07-07 12:42:39 +0900356 p.Image = image
Inseob Kim1b6fb872021-04-05 13:37:02 +0900357 p.baseProperties.ModuleSuffix = image.moduleNameSuffix() + moduleSuffix
Inseob Kimde5744a2020-12-02 13:14:28 +0900358 m.AddProperties(&p.baseProperties)
359 android.AddLoadHook(m, func(ctx android.LoadHookContext) {
360 vendorSnapshotLoadHook(ctx, p)
361 })
362}
363
364// vendorSnapshotLoadHook disables snapshots if it's not BOARD_VNDK_VERSION.
365// As vendor snapshot is only for vendor, such modules won't be used at all.
Ivan Lozanod1dec542021-05-26 15:33:11 -0400366func vendorSnapshotLoadHook(ctx android.LoadHookContext, p *BaseSnapshotDecorator) {
367 if p.Version() != ctx.DeviceConfig().VndkVersion() {
Inseob Kimde5744a2020-12-02 13:14:28 +0900368 ctx.Module().Disable()
369 return
370 }
371}
372
373//
374// Module definitions for snapshots of libraries (shared, static, header).
375//
376// Modules (vendor|recovery)_snapshot_(shared|static|header) are defined here. Shared libraries and
377// static libraries have their prebuilt library files (.so for shared, .a for static) as their src,
378// which can be installed or linked against. Also they export flags needed when linked, such as
379// include directories, c flags, sanitize dependency information, etc.
380//
381// These modules are auto-generated by development/vendor_snapshot/update.py.
Ivan Lozanod1dec542021-05-26 15:33:11 -0400382type SnapshotLibraryProperties struct {
Inseob Kimde5744a2020-12-02 13:14:28 +0900383 // Prebuilt file for each arch.
384 Src *string `android:"arch_variant"`
385
386 // list of directories that will be added to the include path (using -I).
387 Export_include_dirs []string `android:"arch_variant"`
388
389 // list of directories that will be added to the system path (using -isystem).
390 Export_system_include_dirs []string `android:"arch_variant"`
391
392 // list of flags that will be used for any module that links against this module.
393 Export_flags []string `android:"arch_variant"`
394
395 // Whether this prebuilt needs to depend on sanitize ubsan runtime or not.
396 Sanitize_ubsan_dep *bool `android:"arch_variant"`
397
398 // Whether this prebuilt needs to depend on sanitize minimal runtime or not.
399 Sanitize_minimal_dep *bool `android:"arch_variant"`
400}
401
402type snapshotSanitizer interface {
Ivan Lozano3968d8f2020-12-14 11:27:52 -0500403 isSanitizerEnabled(t SanitizerType) bool
404 setSanitizerVariation(t SanitizerType, enabled bool)
Inseob Kimde5744a2020-12-02 13:14:28 +0900405}
406
407type snapshotLibraryDecorator struct {
Ivan Lozanod1dec542021-05-26 15:33:11 -0400408 BaseSnapshotDecorator
Inseob Kimde5744a2020-12-02 13:14:28 +0900409 *libraryDecorator
Ivan Lozanod1dec542021-05-26 15:33:11 -0400410 properties SnapshotLibraryProperties
Inseob Kimde5744a2020-12-02 13:14:28 +0900411 sanitizerProperties struct {
412 CfiEnabled bool `blueprint:"mutated"`
413
414 // Library flags for cfi variant.
Ivan Lozanod1dec542021-05-26 15:33:11 -0400415 Cfi SnapshotLibraryProperties `android:"arch_variant"`
Inseob Kimde5744a2020-12-02 13:14:28 +0900416 }
Inseob Kimde5744a2020-12-02 13:14:28 +0900417}
418
419func (p *snapshotLibraryDecorator) linkerFlags(ctx ModuleContext, flags Flags) Flags {
420 p.libraryDecorator.libName = strings.TrimSuffix(ctx.ModuleName(), p.NameSuffix())
421 return p.libraryDecorator.linkerFlags(ctx, flags)
422}
423
Ivan Lozanod1dec542021-05-26 15:33:11 -0400424func (p *snapshotLibraryDecorator) MatchesWithDevice(config android.DeviceConfig) bool {
Inseob Kimde5744a2020-12-02 13:14:28 +0900425 arches := config.Arches()
Ivan Lozanod1dec542021-05-26 15:33:11 -0400426 if len(arches) == 0 || arches[0].ArchType.String() != p.Arch() {
Inseob Kimde5744a2020-12-02 13:14:28 +0900427 return false
428 }
429 if !p.header() && p.properties.Src == nil {
430 return false
431 }
432 return true
433}
434
435// cc modules' link functions are to link compiled objects into final binaries.
436// As snapshots are prebuilts, this just returns the prebuilt binary after doing things which are
437// done by normal library decorator, e.g. exporting flags.
438func (p *snapshotLibraryDecorator) link(ctx ModuleContext, flags Flags, deps PathDeps, objs Objects) android.Path {
Jose Galmes7fdc3362021-05-26 21:16:52 -0700439 var variant string
440 if p.shared() {
Ivan Lozanod1dec542021-05-26 15:33:11 -0400441 variant = SnapshotSharedSuffix
Jose Galmes7fdc3362021-05-26 21:16:52 -0700442 } else if p.static() {
Ivan Lozanod1dec542021-05-26 15:33:11 -0400443 variant = SnapshotStaticSuffix
Jose Galmes7fdc3362021-05-26 21:16:52 -0700444 } else {
445 variant = snapshotHeaderSuffix
446 }
447
Ivan Lozanod1dec542021-05-26 15:33:11 -0400448 p.SetSnapshotAndroidMkSuffix(ctx, variant)
Inseob Kim1b6fb872021-04-05 13:37:02 +0900449
Inseob Kimde5744a2020-12-02 13:14:28 +0900450 if p.header() {
451 return p.libraryDecorator.link(ctx, flags, deps, objs)
452 }
453
454 if p.sanitizerProperties.CfiEnabled {
455 p.properties = p.sanitizerProperties.Cfi
456 }
457
Ivan Lozanod1dec542021-05-26 15:33:11 -0400458 if !p.MatchesWithDevice(ctx.DeviceConfig()) {
Inseob Kimde5744a2020-12-02 13:14:28 +0900459 return nil
460 }
461
Inseob Kimdd0295d2021-04-12 21:09:59 +0900462 // Flags specified directly to this module.
Inseob Kimde5744a2020-12-02 13:14:28 +0900463 p.libraryDecorator.reexportDirs(android.PathsForModuleSrc(ctx, p.properties.Export_include_dirs)...)
464 p.libraryDecorator.reexportSystemDirs(android.PathsForModuleSrc(ctx, p.properties.Export_system_include_dirs)...)
465 p.libraryDecorator.reexportFlags(p.properties.Export_flags...)
466
Inseob Kimdd0295d2021-04-12 21:09:59 +0900467 // Flags reexported from dependencies. (e.g. vndk_prebuilt_shared)
468 p.libraryDecorator.reexportDirs(deps.ReexportedDirs...)
469 p.libraryDecorator.reexportSystemDirs(deps.ReexportedSystemDirs...)
470 p.libraryDecorator.reexportFlags(deps.ReexportedFlags...)
471 p.libraryDecorator.reexportDeps(deps.ReexportedDeps...)
472 p.libraryDecorator.addExportedGeneratedHeaders(deps.ReexportedGeneratedHeaders...)
473
Inseob Kimde5744a2020-12-02 13:14:28 +0900474 in := android.PathForModuleSrc(ctx, *p.properties.Src)
475 p.unstrippedOutputFile = in
476
477 if p.shared() {
478 libName := in.Base()
479 builderFlags := flagsToBuilderFlags(flags)
480
481 // Optimize out relinking against shared libraries whose interface hasn't changed by
482 // depending on a table of contents file instead of the library itself.
483 tocFile := android.PathForModuleOut(ctx, libName+".toc")
484 p.tocFile = android.OptionalPathForPath(tocFile)
485 transformSharedObjectToToc(ctx, in, tocFile, builderFlags)
486
487 ctx.SetProvider(SharedLibraryInfoProvider, SharedLibraryInfo{
Liz Kammeref6dfea2021-06-08 15:37:09 -0400488 SharedLibrary: in,
489 Target: ctx.Target(),
Inseob Kimde5744a2020-12-02 13:14:28 +0900490
491 TableOfContents: p.tocFile,
492 })
493 }
494
495 if p.static() {
496 depSet := android.NewDepSetBuilder(android.TOPOLOGICAL).Direct(in).Build()
497 ctx.SetProvider(StaticLibraryInfoProvider, StaticLibraryInfo{
498 StaticLibrary: in,
499
500 TransitiveStaticLibrariesForOrdering: depSet,
501 })
502 }
503
504 p.libraryDecorator.flagExporter.setProvider(ctx)
505
506 return in
507}
508
509func (p *snapshotLibraryDecorator) install(ctx ModuleContext, file android.Path) {
Ivan Lozanod1dec542021-05-26 15:33:11 -0400510 if p.MatchesWithDevice(ctx.DeviceConfig()) && (p.shared() || p.static()) {
Inseob Kimde5744a2020-12-02 13:14:28 +0900511 p.baseInstaller.install(ctx, file)
512 }
513}
514
515func (p *snapshotLibraryDecorator) nativeCoverage() bool {
516 return false
517}
518
Ivan Lozano3968d8f2020-12-14 11:27:52 -0500519func (p *snapshotLibraryDecorator) isSanitizerEnabled(t SanitizerType) bool {
Inseob Kimde5744a2020-12-02 13:14:28 +0900520 switch t {
521 case cfi:
522 return p.sanitizerProperties.Cfi.Src != nil
523 default:
524 return false
525 }
526}
527
Ivan Lozano3968d8f2020-12-14 11:27:52 -0500528func (p *snapshotLibraryDecorator) setSanitizerVariation(t SanitizerType, enabled bool) {
Inseob Kimde5744a2020-12-02 13:14:28 +0900529 if !enabled {
530 return
531 }
532 switch t {
533 case cfi:
534 p.sanitizerProperties.CfiEnabled = true
535 default:
536 return
537 }
538}
539
Ivan Lozanod1dec542021-05-26 15:33:11 -0400540func snapshotLibraryFactory(image SnapshotImage, moduleSuffix string) (*Module, *snapshotLibraryDecorator) {
Inseob Kimde5744a2020-12-02 13:14:28 +0900541 module, library := NewLibrary(android.DeviceSupported)
542
543 module.stl = nil
544 module.sanitize = nil
545 library.disableStripping()
546
547 prebuilt := &snapshotLibraryDecorator{
548 libraryDecorator: library,
549 }
550
551 prebuilt.baseLinker.Properties.No_libcrt = BoolPtr(true)
552 prebuilt.baseLinker.Properties.Nocrt = BoolPtr(true)
553
554 // Prevent default system libs (libc, libm, and libdl) from being linked
555 if prebuilt.baseLinker.Properties.System_shared_libs == nil {
556 prebuilt.baseLinker.Properties.System_shared_libs = []string{}
557 }
558
559 module.compiler = nil
560 module.linker = prebuilt
561 module.installer = prebuilt
562
Ivan Lozanod1dec542021-05-26 15:33:11 -0400563 prebuilt.Init(module, image, moduleSuffix)
Inseob Kimde5744a2020-12-02 13:14:28 +0900564 module.AddProperties(
565 &prebuilt.properties,
566 &prebuilt.sanitizerProperties,
567 )
568
569 return module, prebuilt
570}
571
572// vendor_snapshot_shared is a special prebuilt shared library which is auto-generated by
573// development/vendor_snapshot/update.py. As a part of vendor snapshot, vendor_snapshot_shared
574// overrides the vendor variant of the cc shared library with the same name, if BOARD_VNDK_VERSION
575// is set.
576func VendorSnapshotSharedFactory() android.Module {
Ivan Lozanod1dec542021-05-26 15:33:11 -0400577 module, prebuilt := snapshotLibraryFactory(VendorSnapshotImageSingleton, SnapshotSharedSuffix)
Inseob Kimde5744a2020-12-02 13:14:28 +0900578 prebuilt.libraryDecorator.BuildOnlyShared()
579 return module.Init()
580}
581
582// recovery_snapshot_shared is a special prebuilt shared library which is auto-generated by
583// development/vendor_snapshot/update.py. As a part of recovery snapshot, recovery_snapshot_shared
584// overrides the recovery variant of the cc shared library with the same name, if BOARD_VNDK_VERSION
585// is set.
586func RecoverySnapshotSharedFactory() android.Module {
Ivan Lozanod1dec542021-05-26 15:33:11 -0400587 module, prebuilt := snapshotLibraryFactory(recoverySnapshotImageSingleton, SnapshotSharedSuffix)
Inseob Kimde5744a2020-12-02 13:14:28 +0900588 prebuilt.libraryDecorator.BuildOnlyShared()
589 return module.Init()
590}
591
592// vendor_snapshot_static is a special prebuilt static library which is auto-generated by
593// development/vendor_snapshot/update.py. As a part of vendor snapshot, vendor_snapshot_static
594// overrides the vendor variant of the cc static library with the same name, if BOARD_VNDK_VERSION
595// is set.
596func VendorSnapshotStaticFactory() android.Module {
Ivan Lozanod1dec542021-05-26 15:33:11 -0400597 module, prebuilt := snapshotLibraryFactory(VendorSnapshotImageSingleton, SnapshotStaticSuffix)
Inseob Kimde5744a2020-12-02 13:14:28 +0900598 prebuilt.libraryDecorator.BuildOnlyStatic()
599 return module.Init()
600}
601
602// recovery_snapshot_static is a special prebuilt static library which is auto-generated by
603// development/vendor_snapshot/update.py. As a part of recovery snapshot, recovery_snapshot_static
604// overrides the recovery variant of the cc static library with the same name, if BOARD_VNDK_VERSION
605// is set.
606func RecoverySnapshotStaticFactory() android.Module {
Ivan Lozanod1dec542021-05-26 15:33:11 -0400607 module, prebuilt := snapshotLibraryFactory(recoverySnapshotImageSingleton, SnapshotStaticSuffix)
Inseob Kimde5744a2020-12-02 13:14:28 +0900608 prebuilt.libraryDecorator.BuildOnlyStatic()
609 return module.Init()
610}
611
612// vendor_snapshot_header is a special header library which is auto-generated by
613// development/vendor_snapshot/update.py. As a part of vendor snapshot, vendor_snapshot_header
614// overrides the vendor variant of the cc header library with the same name, if BOARD_VNDK_VERSION
615// is set.
616func VendorSnapshotHeaderFactory() android.Module {
Ivan Lozanod67a6b02021-05-20 13:01:32 -0400617 module, prebuilt := snapshotLibraryFactory(VendorSnapshotImageSingleton, snapshotHeaderSuffix)
Inseob Kimde5744a2020-12-02 13:14:28 +0900618 prebuilt.libraryDecorator.HeaderOnly()
619 return module.Init()
620}
621
622// recovery_snapshot_header is a special header library which is auto-generated by
623// development/vendor_snapshot/update.py. As a part of recovery snapshot, recovery_snapshot_header
624// overrides the recovery variant of the cc header library with the same name, if BOARD_VNDK_VERSION
625// is set.
626func RecoverySnapshotHeaderFactory() android.Module {
Inseob Kim1b6fb872021-04-05 13:37:02 +0900627 module, prebuilt := snapshotLibraryFactory(recoverySnapshotImageSingleton, snapshotHeaderSuffix)
Inseob Kimde5744a2020-12-02 13:14:28 +0900628 prebuilt.libraryDecorator.HeaderOnly()
629 return module.Init()
630}
631
632var _ snapshotSanitizer = (*snapshotLibraryDecorator)(nil)
633
634//
635// Module definitions for snapshots of executable binaries.
636//
637// Modules (vendor|recovery)_snapshot_binary are defined here. They have their prebuilt executable
638// binaries (e.g. toybox, sh) as their src, which can be installed.
639//
640// These modules are auto-generated by development/vendor_snapshot/update.py.
641type snapshotBinaryProperties struct {
642 // Prebuilt file for each arch.
643 Src *string `android:"arch_variant"`
644}
645
646type snapshotBinaryDecorator struct {
Ivan Lozanod1dec542021-05-26 15:33:11 -0400647 BaseSnapshotDecorator
Inseob Kimde5744a2020-12-02 13:14:28 +0900648 *binaryDecorator
Colin Crossa8890802021-01-22 14:06:33 -0800649 properties snapshotBinaryProperties
Inseob Kimde5744a2020-12-02 13:14:28 +0900650}
651
Ivan Lozanod1dec542021-05-26 15:33:11 -0400652func (p *snapshotBinaryDecorator) MatchesWithDevice(config android.DeviceConfig) bool {
653 if config.DeviceArch() != p.Arch() {
Inseob Kimde5744a2020-12-02 13:14:28 +0900654 return false
655 }
656 if p.properties.Src == nil {
657 return false
658 }
659 return true
660}
661
662// cc modules' link functions are to link compiled objects into final binaries.
663// As snapshots are prebuilts, this just returns the prebuilt binary
664func (p *snapshotBinaryDecorator) link(ctx ModuleContext, flags Flags, deps PathDeps, objs Objects) android.Path {
Ivan Lozanod1dec542021-05-26 15:33:11 -0400665 p.SetSnapshotAndroidMkSuffix(ctx, snapshotBinarySuffix)
Inseob Kim1b6fb872021-04-05 13:37:02 +0900666
Ivan Lozanod1dec542021-05-26 15:33:11 -0400667 if !p.MatchesWithDevice(ctx.DeviceConfig()) {
Inseob Kimde5744a2020-12-02 13:14:28 +0900668 return nil
669 }
670
671 in := android.PathForModuleSrc(ctx, *p.properties.Src)
672 p.unstrippedOutputFile = in
673 binName := in.Base()
674
Inseob Kimde5744a2020-12-02 13:14:28 +0900675 // use cpExecutable to make it executable
676 outputFile := android.PathForModuleOut(ctx, binName)
677 ctx.Build(pctx, android.BuildParams{
678 Rule: android.CpExecutable,
679 Description: "prebuilt",
680 Output: outputFile,
681 Input: in,
682 })
683
684 return outputFile
685}
686
687func (p *snapshotBinaryDecorator) nativeCoverage() bool {
688 return false
689}
690
691// vendor_snapshot_binary is a special prebuilt executable binary which is auto-generated by
692// development/vendor_snapshot/update.py. As a part of vendor snapshot, vendor_snapshot_binary
693// overrides the vendor variant of the cc binary with the same name, if BOARD_VNDK_VERSION is set.
694func VendorSnapshotBinaryFactory() android.Module {
Ivan Lozanod67a6b02021-05-20 13:01:32 -0400695 return snapshotBinaryFactory(VendorSnapshotImageSingleton, snapshotBinarySuffix)
Inseob Kimde5744a2020-12-02 13:14:28 +0900696}
697
698// recovery_snapshot_binary is a special prebuilt executable binary which is auto-generated by
699// development/vendor_snapshot/update.py. As a part of recovery snapshot, recovery_snapshot_binary
700// overrides the recovery variant of the cc binary with the same name, if BOARD_VNDK_VERSION is set.
701func RecoverySnapshotBinaryFactory() android.Module {
Inseob Kim1b6fb872021-04-05 13:37:02 +0900702 return snapshotBinaryFactory(recoverySnapshotImageSingleton, snapshotBinarySuffix)
Inseob Kimde5744a2020-12-02 13:14:28 +0900703}
704
Ivan Lozanod1dec542021-05-26 15:33:11 -0400705func snapshotBinaryFactory(image SnapshotImage, moduleSuffix string) android.Module {
Inseob Kimde5744a2020-12-02 13:14:28 +0900706 module, binary := NewBinary(android.DeviceSupported)
707 binary.baseLinker.Properties.No_libcrt = BoolPtr(true)
708 binary.baseLinker.Properties.Nocrt = BoolPtr(true)
709
710 // Prevent default system libs (libc, libm, and libdl) from being linked
711 if binary.baseLinker.Properties.System_shared_libs == nil {
712 binary.baseLinker.Properties.System_shared_libs = []string{}
713 }
714
715 prebuilt := &snapshotBinaryDecorator{
716 binaryDecorator: binary,
717 }
718
719 module.compiler = nil
720 module.sanitize = nil
721 module.stl = nil
722 module.linker = prebuilt
723
Ivan Lozanod1dec542021-05-26 15:33:11 -0400724 prebuilt.Init(module, image, moduleSuffix)
Inseob Kimde5744a2020-12-02 13:14:28 +0900725 module.AddProperties(&prebuilt.properties)
726 return module.Init()
727}
728
729//
730// Module definitions for snapshots of object files (*.o).
731//
732// Modules (vendor|recovery)_snapshot_object are defined here. They have their prebuilt object
733// files (*.o) as their src.
734//
735// These modules are auto-generated by development/vendor_snapshot/update.py.
736type vendorSnapshotObjectProperties struct {
737 // Prebuilt file for each arch.
738 Src *string `android:"arch_variant"`
739}
740
741type snapshotObjectLinker struct {
Ivan Lozanod1dec542021-05-26 15:33:11 -0400742 BaseSnapshotDecorator
Inseob Kimde5744a2020-12-02 13:14:28 +0900743 objectLinker
Colin Crossa8890802021-01-22 14:06:33 -0800744 properties vendorSnapshotObjectProperties
Inseob Kimde5744a2020-12-02 13:14:28 +0900745}
746
Ivan Lozanod1dec542021-05-26 15:33:11 -0400747func (p *snapshotObjectLinker) MatchesWithDevice(config android.DeviceConfig) bool {
748 if config.DeviceArch() != p.Arch() {
Inseob Kimde5744a2020-12-02 13:14:28 +0900749 return false
750 }
751 if p.properties.Src == nil {
752 return false
753 }
754 return true
755}
756
757// cc modules' link functions are to link compiled objects into final binaries.
758// As snapshots are prebuilts, this just returns the prebuilt binary
759func (p *snapshotObjectLinker) link(ctx ModuleContext, flags Flags, deps PathDeps, objs Objects) android.Path {
Ivan Lozanod1dec542021-05-26 15:33:11 -0400760 p.SetSnapshotAndroidMkSuffix(ctx, snapshotObjectSuffix)
Inseob Kim1b6fb872021-04-05 13:37:02 +0900761
Ivan Lozanod1dec542021-05-26 15:33:11 -0400762 if !p.MatchesWithDevice(ctx.DeviceConfig()) {
Inseob Kimde5744a2020-12-02 13:14:28 +0900763 return nil
764 }
765
Inseob Kimde5744a2020-12-02 13:14:28 +0900766 return android.PathForModuleSrc(ctx, *p.properties.Src)
767}
768
769func (p *snapshotObjectLinker) nativeCoverage() bool {
770 return false
771}
772
773// vendor_snapshot_object is a special prebuilt compiled object file which is auto-generated by
774// development/vendor_snapshot/update.py. As a part of vendor snapshot, vendor_snapshot_object
775// overrides the vendor variant of the cc object with the same name, if BOARD_VNDK_VERSION is set.
776func VendorSnapshotObjectFactory() android.Module {
Colin Cross7cabd422021-06-25 14:21:04 -0700777 module := newObject(android.DeviceSupported)
Inseob Kimde5744a2020-12-02 13:14:28 +0900778
779 prebuilt := &snapshotObjectLinker{
780 objectLinker: objectLinker{
781 baseLinker: NewBaseLinker(nil),
782 },
783 }
784 module.linker = prebuilt
785
Ivan Lozanod1dec542021-05-26 15:33:11 -0400786 prebuilt.Init(module, VendorSnapshotImageSingleton, snapshotObjectSuffix)
Inseob Kimde5744a2020-12-02 13:14:28 +0900787 module.AddProperties(&prebuilt.properties)
788 return module.Init()
789}
790
791// recovery_snapshot_object is a special prebuilt compiled object file which is auto-generated by
792// development/vendor_snapshot/update.py. As a part of recovery snapshot, recovery_snapshot_object
793// overrides the recovery variant of the cc object with the same name, if BOARD_VNDK_VERSION is set.
794func RecoverySnapshotObjectFactory() android.Module {
Colin Cross7cabd422021-06-25 14:21:04 -0700795 module := newObject(android.DeviceSupported)
Inseob Kimde5744a2020-12-02 13:14:28 +0900796
797 prebuilt := &snapshotObjectLinker{
798 objectLinker: objectLinker{
799 baseLinker: NewBaseLinker(nil),
800 },
801 }
802 module.linker = prebuilt
803
Ivan Lozanod1dec542021-05-26 15:33:11 -0400804 prebuilt.Init(module, recoverySnapshotImageSingleton, snapshotObjectSuffix)
Inseob Kimde5744a2020-12-02 13:14:28 +0900805 module.AddProperties(&prebuilt.properties)
806 return module.Init()
807}
808
Ivan Lozanod1dec542021-05-26 15:33:11 -0400809type SnapshotInterface interface {
810 MatchesWithDevice(config android.DeviceConfig) bool
811 IsSnapshotPrebuilt() bool
812 Version() string
813 SnapshotAndroidMkSuffix() string
Inseob Kimde5744a2020-12-02 13:14:28 +0900814}
815
Ivan Lozanod1dec542021-05-26 15:33:11 -0400816var _ SnapshotInterface = (*vndkPrebuiltLibraryDecorator)(nil)
817var _ SnapshotInterface = (*snapshotLibraryDecorator)(nil)
818var _ SnapshotInterface = (*snapshotBinaryDecorator)(nil)
819var _ SnapshotInterface = (*snapshotObjectLinker)(nil)