Justin Yun | 8effde4 | 2017-06-23 19:24:43 +0900 | [diff] [blame] | 1 | // Copyright 2017 Google Inc. All rights reserved. |
| 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. |
| 14 | |
| 15 | package cc |
| 16 | |
| 17 | import ( |
Inseob Kim | ae55303 | 2019-05-14 18:52:49 +0900 | [diff] [blame] | 18 | "encoding/json" |
Martin Stjernholm | 257eb0c | 2018-10-15 13:05:27 +0100 | [diff] [blame] | 19 | "errors" |
Jooyung Han | 0302a84 | 2019-10-30 18:43:49 +0900 | [diff] [blame] | 20 | "fmt" |
Inseob Kim | 1f086e2 | 2019-05-09 13:29:15 +0900 | [diff] [blame] | 21 | "path/filepath" |
Inseob Kim | 242ef0c | 2019-10-22 20:15:20 +0900 | [diff] [blame] | 22 | "sort" |
Jiyong Park | d5b18a5 | 2017-08-03 21:22:50 +0900 | [diff] [blame] | 23 | "strings" |
| 24 | "sync" |
| 25 | |
Justin Yun | 8effde4 | 2017-06-23 19:24:43 +0900 | [diff] [blame] | 26 | "android/soong/android" |
Vic Yang | efd249e | 2018-11-12 20:19:56 -0800 | [diff] [blame] | 27 | "android/soong/cc/config" |
Jaewoong Jung | 4b79e98 | 2020-06-01 10:45:49 -0700 | [diff] [blame] | 28 | "android/soong/etc" |
Colin Cross | 6e511a9 | 2020-07-27 21:26:48 -0700 | [diff] [blame] | 29 | |
| 30 | "github.com/google/blueprint" |
Justin Yun | 8effde4 | 2017-06-23 19:24:43 +0900 | [diff] [blame] | 31 | ) |
| 32 | |
Jooyung Han | 39edb6c | 2019-11-06 16:53:07 +0900 | [diff] [blame] | 33 | const ( |
| 34 | llndkLibrariesTxt = "llndk.libraries.txt" |
| 35 | vndkCoreLibrariesTxt = "vndkcore.libraries.txt" |
| 36 | vndkSpLibrariesTxt = "vndksp.libraries.txt" |
| 37 | vndkPrivateLibrariesTxt = "vndkprivate.libraries.txt" |
| 38 | vndkUsingCoreVariantLibrariesTxt = "vndkcorevariant.libraries.txt" |
| 39 | ) |
| 40 | |
| 41 | func VndkLibrariesTxtModules(vndkVersion string) []string { |
| 42 | if vndkVersion == "current" { |
| 43 | return []string{ |
| 44 | llndkLibrariesTxt, |
| 45 | vndkCoreLibrariesTxt, |
| 46 | vndkSpLibrariesTxt, |
| 47 | vndkPrivateLibrariesTxt, |
Jooyung Han | 39edb6c | 2019-11-06 16:53:07 +0900 | [diff] [blame] | 48 | } |
| 49 | } |
| 50 | // Snapshot vndks have their own *.libraries.VER.txt files. |
| 51 | // Note that snapshots don't have "vndkcorevariant.libraries.VER.txt" |
| 52 | return []string{ |
| 53 | insertVndkVersion(llndkLibrariesTxt, vndkVersion), |
| 54 | insertVndkVersion(vndkCoreLibrariesTxt, vndkVersion), |
| 55 | insertVndkVersion(vndkSpLibrariesTxt, vndkVersion), |
| 56 | insertVndkVersion(vndkPrivateLibrariesTxt, vndkVersion), |
| 57 | } |
| 58 | } |
| 59 | |
Justin Yun | 8effde4 | 2017-06-23 19:24:43 +0900 | [diff] [blame] | 60 | type VndkProperties struct { |
| 61 | Vndk struct { |
| 62 | // declared as a VNDK or VNDK-SP module. The vendor variant |
| 63 | // will be installed in /system instead of /vendor partition. |
| 64 | // |
Justin Yun | 63e9ec7 | 2020-10-29 16:49:43 +0900 | [diff] [blame] | 65 | // `vendor_available` and `product_available` must be explicitly |
| 66 | // set to either true or false together with `vndk: {enabled: true}`. |
Justin Yun | 8effde4 | 2017-06-23 19:24:43 +0900 | [diff] [blame] | 67 | Enabled *bool |
| 68 | |
| 69 | // declared as a VNDK-SP module, which is a subset of VNDK. |
| 70 | // |
| 71 | // `vndk: { enabled: true }` must set together. |
| 72 | // |
| 73 | // All these modules are allowed to link to VNDK-SP or LL-NDK |
| 74 | // modules only. Other dependency will cause link-type errors. |
| 75 | // |
| 76 | // If `support_system_process` is not set or set to false, |
| 77 | // the module is VNDK-core and can link to other VNDK-core, |
| 78 | // VNDK-SP or LL-NDK modules only. |
| 79 | Support_system_process *bool |
Logan Chien | f351174 | 2017-10-31 18:04:35 +0800 | [diff] [blame] | 80 | |
| 81 | // Extending another module |
| 82 | Extends *string |
Justin Yun | 8effde4 | 2017-06-23 19:24:43 +0900 | [diff] [blame] | 83 | } |
| 84 | } |
| 85 | |
| 86 | type vndkdep struct { |
| 87 | Properties VndkProperties |
| 88 | } |
| 89 | |
| 90 | func (vndk *vndkdep) props() []interface{} { |
| 91 | return []interface{}{&vndk.Properties} |
| 92 | } |
| 93 | |
| 94 | func (vndk *vndkdep) begin(ctx BaseModuleContext) {} |
| 95 | |
| 96 | func (vndk *vndkdep) deps(ctx BaseModuleContext, deps Deps) Deps { |
| 97 | return deps |
| 98 | } |
| 99 | |
| 100 | func (vndk *vndkdep) isVndk() bool { |
| 101 | return Bool(vndk.Properties.Vndk.Enabled) |
| 102 | } |
| 103 | |
| 104 | func (vndk *vndkdep) isVndkSp() bool { |
| 105 | return Bool(vndk.Properties.Vndk.Support_system_process) |
| 106 | } |
| 107 | |
Logan Chien | f351174 | 2017-10-31 18:04:35 +0800 | [diff] [blame] | 108 | func (vndk *vndkdep) isVndkExt() bool { |
| 109 | return vndk.Properties.Vndk.Extends != nil |
| 110 | } |
| 111 | |
| 112 | func (vndk *vndkdep) getVndkExtendsModuleName() string { |
| 113 | return String(vndk.Properties.Vndk.Extends) |
| 114 | } |
| 115 | |
Justin Yun | 8effde4 | 2017-06-23 19:24:43 +0900 | [diff] [blame] | 116 | func (vndk *vndkdep) typeName() string { |
| 117 | if !vndk.isVndk() { |
| 118 | return "native:vendor" |
| 119 | } |
Logan Chien | f351174 | 2017-10-31 18:04:35 +0800 | [diff] [blame] | 120 | if !vndk.isVndkExt() { |
| 121 | if !vndk.isVndkSp() { |
| 122 | return "native:vendor:vndk" |
| 123 | } |
| 124 | return "native:vendor:vndksp" |
Justin Yun | 8effde4 | 2017-06-23 19:24:43 +0900 | [diff] [blame] | 125 | } |
Logan Chien | f351174 | 2017-10-31 18:04:35 +0800 | [diff] [blame] | 126 | if !vndk.isVndkSp() { |
| 127 | return "native:vendor:vndkext" |
| 128 | } |
| 129 | return "native:vendor:vndkspext" |
Justin Yun | 8effde4 | 2017-06-23 19:24:43 +0900 | [diff] [blame] | 130 | } |
| 131 | |
Justin Yun | 63e9ec7 | 2020-10-29 16:49:43 +0900 | [diff] [blame] | 132 | // VNDK link type check from a module with UseVndk() == true. |
Jooyung Han | 479ca17 | 2020-10-19 18:51:07 +0900 | [diff] [blame] | 133 | func (vndk *vndkdep) vndkCheckLinkType(ctx android.BaseModuleContext, to *Module, tag blueprint.DependencyTag) { |
Justin Yun | 8effde4 | 2017-06-23 19:24:43 +0900 | [diff] [blame] | 134 | if to.linker == nil { |
| 135 | return |
| 136 | } |
Jiyong Park | 82e2bf3 | 2017-08-16 14:05:54 +0900 | [diff] [blame] | 137 | if !vndk.isVndk() { |
Justin Yun | 63e9ec7 | 2020-10-29 16:49:43 +0900 | [diff] [blame] | 138 | // Non-VNDK modules those installed to /vendor or /system/vendor |
| 139 | // can't depend on modules marked with vendor_available: false; |
| 140 | // or those installed to /product or /system/product can't depend |
| 141 | // on modules marked with product_available: false. |
Jiyong Park | 82e2bf3 | 2017-08-16 14:05:54 +0900 | [diff] [blame] | 142 | violation := false |
Nan Zhang | 0007d81 | 2017-11-07 10:57:05 -0800 | [diff] [blame] | 143 | if lib, ok := to.linker.(*llndkStubDecorator); ok && !Bool(lib.Properties.Vendor_available) { |
Jiyong Park | 82e2bf3 | 2017-08-16 14:05:54 +0900 | [diff] [blame] | 144 | violation = true |
| 145 | } else { |
| 146 | if _, ok := to.linker.(libraryInterface); ok && to.VendorProperties.Vendor_available != nil && !Bool(to.VendorProperties.Vendor_available) { |
| 147 | // Vendor_available == nil && !Bool(Vendor_available) should be okay since |
Justin Yun | 5f7f7e8 | 2019-11-18 19:52:14 +0900 | [diff] [blame] | 148 | // it means a vendor-only, or product-only library which is a valid dependency |
| 149 | // for non-VNDK modules. |
Jiyong Park | 82e2bf3 | 2017-08-16 14:05:54 +0900 | [diff] [blame] | 150 | violation = true |
| 151 | } |
| 152 | } |
| 153 | if violation { |
| 154 | ctx.ModuleErrorf("Vendor module that is not VNDK should not link to %q which is marked as `vendor_available: false`", to.Name()) |
| 155 | } |
| 156 | } |
Justin Yun | 8effde4 | 2017-06-23 19:24:43 +0900 | [diff] [blame] | 157 | if lib, ok := to.linker.(*libraryDecorator); !ok || !lib.shared() { |
| 158 | // Check only shared libraries. |
| 159 | // Other (static and LL-NDK) libraries are allowed to link. |
| 160 | return |
| 161 | } |
Ivan Lozano | 52767be | 2019-10-18 14:49:46 -0700 | [diff] [blame] | 162 | if !to.UseVndk() { |
Justin Yun | 8effde4 | 2017-06-23 19:24:43 +0900 | [diff] [blame] | 163 | ctx.ModuleErrorf("(%s) should not link to %q which is not a vendor-available library", |
| 164 | vndk.typeName(), to.Name()) |
| 165 | return |
| 166 | } |
Logan Chien | f351174 | 2017-10-31 18:04:35 +0800 | [diff] [blame] | 167 | if tag == vndkExtDepTag { |
| 168 | // Ensure `extends: "name"` property refers a vndk module that has vendor_available |
| 169 | // and has identical vndk properties. |
| 170 | if to.vndkdep == nil || !to.vndkdep.isVndk() { |
| 171 | ctx.ModuleErrorf("`extends` refers a non-vndk module %q", to.Name()) |
| 172 | return |
| 173 | } |
| 174 | if vndk.isVndkSp() != to.vndkdep.isVndkSp() { |
| 175 | ctx.ModuleErrorf( |
| 176 | "`extends` refers a module %q with mismatched support_system_process", |
| 177 | to.Name()) |
| 178 | return |
| 179 | } |
Justin Yun | 63e9ec7 | 2020-10-29 16:49:43 +0900 | [diff] [blame] | 180 | // TODO(b/150902910): vndk-ext for product must check product_available. |
Logan Chien | f351174 | 2017-10-31 18:04:35 +0800 | [diff] [blame] | 181 | if !Bool(to.VendorProperties.Vendor_available) { |
| 182 | ctx.ModuleErrorf( |
| 183 | "`extends` refers module %q which does not have `vendor_available: true`", |
| 184 | to.Name()) |
| 185 | return |
| 186 | } |
| 187 | } |
Justin Yun | 8effde4 | 2017-06-23 19:24:43 +0900 | [diff] [blame] | 188 | if to.vndkdep == nil { |
| 189 | return |
| 190 | } |
Logan Chien | f351174 | 2017-10-31 18:04:35 +0800 | [diff] [blame] | 191 | |
Logan Chien | d3c59a2 | 2018-03-29 14:08:15 +0800 | [diff] [blame] | 192 | // Check the dependencies of VNDK shared libraries. |
Martin Stjernholm | 257eb0c | 2018-10-15 13:05:27 +0100 | [diff] [blame] | 193 | if err := vndkIsVndkDepAllowed(vndk, to.vndkdep); err != nil { |
| 194 | ctx.ModuleErrorf("(%s) should not link to %q (%s): %v", |
| 195 | vndk.typeName(), to.Name(), to.vndkdep.typeName(), err) |
Logan Chien | f351174 | 2017-10-31 18:04:35 +0800 | [diff] [blame] | 196 | return |
| 197 | } |
Logan Chien | d3c59a2 | 2018-03-29 14:08:15 +0800 | [diff] [blame] | 198 | } |
Logan Chien | f351174 | 2017-10-31 18:04:35 +0800 | [diff] [blame] | 199 | |
Martin Stjernholm | 257eb0c | 2018-10-15 13:05:27 +0100 | [diff] [blame] | 200 | func vndkIsVndkDepAllowed(from *vndkdep, to *vndkdep) error { |
Logan Chien | d3c59a2 | 2018-03-29 14:08:15 +0800 | [diff] [blame] | 201 | // Check the dependencies of VNDK, VNDK-Ext, VNDK-SP, VNDK-SP-Ext and vendor modules. |
| 202 | if from.isVndkExt() { |
| 203 | if from.isVndkSp() { |
Martin Stjernholm | 257eb0c | 2018-10-15 13:05:27 +0100 | [diff] [blame] | 204 | if to.isVndk() && !to.isVndkSp() { |
| 205 | return errors.New("VNDK-SP extensions must not depend on VNDK or VNDK extensions") |
| 206 | } |
| 207 | return nil |
Logan Chien | d3c59a2 | 2018-03-29 14:08:15 +0800 | [diff] [blame] | 208 | } |
| 209 | // VNDK-Ext may depend on VNDK, VNDK-Ext, VNDK-SP, VNDK-SP-Ext, or vendor libs. |
Martin Stjernholm | 257eb0c | 2018-10-15 13:05:27 +0100 | [diff] [blame] | 210 | return nil |
Justin Yun | 8effde4 | 2017-06-23 19:24:43 +0900 | [diff] [blame] | 211 | } |
Logan Chien | d3c59a2 | 2018-03-29 14:08:15 +0800 | [diff] [blame] | 212 | if from.isVndk() { |
| 213 | if to.isVndkExt() { |
Martin Stjernholm | 257eb0c | 2018-10-15 13:05:27 +0100 | [diff] [blame] | 214 | return errors.New("VNDK-core and VNDK-SP must not depend on VNDK extensions") |
Logan Chien | d3c59a2 | 2018-03-29 14:08:15 +0800 | [diff] [blame] | 215 | } |
| 216 | if from.isVndkSp() { |
Martin Stjernholm | 257eb0c | 2018-10-15 13:05:27 +0100 | [diff] [blame] | 217 | if !to.isVndkSp() { |
| 218 | return errors.New("VNDK-SP must only depend on VNDK-SP") |
| 219 | } |
| 220 | return nil |
Logan Chien | d3c59a2 | 2018-03-29 14:08:15 +0800 | [diff] [blame] | 221 | } |
Martin Stjernholm | 257eb0c | 2018-10-15 13:05:27 +0100 | [diff] [blame] | 222 | if !to.isVndk() { |
| 223 | return errors.New("VNDK-core must only depend on VNDK-core or VNDK-SP") |
| 224 | } |
| 225 | return nil |
Logan Chien | d3c59a2 | 2018-03-29 14:08:15 +0800 | [diff] [blame] | 226 | } |
| 227 | // Vendor modules may depend on VNDK, VNDK-Ext, VNDK-SP, VNDK-SP-Ext, or vendor libs. |
Martin Stjernholm | 257eb0c | 2018-10-15 13:05:27 +0100 | [diff] [blame] | 228 | return nil |
Justin Yun | 8effde4 | 2017-06-23 19:24:43 +0900 | [diff] [blame] | 229 | } |
Jiyong Park | d5b18a5 | 2017-08-03 21:22:50 +0900 | [diff] [blame] | 230 | |
| 231 | var ( |
Jooyung Han | a463f72 | 2019-11-01 08:45:59 +0900 | [diff] [blame] | 232 | vndkCoreLibrariesKey = android.NewOnceKey("vndkCoreLibrarires") |
| 233 | vndkSpLibrariesKey = android.NewOnceKey("vndkSpLibrarires") |
| 234 | llndkLibrariesKey = android.NewOnceKey("llndkLibrarires") |
| 235 | vndkPrivateLibrariesKey = android.NewOnceKey("vndkPrivateLibrarires") |
Kiyoung Kim | e1aa8ea | 2019-12-30 11:12:55 +0900 | [diff] [blame] | 236 | vndkUsingCoreVariantLibrariesKey = android.NewOnceKey("vndkUsingCoreVariantLibraries") |
Jooyung Han | a463f72 | 2019-11-01 08:45:59 +0900 | [diff] [blame] | 237 | vndkMustUseVendorVariantListKey = android.NewOnceKey("vndkMustUseVendorVariantListKey") |
| 238 | vndkLibrariesLock sync.Mutex |
Inseob Kim | ae55303 | 2019-05-14 18:52:49 +0900 | [diff] [blame] | 239 | ) |
Inseob Kim | 1f086e2 | 2019-05-09 13:29:15 +0900 | [diff] [blame] | 240 | |
Jooyung Han | 0302a84 | 2019-10-30 18:43:49 +0900 | [diff] [blame] | 241 | func vndkCoreLibraries(config android.Config) map[string]string { |
Inseob Kim | 9516ee9 | 2019-05-09 10:56:13 +0900 | [diff] [blame] | 242 | return config.Once(vndkCoreLibrariesKey, func() interface{} { |
Jooyung Han | 0302a84 | 2019-10-30 18:43:49 +0900 | [diff] [blame] | 243 | return make(map[string]string) |
| 244 | }).(map[string]string) |
Inseob Kim | 9516ee9 | 2019-05-09 10:56:13 +0900 | [diff] [blame] | 245 | } |
| 246 | |
Jooyung Han | 0302a84 | 2019-10-30 18:43:49 +0900 | [diff] [blame] | 247 | func vndkSpLibraries(config android.Config) map[string]string { |
Inseob Kim | 9516ee9 | 2019-05-09 10:56:13 +0900 | [diff] [blame] | 248 | return config.Once(vndkSpLibrariesKey, func() interface{} { |
Jooyung Han | 0302a84 | 2019-10-30 18:43:49 +0900 | [diff] [blame] | 249 | return make(map[string]string) |
| 250 | }).(map[string]string) |
Inseob Kim | 9516ee9 | 2019-05-09 10:56:13 +0900 | [diff] [blame] | 251 | } |
| 252 | |
Jooyung Han | 0302a84 | 2019-10-30 18:43:49 +0900 | [diff] [blame] | 253 | func isLlndkLibrary(baseModuleName string, config android.Config) bool { |
Colin Cross | 0477b42 | 2020-10-13 18:43:54 -0700 | [diff] [blame] | 254 | _, ok := llndkLibraries(config)[strings.TrimSuffix(baseModuleName, llndkLibrarySuffix)] |
Jooyung Han | 0302a84 | 2019-10-30 18:43:49 +0900 | [diff] [blame] | 255 | return ok |
| 256 | } |
| 257 | |
| 258 | func llndkLibraries(config android.Config) map[string]string { |
Inseob Kim | 9516ee9 | 2019-05-09 10:56:13 +0900 | [diff] [blame] | 259 | return config.Once(llndkLibrariesKey, func() interface{} { |
Jooyung Han | 0302a84 | 2019-10-30 18:43:49 +0900 | [diff] [blame] | 260 | return make(map[string]string) |
| 261 | }).(map[string]string) |
Inseob Kim | 9516ee9 | 2019-05-09 10:56:13 +0900 | [diff] [blame] | 262 | } |
| 263 | |
Jooyung Han | 0302a84 | 2019-10-30 18:43:49 +0900 | [diff] [blame] | 264 | func isVndkPrivateLibrary(baseModuleName string, config android.Config) bool { |
| 265 | _, ok := vndkPrivateLibraries(config)[baseModuleName] |
| 266 | return ok |
| 267 | } |
| 268 | |
| 269 | func vndkPrivateLibraries(config android.Config) map[string]string { |
Inseob Kim | 9516ee9 | 2019-05-09 10:56:13 +0900 | [diff] [blame] | 270 | return config.Once(vndkPrivateLibrariesKey, func() interface{} { |
Jooyung Han | 0302a84 | 2019-10-30 18:43:49 +0900 | [diff] [blame] | 271 | return make(map[string]string) |
| 272 | }).(map[string]string) |
Inseob Kim | 9516ee9 | 2019-05-09 10:56:13 +0900 | [diff] [blame] | 273 | } |
| 274 | |
Jooyung Han | 0302a84 | 2019-10-30 18:43:49 +0900 | [diff] [blame] | 275 | func vndkUsingCoreVariantLibraries(config android.Config) map[string]string { |
Inseob Kim | 9516ee9 | 2019-05-09 10:56:13 +0900 | [diff] [blame] | 276 | return config.Once(vndkUsingCoreVariantLibrariesKey, func() interface{} { |
Jooyung Han | 0302a84 | 2019-10-30 18:43:49 +0900 | [diff] [blame] | 277 | return make(map[string]string) |
| 278 | }).(map[string]string) |
Inseob Kim | 9516ee9 | 2019-05-09 10:56:13 +0900 | [diff] [blame] | 279 | } |
| 280 | |
Jooyung Han | 097087b | 2019-10-22 19:32:18 +0900 | [diff] [blame] | 281 | func vndkMustUseVendorVariantList(cfg android.Config) []string { |
| 282 | return cfg.Once(vndkMustUseVendorVariantListKey, func() interface{} { |
Jooyung Han | 097087b | 2019-10-22 19:32:18 +0900 | [diff] [blame] | 283 | return config.VndkMustUseVendorVariantList |
| 284 | }).([]string) |
| 285 | } |
| 286 | |
| 287 | // test may call this to override global configuration(config.VndkMustUseVendorVariantList) |
| 288 | // when it is called, it must be before the first call to vndkMustUseVendorVariantList() |
| 289 | func setVndkMustUseVendorVariantListForTest(config android.Config, mustUseVendorVariantList []string) { |
Jooyung Han | a463f72 | 2019-11-01 08:45:59 +0900 | [diff] [blame] | 290 | config.Once(vndkMustUseVendorVariantListKey, func() interface{} { |
Jooyung Han | 097087b | 2019-10-22 19:32:18 +0900 | [diff] [blame] | 291 | return mustUseVendorVariantList |
| 292 | }) |
| 293 | } |
| 294 | |
Inseob Kim | 1f086e2 | 2019-05-09 13:29:15 +0900 | [diff] [blame] | 295 | func processLlndkLibrary(mctx android.BottomUpMutatorContext, m *Module) { |
| 296 | lib := m.linker.(*llndkStubDecorator) |
Colin Cross | 0477b42 | 2020-10-13 18:43:54 -0700 | [diff] [blame] | 297 | name := m.ImplementationModuleName(mctx) |
| 298 | filename := name + ".so" |
Inseob Kim | 9516ee9 | 2019-05-09 10:56:13 +0900 | [diff] [blame] | 299 | |
Inseob Kim | 1f086e2 | 2019-05-09 13:29:15 +0900 | [diff] [blame] | 300 | vndkLibrariesLock.Lock() |
| 301 | defer vndkLibrariesLock.Unlock() |
Inseob Kim | 9516ee9 | 2019-05-09 10:56:13 +0900 | [diff] [blame] | 302 | |
Jooyung Han | 0302a84 | 2019-10-30 18:43:49 +0900 | [diff] [blame] | 303 | llndkLibraries(mctx.Config())[name] = filename |
Inseob Kim | 1f086e2 | 2019-05-09 13:29:15 +0900 | [diff] [blame] | 304 | if !Bool(lib.Properties.Vendor_available) { |
Jooyung Han | 0302a84 | 2019-10-30 18:43:49 +0900 | [diff] [blame] | 305 | vndkPrivateLibraries(mctx.Config())[name] = filename |
Jiyong Park | d5b18a5 | 2017-08-03 21:22:50 +0900 | [diff] [blame] | 306 | } |
Colin Cross | 56a8321 | 2020-09-15 18:30:11 -0700 | [diff] [blame] | 307 | |
Jooyung Han | 61b66e9 | 2020-03-21 14:21:46 +0000 | [diff] [blame] | 308 | if mctx.OtherModuleExists(name) { |
| 309 | mctx.AddFarVariationDependencies(m.Target().Variations(), llndkImplDep, name) |
| 310 | } |
Jiyong Park | d5b18a5 | 2017-08-03 21:22:50 +0900 | [diff] [blame] | 311 | } |
Inseob Kim | 1f086e2 | 2019-05-09 13:29:15 +0900 | [diff] [blame] | 312 | |
| 313 | func processVndkLibrary(mctx android.BottomUpMutatorContext, m *Module) { |
Jooyung Han | 0302a84 | 2019-10-30 18:43:49 +0900 | [diff] [blame] | 314 | name := m.BaseModuleName() |
| 315 | filename, err := getVndkFileName(m) |
| 316 | if err != nil { |
| 317 | panic(err) |
| 318 | } |
Inseob Kim | 1f086e2 | 2019-05-09 13:29:15 +0900 | [diff] [blame] | 319 | |
Colin Cross | 31076b3 | 2020-10-23 17:22:06 -0700 | [diff] [blame] | 320 | if lib := m.library; lib != nil && lib.hasStubsVariants() && name != "libz" { |
Jiyong Park | 2478e4e | 2020-05-18 09:30:14 +0000 | [diff] [blame] | 321 | // b/155456180 libz is the ONLY exception here. We don't want to make |
| 322 | // libz an LLNDK library because we in general can't guarantee that |
| 323 | // libz will behave consistently especially about the compression. |
| 324 | // i.e. the compressed output might be different across releases. |
| 325 | // As the library is an external one, it's risky to keep the compatibility |
| 326 | // promise if it becomes an LLNDK. |
Jiyong Park | ea97f51 | 2020-03-31 15:31:17 +0900 | [diff] [blame] | 327 | mctx.PropertyErrorf("vndk.enabled", "This library provides stubs. Shouldn't be VNDK. Consider making it as LLNDK") |
| 328 | } |
| 329 | |
Inseob Kim | 1f086e2 | 2019-05-09 13:29:15 +0900 | [diff] [blame] | 330 | vndkLibrariesLock.Lock() |
| 331 | defer vndkLibrariesLock.Unlock() |
| 332 | |
Jooyung Han | 097087b | 2019-10-22 19:32:18 +0900 | [diff] [blame] | 333 | if inList(name, vndkMustUseVendorVariantList(mctx.Config())) { |
| 334 | m.Properties.MustUseVendorVariant = true |
| 335 | } |
Jooyung Han | 0302a84 | 2019-10-30 18:43:49 +0900 | [diff] [blame] | 336 | if mctx.DeviceConfig().VndkUseCoreVariant() && !m.Properties.MustUseVendorVariant { |
| 337 | vndkUsingCoreVariantLibraries(mctx.Config())[name] = filename |
Inseob Kim | 1f086e2 | 2019-05-09 13:29:15 +0900 | [diff] [blame] | 338 | } |
Jooyung Han | 0302a84 | 2019-10-30 18:43:49 +0900 | [diff] [blame] | 339 | |
Inseob Kim | 1f086e2 | 2019-05-09 13:29:15 +0900 | [diff] [blame] | 340 | if m.vndkdep.isVndkSp() { |
Jooyung Han | 0302a84 | 2019-10-30 18:43:49 +0900 | [diff] [blame] | 341 | vndkSpLibraries(mctx.Config())[name] = filename |
Inseob Kim | 1f086e2 | 2019-05-09 13:29:15 +0900 | [diff] [blame] | 342 | } else { |
Jooyung Han | 0302a84 | 2019-10-30 18:43:49 +0900 | [diff] [blame] | 343 | vndkCoreLibraries(mctx.Config())[name] = filename |
Inseob Kim | 1f086e2 | 2019-05-09 13:29:15 +0900 | [diff] [blame] | 344 | } |
Justin Yun | 63e9ec7 | 2020-10-29 16:49:43 +0900 | [diff] [blame] | 345 | // As `vendor_available` and `product_available` has the same value for VNDK modules, |
| 346 | // we don't need to check both values. |
Inseob Kim | 1f086e2 | 2019-05-09 13:29:15 +0900 | [diff] [blame] | 347 | if !Bool(m.VendorProperties.Vendor_available) { |
Jooyung Han | 0302a84 | 2019-10-30 18:43:49 +0900 | [diff] [blame] | 348 | vndkPrivateLibraries(mctx.Config())[name] = filename |
Inseob Kim | 1f086e2 | 2019-05-09 13:29:15 +0900 | [diff] [blame] | 349 | } |
| 350 | } |
| 351 | |
Yo Chiang | 08fac0c | 2020-07-29 01:08:20 +0800 | [diff] [blame] | 352 | // Check for modules that mustn't be VNDK |
Yo Chiang | bba545e | 2020-06-09 16:15:37 +0800 | [diff] [blame] | 353 | func shouldSkipVndkMutator(m *Module) bool { |
Jooyung Han | 31c470b | 2019-10-18 16:26:59 +0900 | [diff] [blame] | 354 | if !m.Enabled() { |
Yo Chiang | bba545e | 2020-06-09 16:15:37 +0800 | [diff] [blame] | 355 | return true |
Jooyung Han | 31c470b | 2019-10-18 16:26:59 +0900 | [diff] [blame] | 356 | } |
Yo Chiang | bba545e | 2020-06-09 16:15:37 +0800 | [diff] [blame] | 357 | if !m.Device() { |
| 358 | // Skip non-device modules |
| 359 | return true |
Jooyung Han | 87a7f30 | 2019-10-29 05:18:21 +0900 | [diff] [blame] | 360 | } |
Jooyung Han | 31c470b | 2019-10-18 16:26:59 +0900 | [diff] [blame] | 361 | if m.Target().NativeBridge == android.NativeBridgeEnabled { |
Yo Chiang | bba545e | 2020-06-09 16:15:37 +0800 | [diff] [blame] | 362 | // Skip native_bridge modules |
| 363 | return true |
| 364 | } |
| 365 | return false |
| 366 | } |
| 367 | |
| 368 | func IsForVndkApex(mctx android.BottomUpMutatorContext, m *Module) bool { |
| 369 | if shouldSkipVndkMutator(m) { |
Jooyung Han | 31c470b | 2019-10-18 16:26:59 +0900 | [diff] [blame] | 370 | return false |
| 371 | } |
| 372 | |
| 373 | // prebuilt vndk modules should match with device |
| 374 | // TODO(b/142675459): Use enabled: to select target device in vndk_prebuilt_shared |
| 375 | // When b/142675459 is landed, remove following check |
| 376 | if p, ok := m.linker.(*vndkPrebuiltLibraryDecorator); ok && !p.matchesWithDevice(mctx.DeviceConfig()) { |
| 377 | return false |
| 378 | } |
| 379 | |
| 380 | if lib, ok := m.linker.(libraryInterface); ok { |
Jooyung Han | 73d20d0 | 2020-03-27 16:06:55 +0900 | [diff] [blame] | 381 | // VNDK APEX for VNDK-Lite devices will have VNDK-SP libraries from core variants |
| 382 | if mctx.DeviceConfig().VndkVersion() == "" { |
| 383 | // b/73296261: filter out libz.so because it is considered as LLNDK for VNDK-lite devices |
| 384 | if mctx.ModuleName() == "libz" { |
| 385 | return false |
| 386 | } |
| 387 | return m.ImageVariation().Variation == android.CoreVariation && lib.shared() && m.isVndkSp() |
| 388 | } |
| 389 | |
Justin Yun | 5f7f7e8 | 2019-11-18 19:52:14 +0900 | [diff] [blame] | 390 | useCoreVariant := m.VndkVersion() == mctx.DeviceConfig().PlatformVndkVersion() && |
Jooyung Han | 87a7f30 | 2019-10-29 05:18:21 +0900 | [diff] [blame] | 391 | mctx.DeviceConfig().VndkUseCoreVariant() && !m.MustUseVendorVariant() |
Jooyung Han | a57af4a | 2020-01-23 05:36:59 +0000 | [diff] [blame] | 392 | return lib.shared() && m.inVendor() && m.IsVndk() && !m.isVndkExt() && !useCoreVariant |
Jooyung Han | 31c470b | 2019-10-18 16:26:59 +0900 | [diff] [blame] | 393 | } |
| 394 | return false |
| 395 | } |
| 396 | |
Inseob Kim | 1f086e2 | 2019-05-09 13:29:15 +0900 | [diff] [blame] | 397 | // gather list of vndk-core, vndk-sp, and ll-ndk libs |
| 398 | func VndkMutator(mctx android.BottomUpMutatorContext) { |
| 399 | m, ok := mctx.Module().(*Module) |
| 400 | if !ok { |
| 401 | return |
| 402 | } |
Yo Chiang | bba545e | 2020-06-09 16:15:37 +0800 | [diff] [blame] | 403 | |
| 404 | if shouldSkipVndkMutator(m) { |
Justin Yun | 7390ea3 | 2019-09-08 11:34:06 +0900 | [diff] [blame] | 405 | return |
| 406 | } |
Inseob Kim | 1f086e2 | 2019-05-09 13:29:15 +0900 | [diff] [blame] | 407 | |
| 408 | if _, ok := m.linker.(*llndkStubDecorator); ok { |
| 409 | processLlndkLibrary(mctx, m) |
| 410 | return |
| 411 | } |
| 412 | |
| 413 | lib, is_lib := m.linker.(*libraryDecorator) |
| 414 | prebuilt_lib, is_prebuilt_lib := m.linker.(*prebuiltLibraryLinker) |
| 415 | |
Inseob Kim | 64c4395 | 2019-08-26 16:52:35 +0900 | [diff] [blame] | 416 | if (is_lib && lib.buildShared()) || (is_prebuilt_lib && prebuilt_lib.buildShared()) { |
| 417 | if m.vndkdep != nil && m.vndkdep.isVndk() && !m.vndkdep.isVndkExt() { |
Inseob Kim | 1f086e2 | 2019-05-09 13:29:15 +0900 | [diff] [blame] | 418 | processVndkLibrary(mctx, m) |
| 419 | return |
| 420 | } |
| 421 | } |
| 422 | } |
| 423 | |
| 424 | func init() { |
Jooyung Han | 39edb6c | 2019-11-06 16:53:07 +0900 | [diff] [blame] | 425 | android.RegisterModuleType("vndk_libraries_txt", VndkLibrariesTxtFactory) |
Inseob Kim | 1f086e2 | 2019-05-09 13:29:15 +0900 | [diff] [blame] | 426 | android.RegisterSingletonType("vndk-snapshot", VndkSnapshotSingleton) |
Inseob Kim | 1f086e2 | 2019-05-09 13:29:15 +0900 | [diff] [blame] | 427 | } |
| 428 | |
Jooyung Han | 2216fb1 | 2019-11-06 16:46:15 +0900 | [diff] [blame] | 429 | type vndkLibrariesTxt struct { |
| 430 | android.ModuleBase |
| 431 | outputFile android.OutputPath |
| 432 | } |
| 433 | |
Jaewoong Jung | 4b79e98 | 2020-06-01 10:45:49 -0700 | [diff] [blame] | 434 | var _ etc.PrebuiltEtcModule = &vndkLibrariesTxt{} |
Jooyung Han | 39edb6c | 2019-11-06 16:53:07 +0900 | [diff] [blame] | 435 | var _ android.OutputFileProducer = &vndkLibrariesTxt{} |
| 436 | |
Jooyung Han | 2216fb1 | 2019-11-06 16:46:15 +0900 | [diff] [blame] | 437 | // vndk_libraries_txt is a special kind of module type in that it name is one of |
| 438 | // - llndk.libraries.txt |
| 439 | // - vndkcore.libraries.txt |
| 440 | // - vndksp.libraries.txt |
| 441 | // - vndkprivate.libraries.txt |
| 442 | // - vndkcorevariant.libraries.txt |
| 443 | // A module behaves like a prebuilt_etc but its content is generated by soong. |
| 444 | // By being a soong module, these files can be referenced by other soong modules. |
| 445 | // For example, apex_vndk can depend on these files as prebuilt. |
Jooyung Han | 39edb6c | 2019-11-06 16:53:07 +0900 | [diff] [blame] | 446 | func VndkLibrariesTxtFactory() android.Module { |
Jooyung Han | 2216fb1 | 2019-11-06 16:46:15 +0900 | [diff] [blame] | 447 | m := &vndkLibrariesTxt{} |
| 448 | android.InitAndroidModule(m) |
| 449 | return m |
| 450 | } |
| 451 | |
| 452 | func insertVndkVersion(filename string, vndkVersion string) string { |
| 453 | if index := strings.LastIndex(filename, "."); index != -1 { |
| 454 | return filename[:index] + "." + vndkVersion + filename[index:] |
| 455 | } |
| 456 | return filename |
| 457 | } |
| 458 | |
| 459 | func (txt *vndkLibrariesTxt) GenerateAndroidBuildActions(ctx android.ModuleContext) { |
| 460 | var list []string |
| 461 | switch txt.Name() { |
Jooyung Han | 39edb6c | 2019-11-06 16:53:07 +0900 | [diff] [blame] | 462 | case llndkLibrariesTxt: |
Jooyung Han | 2216fb1 | 2019-11-06 16:46:15 +0900 | [diff] [blame] | 463 | for _, filename := range android.SortedStringMapValues(llndkLibraries(ctx.Config())) { |
| 464 | if strings.HasPrefix(filename, "libclang_rt.hwasan-") { |
| 465 | continue |
| 466 | } |
| 467 | list = append(list, filename) |
| 468 | } |
Jooyung Han | 39edb6c | 2019-11-06 16:53:07 +0900 | [diff] [blame] | 469 | case vndkCoreLibrariesTxt: |
Jooyung Han | 2216fb1 | 2019-11-06 16:46:15 +0900 | [diff] [blame] | 470 | list = android.SortedStringMapValues(vndkCoreLibraries(ctx.Config())) |
Jooyung Han | 39edb6c | 2019-11-06 16:53:07 +0900 | [diff] [blame] | 471 | case vndkSpLibrariesTxt: |
Jooyung Han | 2216fb1 | 2019-11-06 16:46:15 +0900 | [diff] [blame] | 472 | list = android.SortedStringMapValues(vndkSpLibraries(ctx.Config())) |
Jooyung Han | 39edb6c | 2019-11-06 16:53:07 +0900 | [diff] [blame] | 473 | case vndkPrivateLibrariesTxt: |
Jooyung Han | 2216fb1 | 2019-11-06 16:46:15 +0900 | [diff] [blame] | 474 | list = android.SortedStringMapValues(vndkPrivateLibraries(ctx.Config())) |
Jooyung Han | 39edb6c | 2019-11-06 16:53:07 +0900 | [diff] [blame] | 475 | case vndkUsingCoreVariantLibrariesTxt: |
Jooyung Han | 2216fb1 | 2019-11-06 16:46:15 +0900 | [diff] [blame] | 476 | list = android.SortedStringMapValues(vndkUsingCoreVariantLibraries(ctx.Config())) |
| 477 | default: |
| 478 | ctx.ModuleErrorf("name(%s) is unknown.", txt.Name()) |
| 479 | return |
| 480 | } |
| 481 | |
Kiyoung Kim | e1aa8ea | 2019-12-30 11:12:55 +0900 | [diff] [blame] | 482 | var filename string |
| 483 | if txt.Name() != vndkUsingCoreVariantLibrariesTxt { |
| 484 | filename = insertVndkVersion(txt.Name(), ctx.DeviceConfig().PlatformVndkVersion()) |
| 485 | } else { |
| 486 | filename = txt.Name() |
| 487 | } |
| 488 | |
Jooyung Han | 2216fb1 | 2019-11-06 16:46:15 +0900 | [diff] [blame] | 489 | txt.outputFile = android.PathForModuleOut(ctx, filename).OutputPath |
Colin Cross | cf371cc | 2020-11-13 11:48:42 -0800 | [diff] [blame] | 490 | android.WriteFileRule(ctx, txt.outputFile, strings.Join(list, "\n")) |
Jooyung Han | 2216fb1 | 2019-11-06 16:46:15 +0900 | [diff] [blame] | 491 | |
| 492 | installPath := android.PathForModuleInstall(ctx, "etc") |
| 493 | ctx.InstallFile(installPath, filename, txt.outputFile) |
| 494 | } |
| 495 | |
Jiyong Park | 0b0e1b9 | 2019-12-03 13:24:29 +0900 | [diff] [blame] | 496 | func (txt *vndkLibrariesTxt) AndroidMkEntries() []android.AndroidMkEntries { |
| 497 | return []android.AndroidMkEntries{android.AndroidMkEntries{ |
Jooyung Han | 2216fb1 | 2019-11-06 16:46:15 +0900 | [diff] [blame] | 498 | Class: "ETC", |
| 499 | OutputFile: android.OptionalPathForPath(txt.outputFile), |
| 500 | ExtraEntries: []android.AndroidMkExtraEntriesFunc{ |
| 501 | func(entries *android.AndroidMkEntries) { |
| 502 | entries.SetString("LOCAL_MODULE_STEM", txt.outputFile.Base()) |
| 503 | }, |
| 504 | }, |
Jiyong Park | 0b0e1b9 | 2019-12-03 13:24:29 +0900 | [diff] [blame] | 505 | }} |
Jooyung Han | 2216fb1 | 2019-11-06 16:46:15 +0900 | [diff] [blame] | 506 | } |
| 507 | |
Jooyung Han | 0703fd8 | 2020-08-26 22:11:53 +0900 | [diff] [blame] | 508 | // PrebuiltEtcModule interface |
Jooyung Han | 39edb6c | 2019-11-06 16:53:07 +0900 | [diff] [blame] | 509 | func (txt *vndkLibrariesTxt) OutputFile() android.OutputPath { |
| 510 | return txt.outputFile |
| 511 | } |
| 512 | |
Jooyung Han | 0703fd8 | 2020-08-26 22:11:53 +0900 | [diff] [blame] | 513 | // PrebuiltEtcModule interface |
| 514 | func (txt *vndkLibrariesTxt) BaseDir() string { |
| 515 | return "etc" |
Jooyung Han | 39edb6c | 2019-11-06 16:53:07 +0900 | [diff] [blame] | 516 | } |
| 517 | |
Jooyung Han | 0703fd8 | 2020-08-26 22:11:53 +0900 | [diff] [blame] | 518 | // PrebuiltEtcModule interface |
Jooyung Han | 39edb6c | 2019-11-06 16:53:07 +0900 | [diff] [blame] | 519 | func (txt *vndkLibrariesTxt) SubDir() string { |
| 520 | return "" |
| 521 | } |
| 522 | |
Jooyung Han | 0703fd8 | 2020-08-26 22:11:53 +0900 | [diff] [blame] | 523 | func (txt *vndkLibrariesTxt) OutputFiles(tag string) (android.Paths, error) { |
| 524 | return android.Paths{txt.outputFile}, nil |
| 525 | } |
| 526 | |
Inseob Kim | 1f086e2 | 2019-05-09 13:29:15 +0900 | [diff] [blame] | 527 | func VndkSnapshotSingleton() android.Singleton { |
| 528 | return &vndkSnapshotSingleton{} |
| 529 | } |
| 530 | |
Jooyung Han | 0302a84 | 2019-10-30 18:43:49 +0900 | [diff] [blame] | 531 | type vndkSnapshotSingleton struct { |
Jooyung Han | 39edb6c | 2019-11-06 16:53:07 +0900 | [diff] [blame] | 532 | vndkLibrariesFile android.OutputPath |
| 533 | vndkSnapshotZipFile android.OptionalPath |
Jooyung Han | 0302a84 | 2019-10-30 18:43:49 +0900 | [diff] [blame] | 534 | } |
Inseob Kim | 1f086e2 | 2019-05-09 13:29:15 +0900 | [diff] [blame] | 535 | |
Inseob Kim | de5744a | 2020-12-02 13:14:28 +0900 | [diff] [blame^] | 536 | func isVndkSnapshotAware(config android.DeviceConfig, m *Module, |
Colin Cross | 56a8321 | 2020-09-15 18:30:11 -0700 | [diff] [blame] | 537 | apexInfo android.ApexInfo) (i snapshotLibraryInterface, vndkType string, isVndkSnapshotLib bool) { |
| 538 | |
Inseob Kim | eda2e9c | 2020-03-03 22:06:32 +0900 | [diff] [blame] | 539 | if m.Target().NativeBridge == android.NativeBridgeEnabled { |
| 540 | return nil, "", false |
| 541 | } |
Jooyung Han | 261e158 | 2020-10-20 18:54:21 +0900 | [diff] [blame] | 542 | // !inVendor: There's product/vendor variants for VNDK libs. We only care about vendor variants. |
| 543 | // !installable: Snapshot only cares about "installable" modules. |
| 544 | // isSnapshotPrebuilt: Snapshotting a snapshot doesn't make sense. |
Colin Cross | 56a8321 | 2020-09-15 18:30:11 -0700 | [diff] [blame] | 545 | if !m.inVendor() || !m.installable(apexInfo) || m.isSnapshotPrebuilt() { |
Inseob Kim | eda2e9c | 2020-03-03 22:06:32 +0900 | [diff] [blame] | 546 | return nil, "", false |
| 547 | } |
| 548 | l, ok := m.linker.(snapshotLibraryInterface) |
| 549 | if !ok || !l.shared() { |
| 550 | return nil, "", false |
| 551 | } |
| 552 | if m.VndkVersion() == config.PlatformVndkVersion() && m.IsVndk() && !m.isVndkExt() { |
| 553 | if m.isVndkSp() { |
| 554 | return l, "vndk-sp", true |
| 555 | } else { |
| 556 | return l, "vndk-core", true |
| 557 | } |
| 558 | } |
| 559 | |
| 560 | return nil, "", false |
| 561 | } |
| 562 | |
Inseob Kim | 1f086e2 | 2019-05-09 13:29:15 +0900 | [diff] [blame] | 563 | func (c *vndkSnapshotSingleton) GenerateBuildActions(ctx android.SingletonContext) { |
Jooyung Han | 0302a84 | 2019-10-30 18:43:49 +0900 | [diff] [blame] | 564 | // build these files even if PlatformVndkVersion or BoardVndkVersion is not set |
| 565 | c.buildVndkLibrariesTxtFiles(ctx) |
| 566 | |
Inseob Kim | 1f086e2 | 2019-05-09 13:29:15 +0900 | [diff] [blame] | 567 | // BOARD_VNDK_VERSION must be set to 'current' in order to generate a VNDK snapshot. |
| 568 | if ctx.DeviceConfig().VndkVersion() != "current" { |
| 569 | return |
| 570 | } |
| 571 | |
| 572 | if ctx.DeviceConfig().PlatformVndkVersion() == "" { |
| 573 | return |
| 574 | } |
| 575 | |
Inseob Kim | 242ef0c | 2019-10-22 20:15:20 +0900 | [diff] [blame] | 576 | var snapshotOutputs android.Paths |
| 577 | |
| 578 | /* |
| 579 | VNDK snapshot zipped artifacts directory structure: |
| 580 | {SNAPSHOT_ARCH}/ |
| 581 | arch-{TARGET_ARCH}-{TARGET_ARCH_VARIANT}/ |
| 582 | shared/ |
| 583 | vndk-core/ |
| 584 | (VNDK-core libraries, e.g. libbinder.so) |
| 585 | vndk-sp/ |
| 586 | (VNDK-SP libraries, e.g. libc++.so) |
| 587 | arch-{TARGET_2ND_ARCH}-{TARGET_2ND_ARCH_VARIANT}/ |
| 588 | shared/ |
| 589 | vndk-core/ |
| 590 | (VNDK-core libraries, e.g. libbinder.so) |
| 591 | vndk-sp/ |
| 592 | (VNDK-SP libraries, e.g. libc++.so) |
| 593 | binder32/ |
| 594 | (This directory is newly introduced in v28 (Android P) to hold |
| 595 | prebuilts built for 32-bit binder interface.) |
| 596 | arch-{TARGET_ARCH}-{TARGE_ARCH_VARIANT}/ |
| 597 | ... |
| 598 | configs/ |
| 599 | (various *.txt configuration files) |
| 600 | include/ |
| 601 | (header files of same directory structure with source tree) |
| 602 | NOTICE_FILES/ |
| 603 | (notice files of libraries, e.g. libcutils.so.txt) |
| 604 | */ |
Inseob Kim | 1f086e2 | 2019-05-09 13:29:15 +0900 | [diff] [blame] | 605 | |
| 606 | snapshotDir := "vndk-snapshot" |
Inseob Kim | 242ef0c | 2019-10-22 20:15:20 +0900 | [diff] [blame] | 607 | snapshotArchDir := filepath.Join(snapshotDir, ctx.DeviceConfig().DeviceArch()) |
Inseob Kim | 1f086e2 | 2019-05-09 13:29:15 +0900 | [diff] [blame] | 608 | |
Inseob Kim | 242ef0c | 2019-10-22 20:15:20 +0900 | [diff] [blame] | 609 | configsDir := filepath.Join(snapshotArchDir, "configs") |
| 610 | noticeDir := filepath.Join(snapshotArchDir, "NOTICE_FILES") |
| 611 | includeDir := filepath.Join(snapshotArchDir, "include") |
| 612 | |
Inseob Kim | 242ef0c | 2019-10-22 20:15:20 +0900 | [diff] [blame] | 613 | // set of notice files copied. |
Inseob Kim | 1f086e2 | 2019-05-09 13:29:15 +0900 | [diff] [blame] | 614 | noticeBuilt := make(map[string]bool) |
| 615 | |
Inseob Kim | 242ef0c | 2019-10-22 20:15:20 +0900 | [diff] [blame] | 616 | // paths of VNDK modules for GPL license checking |
| 617 | modulePaths := make(map[string]string) |
| 618 | |
| 619 | // actual module names of .so files |
| 620 | // e.g. moduleNames["libprotobuf-cpp-full-3.9.1.so"] = "libprotobuf-cpp-full" |
| 621 | moduleNames := make(map[string]string) |
| 622 | |
Inseob Kim | 8471cda | 2019-11-15 09:59:12 +0900 | [diff] [blame] | 623 | var headers android.Paths |
Inseob Kim | 242ef0c | 2019-10-22 20:15:20 +0900 | [diff] [blame] | 624 | |
Inseob Kim | de5744a | 2020-12-02 13:14:28 +0900 | [diff] [blame^] | 625 | // installVndkSnapshotLib copies built .so file from the module. |
| 626 | // Also, if the build artifacts is on, write a json file which contains all exported flags |
| 627 | // with FlagExporterInfo. |
Colin Cross | 0de8a1e | 2020-09-18 14:15:30 -0700 | [diff] [blame] | 628 | installVndkSnapshotLib := func(m *Module, vndkType string) (android.Paths, bool) { |
Inseob Kim | 242ef0c | 2019-10-22 20:15:20 +0900 | [diff] [blame] | 629 | var ret android.Paths |
| 630 | |
Inseob Kim | 8471cda | 2019-11-15 09:59:12 +0900 | [diff] [blame] | 631 | targetArch := "arch-" + m.Target().Arch.ArchType.String() |
| 632 | if m.Target().Arch.ArchVariant != "" { |
| 633 | targetArch += "-" + m.Target().Arch.ArchVariant |
Inseob Kim | 242ef0c | 2019-10-22 20:15:20 +0900 | [diff] [blame] | 634 | } |
Inseob Kim | ae55303 | 2019-05-14 18:52:49 +0900 | [diff] [blame] | 635 | |
Inseob Kim | 8471cda | 2019-11-15 09:59:12 +0900 | [diff] [blame] | 636 | libPath := m.outputFile.Path() |
| 637 | snapshotLibOut := filepath.Join(snapshotArchDir, targetArch, "shared", vndkType, libPath.Base()) |
Inseob Kim | de5744a | 2020-12-02 13:14:28 +0900 | [diff] [blame^] | 638 | ret = append(ret, copyFileRule(ctx, libPath, snapshotLibOut)) |
Inseob Kim | 8471cda | 2019-11-15 09:59:12 +0900 | [diff] [blame] | 639 | |
Inseob Kim | ae55303 | 2019-05-14 18:52:49 +0900 | [diff] [blame] | 640 | if ctx.Config().VndkSnapshotBuildArtifacts() { |
| 641 | prop := struct { |
| 642 | ExportedDirs []string `json:",omitempty"` |
| 643 | ExportedSystemDirs []string `json:",omitempty"` |
| 644 | ExportedFlags []string `json:",omitempty"` |
| 645 | RelativeInstallPath string `json:",omitempty"` |
| 646 | }{} |
Colin Cross | 0de8a1e | 2020-09-18 14:15:30 -0700 | [diff] [blame] | 647 | exportedInfo := ctx.ModuleProvider(m, FlagExporterInfoProvider).(FlagExporterInfo) |
| 648 | prop.ExportedFlags = exportedInfo.Flags |
| 649 | prop.ExportedDirs = exportedInfo.IncludeDirs.Strings() |
| 650 | prop.ExportedSystemDirs = exportedInfo.SystemIncludeDirs.Strings() |
Inseob Kim | ae55303 | 2019-05-14 18:52:49 +0900 | [diff] [blame] | 651 | prop.RelativeInstallPath = m.RelativeInstallPath() |
| 652 | |
Inseob Kim | 242ef0c | 2019-10-22 20:15:20 +0900 | [diff] [blame] | 653 | propOut := snapshotLibOut + ".json" |
Inseob Kim | ae55303 | 2019-05-14 18:52:49 +0900 | [diff] [blame] | 654 | |
| 655 | j, err := json.Marshal(prop) |
| 656 | if err != nil { |
| 657 | ctx.Errorf("json marshal to %q failed: %#v", propOut, err) |
Inseob Kim | 242ef0c | 2019-10-22 20:15:20 +0900 | [diff] [blame] | 658 | return nil, false |
Inseob Kim | ae55303 | 2019-05-14 18:52:49 +0900 | [diff] [blame] | 659 | } |
Inseob Kim | de5744a | 2020-12-02 13:14:28 +0900 | [diff] [blame^] | 660 | ret = append(ret, writeStringToFileRule(ctx, string(j), propOut)) |
Inseob Kim | ae55303 | 2019-05-14 18:52:49 +0900 | [diff] [blame] | 661 | } |
Inseob Kim | 242ef0c | 2019-10-22 20:15:20 +0900 | [diff] [blame] | 662 | return ret, true |
Inseob Kim | ae55303 | 2019-05-14 18:52:49 +0900 | [diff] [blame] | 663 | } |
| 664 | |
Inseob Kim | 1f086e2 | 2019-05-09 13:29:15 +0900 | [diff] [blame] | 665 | ctx.VisitAllModules(func(module android.Module) { |
| 666 | m, ok := module.(*Module) |
Inseob Kim | ae55303 | 2019-05-14 18:52:49 +0900 | [diff] [blame] | 667 | if !ok || !m.Enabled() { |
Inseob Kim | 1f086e2 | 2019-05-09 13:29:15 +0900 | [diff] [blame] | 668 | return |
| 669 | } |
| 670 | |
Colin Cross | 56a8321 | 2020-09-15 18:30:11 -0700 | [diff] [blame] | 671 | apexInfo := ctx.ModuleProvider(module, android.ApexInfoProvider).(android.ApexInfo) |
| 672 | |
Inseob Kim | de5744a | 2020-12-02 13:14:28 +0900 | [diff] [blame^] | 673 | l, vndkType, ok := isVndkSnapshotAware(ctx.DeviceConfig(), m, apexInfo) |
Inseob Kim | ae55303 | 2019-05-14 18:52:49 +0900 | [diff] [blame] | 674 | if !ok { |
dimitry | 51ea18a | 2019-05-20 10:39:52 +0200 | [diff] [blame] | 675 | return |
| 676 | } |
| 677 | |
Inseob Kim | de5744a | 2020-12-02 13:14:28 +0900 | [diff] [blame^] | 678 | // For all snapshot candidates, the followings are captured. |
| 679 | // - .so files |
| 680 | // - notice files |
| 681 | // |
| 682 | // The followings are also captured if VNDK_SNAPSHOT_BUILD_ARTIFACTS. |
| 683 | // - .json files containing exported flags |
| 684 | // - exported headers from collectHeadersForSnapshot() |
| 685 | // |
| 686 | // Headers are deduplicated after visiting all modules. |
| 687 | |
Inseob Kim | 8471cda | 2019-11-15 09:59:12 +0900 | [diff] [blame] | 688 | // install .so files for appropriate modules. |
| 689 | // Also install .json files if VNDK_SNAPSHOT_BUILD_ARTIFACTS |
Colin Cross | 0de8a1e | 2020-09-18 14:15:30 -0700 | [diff] [blame] | 690 | libs, ok := installVndkSnapshotLib(m, vndkType) |
Inseob Kim | ae55303 | 2019-05-14 18:52:49 +0900 | [diff] [blame] | 691 | if !ok { |
Inseob Kim | 1f086e2 | 2019-05-09 13:29:15 +0900 | [diff] [blame] | 692 | return |
| 693 | } |
Inseob Kim | 242ef0c | 2019-10-22 20:15:20 +0900 | [diff] [blame] | 694 | snapshotOutputs = append(snapshotOutputs, libs...) |
Inseob Kim | 1f086e2 | 2019-05-09 13:29:15 +0900 | [diff] [blame] | 695 | |
Inseob Kim | 8471cda | 2019-11-15 09:59:12 +0900 | [diff] [blame] | 696 | // These are for generating module_names.txt and module_paths.txt |
| 697 | stem := m.outputFile.Path().Base() |
| 698 | moduleNames[stem] = ctx.ModuleName(m) |
| 699 | modulePaths[stem] = ctx.ModuleDir(m) |
| 700 | |
Bob Badour | a75b057 | 2020-02-18 20:21:55 -0800 | [diff] [blame] | 701 | if len(m.NoticeFiles()) > 0 { |
Inseob Kim | 8471cda | 2019-11-15 09:59:12 +0900 | [diff] [blame] | 702 | noticeName := stem + ".txt" |
| 703 | // skip already copied notice file |
| 704 | if _, ok := noticeBuilt[noticeName]; !ok { |
| 705 | noticeBuilt[noticeName] = true |
Inseob Kim | de5744a | 2020-12-02 13:14:28 +0900 | [diff] [blame^] | 706 | snapshotOutputs = append(snapshotOutputs, combineNoticesRule( |
Bob Badour | a75b057 | 2020-02-18 20:21:55 -0800 | [diff] [blame] | 707 | ctx, m.NoticeFiles(), filepath.Join(noticeDir, noticeName))) |
Inseob Kim | 8471cda | 2019-11-15 09:59:12 +0900 | [diff] [blame] | 708 | } |
| 709 | } |
| 710 | |
| 711 | if ctx.Config().VndkSnapshotBuildArtifacts() { |
Inseob Kim | eda2e9c | 2020-03-03 22:06:32 +0900 | [diff] [blame] | 712 | headers = append(headers, l.snapshotHeaders()...) |
Inseob Kim | ae55303 | 2019-05-14 18:52:49 +0900 | [diff] [blame] | 713 | } |
| 714 | }) |
Inseob Kim | 1f086e2 | 2019-05-09 13:29:15 +0900 | [diff] [blame] | 715 | |
Inseob Kim | 8471cda | 2019-11-15 09:59:12 +0900 | [diff] [blame] | 716 | // install all headers after removing duplicates |
| 717 | for _, header := range android.FirstUniquePaths(headers) { |
Inseob Kim | de5744a | 2020-12-02 13:14:28 +0900 | [diff] [blame^] | 718 | snapshotOutputs = append(snapshotOutputs, copyFileRule( |
Inseob Kim | 8471cda | 2019-11-15 09:59:12 +0900 | [diff] [blame] | 719 | ctx, header, filepath.Join(includeDir, header.String()))) |
Inseob Kim | ae55303 | 2019-05-14 18:52:49 +0900 | [diff] [blame] | 720 | } |
| 721 | |
Jooyung Han | 39edb6c | 2019-11-06 16:53:07 +0900 | [diff] [blame] | 722 | // install *.libraries.txt except vndkcorevariant.libraries.txt |
| 723 | ctx.VisitAllModules(func(module android.Module) { |
| 724 | m, ok := module.(*vndkLibrariesTxt) |
| 725 | if !ok || !m.Enabled() || m.Name() == vndkUsingCoreVariantLibrariesTxt { |
| 726 | return |
| 727 | } |
Inseob Kim | de5744a | 2020-12-02 13:14:28 +0900 | [diff] [blame^] | 728 | snapshotOutputs = append(snapshotOutputs, copyFileRule( |
Inseob Kim | 8471cda | 2019-11-15 09:59:12 +0900 | [diff] [blame] | 729 | ctx, m.OutputFile(), filepath.Join(configsDir, m.Name()))) |
Jooyung Han | 39edb6c | 2019-11-06 16:53:07 +0900 | [diff] [blame] | 730 | }) |
Inseob Kim | 1f086e2 | 2019-05-09 13:29:15 +0900 | [diff] [blame] | 731 | |
Inseob Kim | 242ef0c | 2019-10-22 20:15:20 +0900 | [diff] [blame] | 732 | /* |
Inseob Kim | 242ef0c | 2019-10-22 20:15:20 +0900 | [diff] [blame] | 733 | module_paths.txt contains paths on which VNDK modules are defined. |
| 734 | e.g., |
Baligh Uddin | 637df8e | 2020-10-26 14:34:53 +0000 | [diff] [blame] | 735 | libbase.so system/libbase |
Inseob Kim | 242ef0c | 2019-10-22 20:15:20 +0900 | [diff] [blame] | 736 | libc.so bionic/libc |
| 737 | ... |
| 738 | */ |
Inseob Kim | de5744a | 2020-12-02 13:14:28 +0900 | [diff] [blame^] | 739 | snapshotOutputs = append(snapshotOutputs, installMapListFileRule(ctx, modulePaths, filepath.Join(configsDir, "module_paths.txt"))) |
Inseob Kim | 242ef0c | 2019-10-22 20:15:20 +0900 | [diff] [blame] | 740 | |
| 741 | /* |
| 742 | module_names.txt contains names as which VNDK modules are defined, |
| 743 | because output filename and module name can be different with stem and suffix properties. |
| 744 | |
| 745 | e.g., |
| 746 | libcutils.so libcutils |
| 747 | libprotobuf-cpp-full-3.9.2.so libprotobuf-cpp-full |
| 748 | ... |
| 749 | */ |
Inseob Kim | de5744a | 2020-12-02 13:14:28 +0900 | [diff] [blame^] | 750 | snapshotOutputs = append(snapshotOutputs, installMapListFileRule(ctx, moduleNames, filepath.Join(configsDir, "module_names.txt"))) |
Inseob Kim | 242ef0c | 2019-10-22 20:15:20 +0900 | [diff] [blame] | 751 | |
| 752 | // All artifacts are ready. Sort them to normalize ninja and then zip. |
| 753 | sort.Slice(snapshotOutputs, func(i, j int) bool { |
| 754 | return snapshotOutputs[i].String() < snapshotOutputs[j].String() |
| 755 | }) |
| 756 | |
| 757 | zipPath := android.PathForOutput(ctx, snapshotDir, "android-vndk-"+ctx.DeviceConfig().DeviceArch()+".zip") |
Colin Cross | f1a035e | 2020-11-16 17:32:30 -0800 | [diff] [blame] | 758 | zipRule := android.NewRuleBuilder(pctx, ctx) |
Inseob Kim | 242ef0c | 2019-10-22 20:15:20 +0900 | [diff] [blame] | 759 | |
Inseob Kim | de5744a | 2020-12-02 13:14:28 +0900 | [diff] [blame^] | 760 | // filenames in rspfile from FlagWithRspFileInputList might be single-quoted. Remove it with tr |
Inseob Kim | 242ef0c | 2019-10-22 20:15:20 +0900 | [diff] [blame] | 761 | snapshotOutputList := android.PathForOutput(ctx, snapshotDir, "android-vndk-"+ctx.DeviceConfig().DeviceArch()+"_list") |
| 762 | zipRule.Command(). |
Inseob Kim | 8471cda | 2019-11-15 09:59:12 +0900 | [diff] [blame] | 763 | Text("tr"). |
| 764 | FlagWithArg("-d ", "\\'"). |
| 765 | FlagWithRspFileInputList("< ", snapshotOutputs). |
| 766 | FlagWithOutput("> ", snapshotOutputList) |
Inseob Kim | 242ef0c | 2019-10-22 20:15:20 +0900 | [diff] [blame] | 767 | |
| 768 | zipRule.Temporary(snapshotOutputList) |
| 769 | |
| 770 | zipRule.Command(). |
Colin Cross | f1a035e | 2020-11-16 17:32:30 -0800 | [diff] [blame] | 771 | BuiltTool("soong_zip"). |
Inseob Kim | 242ef0c | 2019-10-22 20:15:20 +0900 | [diff] [blame] | 772 | FlagWithOutput("-o ", zipPath). |
| 773 | FlagWithArg("-C ", android.PathForOutput(ctx, snapshotDir).String()). |
| 774 | FlagWithInput("-l ", snapshotOutputList) |
| 775 | |
Colin Cross | f1a035e | 2020-11-16 17:32:30 -0800 | [diff] [blame] | 776 | zipRule.Build(zipPath.String(), "vndk snapshot "+zipPath.String()) |
Inseob Kim | 8471cda | 2019-11-15 09:59:12 +0900 | [diff] [blame] | 777 | zipRule.DeleteTemporaryFiles() |
Inseob Kim | 242ef0c | 2019-10-22 20:15:20 +0900 | [diff] [blame] | 778 | c.vndkSnapshotZipFile = android.OptionalPathForPath(zipPath) |
Inseob Kim | 1f086e2 | 2019-05-09 13:29:15 +0900 | [diff] [blame] | 779 | } |
Jooyung Han | 097087b | 2019-10-22 19:32:18 +0900 | [diff] [blame] | 780 | |
Jooyung Han | 0302a84 | 2019-10-30 18:43:49 +0900 | [diff] [blame] | 781 | func getVndkFileName(m *Module) (string, error) { |
| 782 | if library, ok := m.linker.(*libraryDecorator); ok { |
| 783 | return library.getLibNameHelper(m.BaseModuleName(), true) + ".so", nil |
| 784 | } |
| 785 | if prebuilt, ok := m.linker.(*prebuiltLibraryLinker); ok { |
| 786 | return prebuilt.libraryDecorator.getLibNameHelper(m.BaseModuleName(), true) + ".so", nil |
| 787 | } |
| 788 | return "", fmt.Errorf("VNDK library should have libraryDecorator or prebuiltLibraryLinker as linker: %T", m.linker) |
Jooyung Han | 097087b | 2019-10-22 19:32:18 +0900 | [diff] [blame] | 789 | } |
| 790 | |
| 791 | func (c *vndkSnapshotSingleton) buildVndkLibrariesTxtFiles(ctx android.SingletonContext) { |
Jooyung Han | 39edb6c | 2019-11-06 16:53:07 +0900 | [diff] [blame] | 792 | llndk := android.SortedStringMapValues(llndkLibraries(ctx.Config())) |
Jooyung Han | 0302a84 | 2019-10-30 18:43:49 +0900 | [diff] [blame] | 793 | vndkcore := android.SortedStringMapValues(vndkCoreLibraries(ctx.Config())) |
| 794 | vndksp := android.SortedStringMapValues(vndkSpLibraries(ctx.Config())) |
| 795 | vndkprivate := android.SortedStringMapValues(vndkPrivateLibraries(ctx.Config())) |
Jooyung Han | 0302a84 | 2019-10-30 18:43:49 +0900 | [diff] [blame] | 796 | |
Jooyung Han | 2216fb1 | 2019-11-06 16:46:15 +0900 | [diff] [blame] | 797 | // Build list of vndk libs as merged & tagged & filter-out(libclang_rt): |
Jooyung Han | 0302a84 | 2019-10-30 18:43:49 +0900 | [diff] [blame] | 798 | // Since each target have different set of libclang_rt.* files, |
| 799 | // keep the common set of files in vndk.libraries.txt |
| 800 | var merged []string |
Jooyung Han | 097087b | 2019-10-22 19:32:18 +0900 | [diff] [blame] | 801 | filterOutLibClangRt := func(libList []string) (filtered []string) { |
| 802 | for _, lib := range libList { |
| 803 | if !strings.HasPrefix(lib, "libclang_rt.") { |
| 804 | filtered = append(filtered, lib) |
| 805 | } |
| 806 | } |
| 807 | return |
| 808 | } |
| 809 | merged = append(merged, addPrefix(filterOutLibClangRt(llndk), "LLNDK: ")...) |
| 810 | merged = append(merged, addPrefix(vndksp, "VNDK-SP: ")...) |
| 811 | merged = append(merged, addPrefix(filterOutLibClangRt(vndkcore), "VNDK-core: ")...) |
| 812 | merged = append(merged, addPrefix(vndkprivate, "VNDK-private: ")...) |
Jooyung Han | 39edb6c | 2019-11-06 16:53:07 +0900 | [diff] [blame] | 813 | c.vndkLibrariesFile = android.PathForOutput(ctx, "vndk", "vndk.libraries.txt") |
Colin Cross | cf371cc | 2020-11-13 11:48:42 -0800 | [diff] [blame] | 814 | android.WriteFileRule(ctx, c.vndkLibrariesFile, strings.Join(merged, "\n")) |
Jooyung Han | 0302a84 | 2019-10-30 18:43:49 +0900 | [diff] [blame] | 815 | } |
Jooyung Han | 097087b | 2019-10-22 19:32:18 +0900 | [diff] [blame] | 816 | |
Jooyung Han | 0302a84 | 2019-10-30 18:43:49 +0900 | [diff] [blame] | 817 | func (c *vndkSnapshotSingleton) MakeVars(ctx android.MakeVarsContext) { |
| 818 | // Make uses LLNDK_MOVED_TO_APEX_LIBRARIES to avoid installing libraries on /system if |
| 819 | // they been moved to an apex. |
Colin Cross | 56a8321 | 2020-09-15 18:30:11 -0700 | [diff] [blame] | 820 | movedToApexLlndkLibraries := make(map[string]bool) |
| 821 | ctx.VisitAllModules(func(module android.Module) { |
| 822 | if m, ok := module.(*Module); ok { |
| 823 | if llndk, ok := m.linker.(*llndkStubDecorator); ok { |
| 824 | // Skip bionic libs, they are handled in different manner |
Colin Cross | 0477b42 | 2020-10-13 18:43:54 -0700 | [diff] [blame] | 825 | name := llndk.implementationModuleName(m.BaseModuleName()) |
| 826 | if llndk.movedToApex && !isBionic(name) { |
Colin Cross | 56a8321 | 2020-09-15 18:30:11 -0700 | [diff] [blame] | 827 | movedToApexLlndkLibraries[name] = true |
| 828 | } |
| 829 | } |
Jooyung Han | 0302a84 | 2019-10-30 18:43:49 +0900 | [diff] [blame] | 830 | } |
Colin Cross | 56a8321 | 2020-09-15 18:30:11 -0700 | [diff] [blame] | 831 | }) |
| 832 | |
| 833 | ctx.Strict("LLNDK_MOVED_TO_APEX_LIBRARIES", |
| 834 | strings.Join(android.SortedStringKeys(movedToApexLlndkLibraries), " ")) |
Jooyung Han | 39edb6c | 2019-11-06 16:53:07 +0900 | [diff] [blame] | 835 | |
| 836 | // Make uses LLNDK_LIBRARIES to determine which libraries to install. |
| 837 | // HWASAN is only part of the LL-NDK in builds in which libc depends on HWASAN. |
| 838 | // Therefore, by removing the library here, we cause it to only be installed if libc |
| 839 | // depends on it. |
| 840 | installedLlndkLibraries := []string{} |
| 841 | for lib := range llndkLibraries(ctx.Config()) { |
| 842 | if strings.HasPrefix(lib, "libclang_rt.hwasan-") { |
| 843 | continue |
| 844 | } |
| 845 | installedLlndkLibraries = append(installedLlndkLibraries, lib) |
| 846 | } |
| 847 | sort.Strings(installedLlndkLibraries) |
| 848 | ctx.Strict("LLNDK_LIBRARIES", strings.Join(installedLlndkLibraries, " ")) |
| 849 | |
Jooyung Han | 0302a84 | 2019-10-30 18:43:49 +0900 | [diff] [blame] | 850 | ctx.Strict("VNDK_CORE_LIBRARIES", strings.Join(android.SortedStringKeys(vndkCoreLibraries(ctx.Config())), " ")) |
| 851 | ctx.Strict("VNDK_SAMEPROCESS_LIBRARIES", strings.Join(android.SortedStringKeys(vndkSpLibraries(ctx.Config())), " ")) |
| 852 | ctx.Strict("VNDK_PRIVATE_LIBRARIES", strings.Join(android.SortedStringKeys(vndkPrivateLibraries(ctx.Config())), " ")) |
| 853 | ctx.Strict("VNDK_USING_CORE_VARIANT_LIBRARIES", strings.Join(android.SortedStringKeys(vndkUsingCoreVariantLibraries(ctx.Config())), " ")) |
| 854 | |
Jooyung Han | 0302a84 | 2019-10-30 18:43:49 +0900 | [diff] [blame] | 855 | ctx.Strict("VNDK_LIBRARIES_FILE", c.vndkLibrariesFile.String()) |
Inseob Kim | 242ef0c | 2019-10-22 20:15:20 +0900 | [diff] [blame] | 856 | ctx.Strict("SOONG_VNDK_SNAPSHOT_ZIP", c.vndkSnapshotZipFile.String()) |
Jooyung Han | 097087b | 2019-10-22 19:32:18 +0900 | [diff] [blame] | 857 | } |