blob: 69cf4ac3813e69299fb71e9853eeb571e60ee1c5 [file] [log] [blame]
Colin Cross4d9c2d12016-07-29 12:48:20 -07001// Copyright 2016 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
15package cc
16
17import (
Jiyong Parkf1194352019-02-25 11:05:47 +090018 "path/filepath"
19
Chris Parsonsf874e462022-05-10 13:50:12 -040020 "android/soong/bazel/cquery"
Jingwen Chen537242c2022-08-24 11:53:27 +000021
Dan Willemsena0790e32018-10-12 00:24:23 -070022 "github.com/google/blueprint"
Liz Kammer12615db2021-09-28 09:19:17 -040023 "github.com/google/blueprint/proptools"
Dan Willemsena0790e32018-10-12 00:24:23 -070024
Colin Cross4d9c2d12016-07-29 12:48:20 -070025 "android/soong/android"
Liz Kammer2b8004b2021-10-04 13:55:44 -040026 "android/soong/bazel"
Colin Cross4d9c2d12016-07-29 12:48:20 -070027)
28
29type BinaryLinkerProperties struct {
30 // compile executable with -static
31 Static_executable *bool `android:"arch_variant"`
32
33 // set the name of the output
Nan Zhang0007d812017-11-07 10:57:05 -080034 Stem *string `android:"arch_variant"`
Colin Cross4d9c2d12016-07-29 12:48:20 -070035
36 // append to the name of the output
Nan Zhang0007d812017-11-07 10:57:05 -080037 Suffix *string `android:"arch_variant"`
Colin Cross4d9c2d12016-07-29 12:48:20 -070038
39 // if set, add an extra objcopy --prefix-symbols= step
Nan Zhang0007d812017-11-07 10:57:05 -080040 Prefix_symbols *string
Colin Cross1e7d3702016-08-24 15:25:47 -070041
42 // if set, install a symlink to the preferred architecture
Roland Levillaind9bf9be2019-06-05 19:20:33 +010043 Symlink_preferred_arch *bool `android:"arch_variant"`
Colin Cross522e3732016-09-07 13:14:06 -070044
Colin Cross9b09f242016-12-07 13:37:42 -080045 // install symlinks to the binary. Symlink names will have the suffix and the binary
46 // extension (if any) appended
47 Symlinks []string `android:"arch_variant"`
48
Chris Parsonse0f2ab32020-11-20 17:27:25 -050049 // override the dynamic linker
Colin Cross522e3732016-09-07 13:14:06 -070050 DynamicLinker string `blueprint:"mutated"`
Yifan Hong946e32e2018-04-03 13:22:50 -070051
52 // Names of modules to be overridden. Listed modules can only be other binaries
53 // (in Make or Soong).
54 // This does not completely prevent installation of the overridden binaries, but if both
55 // binaries would be installed by default (in PRODUCT_PACKAGES) the other binary will be removed
56 // from PRODUCT_PACKAGES.
57 Overrides []string
Colin Crossd7227f92019-09-05 14:26:33 -070058
59 // Inject boringssl hash into the shared library. This is only intended for use by external/boringssl.
60 Inject_bssl_hash *bool `android:"arch_variant"`
Colin Cross4d9c2d12016-07-29 12:48:20 -070061}
62
63func init() {
Paul Duffin2ee69792020-01-16 12:14:42 +000064 RegisterBinaryBuildComponents(android.InitRegistrationContext)
65}
66
67func RegisterBinaryBuildComponents(ctx android.RegistrationContext) {
68 ctx.RegisterModuleType("cc_binary", BinaryFactory)
Liz Kammer2b8004b2021-10-04 13:55:44 -040069 ctx.RegisterModuleType("cc_binary_host", BinaryHostFactory)
Colin Cross4d9c2d12016-07-29 12:48:20 -070070}
71
Patrice Arrudac249c712019-03-19 17:00:29 -070072// cc_binary produces a binary that is runnable on a device.
Jiyong Park16e91a02018-12-20 18:18:08 +090073func BinaryFactory() android.Module {
Liz Kammerbe46fcc2021-11-01 15:32:43 -040074 module, _ := newBinary(android.HostAndDeviceSupported, true)
Yu Liu7f3605f2022-02-08 14:15:12 -080075 module.bazelHandler = &ccBinaryBazelHandler{module: module}
Colin Cross4d9c2d12016-07-29 12:48:20 -070076 return module.Init()
77}
78
Patrice Arrudac249c712019-03-19 17:00:29 -070079// cc_binary_host produces a binary that is runnable on a host.
Liz Kammer2b8004b2021-10-04 13:55:44 -040080func BinaryHostFactory() android.Module {
Liz Kammerbe46fcc2021-11-01 15:32:43 -040081 module, _ := newBinary(android.HostSupported, true)
Colin Cross4d9c2d12016-07-29 12:48:20 -070082 return module.Init()
83}
84
85//
86// Executables
87//
88
Chris Parsonse0f2ab32020-11-20 17:27:25 -050089// binaryDecorator is a decorator containing information for C++ binary modules.
Colin Crossb916a382016-07-29 17:28:03 -070090type binaryDecorator struct {
91 *baseLinker
Colin Cross1e7d3702016-08-24 15:25:47 -070092 *baseInstaller
ThiƩbaud Weksteend4587452020-08-19 14:53:01 +020093 stripper Stripper
Colin Cross4d9c2d12016-07-29 12:48:20 -070094
95 Properties BinaryLinkerProperties
96
Dan Willemsen4aa75ca2016-09-28 16:18:03 -070097 toolPath android.OptionalPath
Colin Cross9b09f242016-12-07 13:37:42 -080098
Colin Crossb60190a2018-09-04 16:28:17 -070099 // Location of the linked, unstripped binary
100 unstrippedOutputFile android.Path
101
Colin Cross9b09f242016-12-07 13:37:42 -0800102 // Names of symlinks to be installed for use in LOCAL_MODULE_SYMLINKS
103 symlinks []string
Dan Willemsen581341d2017-02-09 16:16:31 -0800104
Colin Crossa6159012020-11-12 12:14:36 -0800105 // If the module has symlink_preferred_arch set, the name of the symlink to the
106 // binary for the preferred arch.
107 preferredArchSymlink string
108
Dan Willemsen581341d2017-02-09 16:16:31 -0800109 // Output archive of gcno coverage information
110 coverageOutputFile android.OptionalPath
Dan Willemsen569edc52018-11-19 09:33:29 -0800111
Jingwen Chen40fd90a2020-06-15 05:24:19 +0000112 // Location of the files that should be copied to dist dir when requested
113 distFiles android.TaggedDistFiles
Jiyong Parkf1194352019-02-25 11:05:47 +0900114
Chris Parsonse0f2ab32020-11-20 17:27:25 -0500115 // Action command lines to run directly after the binary is installed. For example,
116 // may be used to symlink runtime dependencies (such as bionic) alongside installation.
Jaewoong Jung18aefc12020-12-21 09:11:10 -0800117 postInstallCmds []string
Colin Cross4d9c2d12016-07-29 12:48:20 -0700118}
119
Colin Crossb916a382016-07-29 17:28:03 -0700120var _ linker = (*binaryDecorator)(nil)
Colin Cross4d9c2d12016-07-29 12:48:20 -0700121
Chris Parsonse0f2ab32020-11-20 17:27:25 -0500122// linkerProps returns the list of individual properties objects relevant
123// for this binary.
Colin Crossb916a382016-07-29 17:28:03 -0700124func (binary *binaryDecorator) linkerProps() []interface{} {
Colin Cross42742b82016-08-01 13:20:05 -0700125 return append(binary.baseLinker.linkerProps(),
Colin Cross4d9c2d12016-07-29 12:48:20 -0700126 &binary.Properties,
127 &binary.stripper.StripProperties)
128
129}
130
Chris Parsonse0f2ab32020-11-20 17:27:25 -0500131// getStemWithoutSuffix returns the main section of the name to use for the symlink of
132// the main output file of this binary module. This may be derived from the module name
133// or other property overrides.
134// For the full symlink name, the `Suffix` property of a binary module must be appended.
Roland Levillain9efb8c72019-06-05 13:31:31 +0100135func (binary *binaryDecorator) getStemWithoutSuffix(ctx BaseModuleContext) string {
Colin Crossce75d2c2016-10-06 16:12:58 -0700136 stem := ctx.baseModuleName()
Nan Zhang0007d812017-11-07 10:57:05 -0800137 if String(binary.Properties.Stem) != "" {
138 stem = String(binary.Properties.Stem)
Colin Cross4d9c2d12016-07-29 12:48:20 -0700139 }
140
Roland Levillain9efb8c72019-06-05 13:31:31 +0100141 return stem
142}
143
Chris Parsonse0f2ab32020-11-20 17:27:25 -0500144// getStem returns the full name to use for the symlink of the main output file of this binary
145// module. This may be derived from the module name and/or other property overrides.
Roland Levillain9efb8c72019-06-05 13:31:31 +0100146func (binary *binaryDecorator) getStem(ctx BaseModuleContext) string {
147 return binary.getStemWithoutSuffix(ctx) + String(binary.Properties.Suffix)
Colin Cross4d9c2d12016-07-29 12:48:20 -0700148}
149
Chris Parsonse0f2ab32020-11-20 17:27:25 -0500150// linkerDeps augments and returns the given `deps` to contain dependencies on
151// modules common to most binaries, such as bionic libraries.
Colin Cross37047f12016-12-13 17:06:13 -0800152func (binary *binaryDecorator) linkerDeps(ctx DepsContext, deps Deps) Deps {
Colin Cross42742b82016-08-01 13:20:05 -0700153 deps = binary.baseLinker.linkerDeps(ctx, deps)
Colin Crossd1a28132021-06-21 17:34:47 -0700154 if !Bool(binary.baseLinker.Properties.Nocrt) {
155 if binary.static() {
156 deps.CrtBegin = ctx.toolchain().CrtBeginStaticBinary()
157 deps.CrtEnd = ctx.toolchain().CrtEndStaticBinary()
158 } else {
159 deps.CrtBegin = ctx.toolchain().CrtBeginSharedBinary()
160 deps.CrtEnd = ctx.toolchain().CrtEndSharedBinary()
Colin Cross4d9c2d12016-07-29 12:48:20 -0700161 }
Colin Crossd1a28132021-06-21 17:34:47 -0700162 }
Colin Cross4d9c2d12016-07-29 12:48:20 -0700163
Colin Cross450744e2021-08-18 13:52:09 -0700164 if binary.static() {
165 deps.StaticLibs = append(deps.StaticLibs, deps.SystemSharedLibs...)
166 }
167
Colin Crossd1a28132021-06-21 17:34:47 -0700168 if ctx.toolchain().Bionic() {
Colin Crossb916a382016-07-29 17:28:03 -0700169 if binary.static() {
Dan Albertdc2597d2017-01-26 17:44:26 -0800170 if ctx.selectedStl() == "libc++_static" {
Ryan Prichardb49fe1b2019-10-11 15:03:34 -0700171 deps.StaticLibs = append(deps.StaticLibs, "libm", "libc")
Colin Cross4d9c2d12016-07-29 12:48:20 -0700172 }
173 // static libraries libcompiler_rt, libc and libc_nomalloc need to be linked with
174 // --start-group/--end-group along with libgcc. If they are in deps.StaticLibs,
175 // move them to the beginning of deps.LateStaticLibs
176 var groupLibs []string
177 deps.StaticLibs, groupLibs = filterList(deps.StaticLibs,
178 []string{"libc", "libc_nomalloc", "libcompiler_rt"})
179 deps.LateStaticLibs = append(groupLibs, deps.LateStaticLibs...)
180 }
Dan Willemsenc77a0b32017-09-18 23:19:12 -0700181
182 if ctx.Os() == android.LinuxBionic && !binary.static() {
Dan Willemsena0790e32018-10-12 00:24:23 -0700183 deps.DynamicLinker = "linker"
Dan Willemsenc77a0b32017-09-18 23:19:12 -0700184 }
Colin Cross4d9c2d12016-07-29 12:48:20 -0700185 }
186
Liz Kammer3bf97bd2022-04-26 09:38:20 -0400187 if !binary.static() && inList("libc", deps.StaticLibs) {
Colin Cross4d9c2d12016-07-29 12:48:20 -0700188 ctx.ModuleErrorf("statically linking libc to dynamic executable, please remove libc\n" +
189 "from static libs or set static_executable: true")
190 }
Colin Cross2383f3b2018-02-06 14:40:13 -0800191
Colin Cross4d9c2d12016-07-29 12:48:20 -0700192 return deps
193}
194
Chris Parsonse0f2ab32020-11-20 17:27:25 -0500195// NewBinary builds and returns a new Module corresponding to a C++ binary.
196// Individual module implementations which comprise a C++ binary should call this function,
197// set some fields on the result, and then call the Init function.
Colin Crossb916a382016-07-29 17:28:03 -0700198func NewBinary(hod android.HostOrDeviceSupported) (*Module, *binaryDecorator) {
Liz Kammerbe46fcc2021-11-01 15:32:43 -0400199 return newBinary(hod, true)
200}
201
202func newBinary(hod android.HostOrDeviceSupported, bazelable bool) (*Module, *binaryDecorator) {
Colin Cross4d9c2d12016-07-29 12:48:20 -0700203 module := newModule(hod, android.MultilibFirst)
Colin Crossb916a382016-07-29 17:28:03 -0700204 binary := &binaryDecorator{
Dan Albert61f32122018-07-26 14:00:24 -0700205 baseLinker: NewBaseLinker(module.sanitize),
Colin Cross1e7d3702016-08-24 15:25:47 -0700206 baseInstaller: NewBaseInstaller("bin", "", InstallInSystem),
Colin Cross4d9c2d12016-07-29 12:48:20 -0700207 }
Colin Crossb916a382016-07-29 17:28:03 -0700208 module.compiler = NewBaseCompiler()
209 module.linker = binary
Colin Cross1e7d3702016-08-24 15:25:47 -0700210 module.installer = binary
Liz Kammerbe46fcc2021-11-01 15:32:43 -0400211 module.bazelable = bazelable
Paul Duffin25ce04b2020-01-16 11:47:25 +0000212
213 // Allow module to be added as member of an sdk/module_exports.
214 module.sdkMemberTypes = []android.SdkMemberType{
215 ccBinarySdkMemberType,
216 }
Colin Crossb916a382016-07-29 17:28:03 -0700217 return module, binary
Colin Cross4d9c2d12016-07-29 12:48:20 -0700218}
219
Chris Parsonse0f2ab32020-11-20 17:27:25 -0500220// linkerInit initializes dynamic properties of the linker (such as runpath) based
221// on properties of this binary.
Colin Crossb916a382016-07-29 17:28:03 -0700222func (binary *binaryDecorator) linkerInit(ctx BaseModuleContext) {
Colin Cross42742b82016-08-01 13:20:05 -0700223 binary.baseLinker.linkerInit(ctx)
Colin Cross4d9c2d12016-07-29 12:48:20 -0700224
Colin Cross7e2092a2022-03-08 13:15:58 -0800225 if ctx.Os().Linux() && ctx.Host() {
226 // Unless explicitly specified otherwise, host static binaries are built with -static
227 // if HostStaticBinaries is true for the product configuration.
228 if binary.Properties.Static_executable == nil && ctx.Config().HostStaticBinaries() {
229 binary.Properties.Static_executable = BoolPtr(true)
Colin Cross4d9c2d12016-07-29 12:48:20 -0700230 }
231 }
Colin Cross7e2092a2022-03-08 13:15:58 -0800232
233 if ctx.Darwin() || ctx.Windows() {
234 // Static executables are not supported on Darwin or Windows
235 binary.Properties.Static_executable = nil
236 }
Colin Cross4d9c2d12016-07-29 12:48:20 -0700237}
238
Colin Crossb916a382016-07-29 17:28:03 -0700239func (binary *binaryDecorator) static() bool {
240 return Bool(binary.Properties.Static_executable)
241}
242
243func (binary *binaryDecorator) staticBinary() bool {
244 return binary.static()
245}
246
Inseob Kim7f283f42020-06-01 21:53:49 +0900247func (binary *binaryDecorator) binary() bool {
248 return true
249}
250
Chris Parsonse0f2ab32020-11-20 17:27:25 -0500251// linkerFlags returns a Flags object containing linker flags that are defined
252// by this binary, or that are implied by attributes of this binary. These flags are
253// combined with the given flags.
Colin Crossb916a382016-07-29 17:28:03 -0700254func (binary *binaryDecorator) linkerFlags(ctx ModuleContext, flags Flags) Flags {
Colin Cross42742b82016-08-01 13:20:05 -0700255 flags = binary.baseLinker.linkerFlags(ctx, flags)
Colin Cross4d9c2d12016-07-29 12:48:20 -0700256
Chris Parsonse0f2ab32020-11-20 17:27:25 -0500257 // Passing -pie to clang for Windows binaries causes a warning that -pie is unused.
Colin Cross446c6662018-09-14 16:00:16 -0700258 if ctx.Host() && !ctx.Windows() && !binary.static() {
Colin Cross6510f912017-11-29 00:27:14 -0800259 if !ctx.Config().IsEnvTrue("DISABLE_HOST_PIE") {
Colin Cross4af21ed2019-11-04 09:37:55 -0800260 flags.Global.LdFlags = append(flags.Global.LdFlags, "-pie")
Colin Cross4d9c2d12016-07-29 12:48:20 -0700261 }
262 }
263
264 // MinGW spits out warnings about -fPIC even for -fpie?!) being ignored because
265 // all code is position independent, and then those warnings get promoted to
266 // errors.
Colin Cross3edeee12017-04-04 12:59:48 -0700267 if !ctx.Windows() {
Colin Cross4af21ed2019-11-04 09:37:55 -0800268 flags.Global.CFlags = append(flags.Global.CFlags, "-fPIE")
Colin Cross4d9c2d12016-07-29 12:48:20 -0700269 }
270
Dan Willemsen2e47b342016-11-17 01:02:25 -0800271 if ctx.toolchain().Bionic() {
Colin Crossb916a382016-07-29 17:28:03 -0700272 if binary.static() {
Colin Cross4d9c2d12016-07-29 12:48:20 -0700273 // Clang driver needs -static to create static executable.
274 // However, bionic/linker uses -shared to overwrite.
275 // Linker for x86 targets does not allow coexistance of -static and -shared,
276 // so we add -static only if -shared is not used.
Colin Cross4af21ed2019-11-04 09:37:55 -0800277 if !inList("-shared", flags.Local.LdFlags) {
278 flags.Global.LdFlags = append(flags.Global.LdFlags, "-static")
Colin Cross4d9c2d12016-07-29 12:48:20 -0700279 }
280
Colin Cross4af21ed2019-11-04 09:37:55 -0800281 flags.Global.LdFlags = append(flags.Global.LdFlags,
Colin Cross4d9c2d12016-07-29 12:48:20 -0700282 "-nostdlib",
283 "-Bstatic",
284 "-Wl,--gc-sections",
285 )
Chris Parsonse0f2ab32020-11-20 17:27:25 -0500286 } else { // not static
Colin Cross4d9c2d12016-07-29 12:48:20 -0700287 if flags.DynamicLinker == "" {
Colin Cross522e3732016-09-07 13:14:06 -0700288 if binary.Properties.DynamicLinker != "" {
289 flags.DynamicLinker = binary.Properties.DynamicLinker
290 } else {
Dan Willemsen01a405a2016-06-13 17:19:03 -0700291 switch ctx.Os() {
292 case android.Android:
Yifan Hong60e0cfb2020-10-21 15:17:56 -0700293 if ctx.bootstrap() && !ctx.inRecovery() && !ctx.inRamdisk() && !ctx.inVendorRamdisk() {
Jiyong Parka4b9dd02019-01-16 22:53:13 +0900294 flags.DynamicLinker = "/system/bin/bootstrap/linker"
295 } else {
296 flags.DynamicLinker = "/system/bin/linker"
297 }
Dan Willemsena0790e32018-10-12 00:24:23 -0700298 if flags.Toolchain.Is64Bit() {
299 flags.DynamicLinker += "64"
300 }
Dan Willemsen01a405a2016-06-13 17:19:03 -0700301 case android.LinuxBionic:
Dan Willemsenc77a0b32017-09-18 23:19:12 -0700302 flags.DynamicLinker = ""
Dan Willemsen01a405a2016-06-13 17:19:03 -0700303 default:
304 ctx.ModuleErrorf("unknown dynamic linker")
305 }
Dan Willemsena0790e32018-10-12 00:24:23 -0700306 }
307
308 if ctx.Os() == android.LinuxBionic {
309 // Use the dlwrap entry point, but keep _start around so
310 // that it can be used by host_bionic_inject
Colin Cross4af21ed2019-11-04 09:37:55 -0800311 flags.Global.LdFlags = append(flags.Global.LdFlags,
Dan Willemsena0790e32018-10-12 00:24:23 -0700312 "-Wl,--entry=__dlwrap__start",
313 "-Wl,--undefined=_start",
314 )
Colin Cross4d9c2d12016-07-29 12:48:20 -0700315 }
316 }
317
Colin Cross4af21ed2019-11-04 09:37:55 -0800318 flags.Global.LdFlags = append(flags.Global.LdFlags,
Colin Cross4d9c2d12016-07-29 12:48:20 -0700319 "-pie",
320 "-nostdlib",
321 "-Bdynamic",
322 "-Wl,--gc-sections",
323 "-Wl,-z,nocopyreloc",
324 )
325 }
Chris Parsonse0f2ab32020-11-20 17:27:25 -0500326 } else { // not bionic
Colin Crossb916a382016-07-29 17:28:03 -0700327 if binary.static() {
Colin Cross4af21ed2019-11-04 09:37:55 -0800328 flags.Global.LdFlags = append(flags.Global.LdFlags, "-static")
Colin Cross4d9c2d12016-07-29 12:48:20 -0700329 }
330 if ctx.Darwin() {
Colin Cross4af21ed2019-11-04 09:37:55 -0800331 flags.Global.LdFlags = append(flags.Global.LdFlags, "-Wl,-headerpad_max_install_names")
Colin Cross4d9c2d12016-07-29 12:48:20 -0700332 }
333 }
334
335 return flags
336}
337
Chris Parsonse0f2ab32020-11-20 17:27:25 -0500338// link registers actions to link this binary, and sets various fields
339// on this binary to reflect information that should be exported up the build
340// tree (for example, exported flags and include paths).
Colin Crossb916a382016-07-29 17:28:03 -0700341func (binary *binaryDecorator) link(ctx ModuleContext,
Dan Willemsen5cb580f2016-09-26 17:33:01 -0700342 flags Flags, deps PathDeps, objs Objects) android.Path {
Colin Cross4d9c2d12016-07-29 12:48:20 -0700343
344 fileName := binary.getStem(ctx) + flags.Toolchain.ExecutableSuffix()
345 outputFile := android.PathForModuleOut(ctx, fileName)
346 ret := outputFile
Colin Cross4d9c2d12016-07-29 12:48:20 -0700347
348 var linkerDeps android.Paths
349
Colin Cross4d9c2d12016-07-29 12:48:20 -0700350 if flags.DynamicLinker != "" {
Colin Cross4af21ed2019-11-04 09:37:55 -0800351 flags.Local.LdFlags = append(flags.Local.LdFlags, "-Wl,-dynamic-linker,"+flags.DynamicLinker)
Colin Cross528d67e2021-07-23 22:23:07 +0000352 } else if (ctx.toolchain().Bionic() || ctx.toolchain().Musl()) && !binary.static() {
Colin Cross4af21ed2019-11-04 09:37:55 -0800353 flags.Local.LdFlags = append(flags.Local.LdFlags, "-Wl,--no-dynamic-linker")
Colin Cross4d9c2d12016-07-29 12:48:20 -0700354 }
355
Dan Willemsen47450072021-10-19 20:24:49 -0700356 if ctx.Darwin() && deps.DarwinSecondArchOutput.Valid() {
357 fatOutputFile := outputFile
358 outputFile = android.PathForModuleOut(ctx, "pre-fat", fileName)
359 transformDarwinUniversalBinary(ctx, fatOutputFile, outputFile, deps.DarwinSecondArchOutput.Path())
360 }
361
Colin Cross4d9c2d12016-07-29 12:48:20 -0700362 builderFlags := flagsToBuilderFlags(flags)
ThiƩbaud Weksteend4587452020-08-19 14:53:01 +0200363 stripFlags := flagsToStripFlags(flags)
364 if binary.stripper.NeedsStrip(ctx) {
Yi Kongb5c34d72018-11-07 16:28:49 -0800365 if ctx.Darwin() {
ThiƩbaud Weksteend4587452020-08-19 14:53:01 +0200366 stripFlags.StripUseGnuStrip = true
Yi Kongb5c34d72018-11-07 16:28:49 -0800367 }
Colin Cross4d9c2d12016-07-29 12:48:20 -0700368 strippedOutputFile := outputFile
369 outputFile = android.PathForModuleOut(ctx, "unstripped", fileName)
ThiƩbaud Weksteend4587452020-08-19 14:53:01 +0200370 binary.stripper.StripExecutableOrSharedLib(ctx, outputFile, strippedOutputFile, stripFlags)
Colin Cross4d9c2d12016-07-29 12:48:20 -0700371 }
372
Colin Crossb60190a2018-09-04 16:28:17 -0700373 binary.unstrippedOutputFile = outputFile
374
Nan Zhang0007d812017-11-07 10:57:05 -0800375 if String(binary.Properties.Prefix_symbols) != "" {
Colin Cross4d9c2d12016-07-29 12:48:20 -0700376 afterPrefixSymbols := outputFile
377 outputFile = android.PathForModuleOut(ctx, "unprefixed", fileName)
Chris Parsonsbf4f55f2020-11-23 17:02:44 -0500378 transformBinaryPrefixSymbols(ctx, String(binary.Properties.Prefix_symbols), outputFile,
ThiƩbaud Weksteend4587452020-08-19 14:53:01 +0200379 builderFlags, afterPrefixSymbols)
Colin Cross4d9c2d12016-07-29 12:48:20 -0700380 }
381
Colin Crossd7227f92019-09-05 14:26:33 -0700382 outputFile = maybeInjectBoringSSLHash(ctx, outputFile, binary.Properties.Inject_bssl_hash, fileName)
383
Chris Parsonse0f2ab32020-11-20 17:27:25 -0500384 // If use_version_lib is true, make an android::build::GetBuildNumber() function available.
Dan Willemsen569edc52018-11-19 09:33:29 -0800385 if Bool(binary.baseLinker.Properties.Use_version_lib) {
386 if ctx.Host() {
387 versionedOutputFile := outputFile
388 outputFile = android.PathForModuleOut(ctx, "unversioned", fileName)
389 binary.injectVersionSymbol(ctx, outputFile, versionedOutputFile)
390 } else {
Chris Parsonse0f2ab32020-11-20 17:27:25 -0500391 // When dist'ing a library or binary that has use_version_lib set, always
392 // distribute the stamped version, even for the device.
Dan Willemsen569edc52018-11-19 09:33:29 -0800393 versionedOutputFile := android.PathForModuleOut(ctx, "versioned", fileName)
Jingwen Chen40fd90a2020-06-15 05:24:19 +0000394 binary.distFiles = android.MakeDefaultDistFiles(versionedOutputFile)
Dan Willemsen569edc52018-11-19 09:33:29 -0800395
ThiƩbaud Weksteend4587452020-08-19 14:53:01 +0200396 if binary.stripper.NeedsStrip(ctx) {
Dan Willemsen569edc52018-11-19 09:33:29 -0800397 out := android.PathForModuleOut(ctx, "versioned-stripped", fileName)
Jingwen Chen40fd90a2020-06-15 05:24:19 +0000398 binary.distFiles = android.MakeDefaultDistFiles(out)
ThiƩbaud Weksteend4587452020-08-19 14:53:01 +0200399 binary.stripper.StripExecutableOrSharedLib(ctx, versionedOutputFile, out, stripFlags)
Dan Willemsen569edc52018-11-19 09:33:29 -0800400 }
401
402 binary.injectVersionSymbol(ctx, outputFile, versionedOutputFile)
403 }
Colin Cross86803cf2018-02-15 14:12:26 -0800404 }
405
Chih-Hung Hsieh80783772021-10-11 16:46:56 -0700406 var validations android.Paths
Colin Crossf04eb992021-06-11 15:22:41 -0700407
Chris Parsonse0f2ab32020-11-20 17:27:25 -0500408 // Handle host bionic linker symbols.
Dan Willemsena0790e32018-10-12 00:24:23 -0700409 if ctx.Os() == android.LinuxBionic && !binary.static() {
Colin Crossf04eb992021-06-11 15:22:41 -0700410 verifyFile := android.PathForModuleOut(ctx, "host_bionic_verify.stamp")
Dan Willemsena0790e32018-10-12 00:24:23 -0700411
412 if !deps.DynamicLinker.Valid() {
413 panic("Non-static host bionic modules must have a dynamic linker")
414 }
415
Colin Crossf04eb992021-06-11 15:22:41 -0700416 binary.verifyHostBionicLinker(ctx, outputFile, deps.DynamicLinker.Path(), verifyFile)
417 validations = append(validations, verifyFile)
Dan Willemsena0790e32018-10-12 00:24:23 -0700418 }
419
Jaewoong Jung232c07c2018-12-18 11:08:25 -0800420 var sharedLibs android.Paths
421 // Ignore shared libs for static executables.
422 if !binary.static() {
Jiyong Park64a44f22019-01-18 14:37:08 +0900423 sharedLibs = deps.EarlySharedLibs
424 sharedLibs = append(sharedLibs, deps.SharedLibs...)
Jaewoong Jung232c07c2018-12-18 11:08:25 -0800425 sharedLibs = append(sharedLibs, deps.LateSharedLibs...)
Jiyong Park64a44f22019-01-18 14:37:08 +0900426 linkerDeps = append(linkerDeps, deps.EarlySharedLibsDeps...)
Jaewoong Jung232c07c2018-12-18 11:08:25 -0800427 linkerDeps = append(linkerDeps, deps.SharedLibsDeps...)
428 linkerDeps = append(linkerDeps, deps.LateSharedLibsDeps...)
Chih-Hung Hsiehf6ca1b92021-12-05 18:02:50 -0800429 linkerDeps = append(linkerDeps, ndkSharedLibDeps(ctx)...)
Jaewoong Jung232c07c2018-12-18 11:08:25 -0800430 }
431
Chih-Hung Hsieh7540a782022-01-08 19:56:09 -0800432 validations = append(validations, objs.tidyDepFiles...)
Pirama Arumuga Nainarada83ec2017-08-31 23:38:27 -0700433 linkerDeps = append(linkerDeps, flags.LdFlagsDeps...)
Colin Cross26c34ed2016-09-30 17:10:16 -0700434
Chris Parsonse0f2ab32020-11-20 17:27:25 -0500435 // Register link action.
Chris Parsonsbf4f55f2020-11-23 17:02:44 -0500436 transformObjToDynamicBinary(ctx, objs.objFiles, sharedLibs, deps.StaticLibs,
Colin Cross4d9c2d12016-07-29 12:48:20 -0700437 deps.LateStaticLibs, deps.WholeStaticLibs, linkerDeps, deps.CrtBegin, deps.CrtEnd, true,
Colin Crossf04eb992021-06-11 15:22:41 -0700438 builderFlags, outputFile, nil, validations)
Colin Cross4d9c2d12016-07-29 12:48:20 -0700439
Dan Willemsen581341d2017-02-09 16:16:31 -0800440 objs.coverageFiles = append(objs.coverageFiles, deps.StaticLibObjs.coverageFiles...)
441 objs.coverageFiles = append(objs.coverageFiles, deps.WholeStaticLibObjs.coverageFiles...)
Chris Parsonsbf4f55f2020-11-23 17:02:44 -0500442 binary.coverageOutputFile = transformCoverageFilesToZip(ctx, objs, binary.getStem(ctx))
Dan Willemsen581341d2017-02-09 16:16:31 -0800443
Alex Light3d673592019-01-18 14:37:31 -0800444 // Need to determine symlinks early since some targets (ie APEX) need this
445 // information but will not call 'install'
Inseob Kim4d945ee2022-02-24 10:29:18 +0900446 binary.setSymlinkList(ctx)
447
448 return ret
449}
450
451func (binary *binaryDecorator) unstrippedOutputFilePath() android.Path {
452 return binary.unstrippedOutputFile
453}
454
455func (binary *binaryDecorator) setSymlinkList(ctx ModuleContext) {
Colin Cross9b09f242016-12-07 13:37:42 -0800456 for _, symlink := range binary.Properties.Symlinks {
457 binary.symlinks = append(binary.symlinks,
Nan Zhang0007d812017-11-07 10:57:05 -0800458 symlink+String(binary.Properties.Suffix)+ctx.toolchain().ExecutableSuffix())
Colin Cross9b09f242016-12-07 13:37:42 -0800459 }
460
Nan Zhang0007d812017-11-07 10:57:05 -0800461 if Bool(binary.Properties.Symlink_preferred_arch) {
Roland Levillain9efb8c72019-06-05 13:31:31 +0100462 if String(binary.Properties.Suffix) == "" {
463 ctx.PropertyErrorf("symlink_preferred_arch", "must also specify suffix")
Colin Cross9b09f242016-12-07 13:37:42 -0800464 }
465 if ctx.TargetPrimary() {
Chris Parsonse0f2ab32020-11-20 17:27:25 -0500466 // Install a symlink to the preferred architecture
Colin Crossa6159012020-11-12 12:14:36 -0800467 symlinkName := binary.getStemWithoutSuffix(ctx)
468 binary.symlinks = append(binary.symlinks, symlinkName)
469 binary.preferredArchSymlink = symlinkName
Colin Cross9b09f242016-12-07 13:37:42 -0800470 }
471 }
Jiyong Parkaf6d8952019-01-31 12:21:23 +0900472}
473
Alex Light3d673592019-01-18 14:37:31 -0800474func (binary *binaryDecorator) symlinkList() []string {
475 return binary.symlinks
476}
477
Pirama Arumuga Nainar65c95ff2019-03-25 10:21:31 -0700478func (binary *binaryDecorator) nativeCoverage() bool {
479 return true
480}
481
Jiyong Parkee9a98d2019-08-09 14:44:36 +0900482func (binary *binaryDecorator) coverageOutputFilePath() android.OptionalPath {
483 return binary.coverageOutputFile
484}
485
Jiyong Parkf1194352019-02-25 11:05:47 +0900486// /system/bin/linker -> /apex/com.android.runtime/bin/linker
487func (binary *binaryDecorator) installSymlinkToRuntimeApex(ctx ModuleContext, file android.Path) {
488 dir := binary.baseInstaller.installDir(ctx)
489 dirOnDevice := android.InstallPathToOnDevicePath(ctx, dir)
490 target := "/" + filepath.Join("apex", "com.android.runtime", dir.Base(), file.Base())
491
492 ctx.InstallAbsoluteSymlink(dir, file.Base(), target)
Jaewoong Jung18aefc12020-12-21 09:11:10 -0800493 binary.postInstallCmds = append(binary.postInstallCmds, makeSymlinkCmd(dirOnDevice, file.Base(), target))
Jiyong Parkf1194352019-02-25 11:05:47 +0900494
495 for _, symlink := range binary.symlinks {
496 ctx.InstallAbsoluteSymlink(dir, symlink, target)
Jaewoong Jung18aefc12020-12-21 09:11:10 -0800497 binary.postInstallCmds = append(binary.postInstallCmds, makeSymlinkCmd(dirOnDevice, symlink, target))
Jiyong Parkf1194352019-02-25 11:05:47 +0900498 }
499}
500
Alex Light3d673592019-01-18 14:37:31 -0800501func (binary *binaryDecorator) install(ctx ModuleContext, file android.Path) {
Jiyong Parkf1194352019-02-25 11:05:47 +0900502 // Bionic binaries (e.g. linker) is installed to the bootstrap subdirectory.
503 // The original path becomes a symlink to the corresponding file in the
504 // runtime APEX.
Colin Cross3b19f5d2019-09-17 14:45:31 -0700505 translatedArch := ctx.Target().NativeBridge == android.NativeBridgeEnabled
Colin Cross56a83212020-09-15 18:30:11 -0700506 if InstallToBootstrap(ctx.baseModuleName(), ctx.Config()) && !ctx.Host() && ctx.directlyInAnyApex() &&
Yifan Hong60e0cfb2020-10-21 15:17:56 -0700507 !translatedArch && ctx.apexVariationName() == "" && !ctx.inRamdisk() && !ctx.inRecovery() &&
508 !ctx.inVendorRamdisk() {
Colin Cross56a83212020-09-15 18:30:11 -0700509
Peter Collingbourne3478bb22019-04-24 14:41:12 -0700510 if ctx.Device() && isBionic(ctx.baseModuleName()) {
Jiyong Parkc3e2c862019-03-16 01:10:08 +0900511 binary.installSymlinkToRuntimeApex(ctx, file)
512 }
Jiyong Parkf1194352019-02-25 11:05:47 +0900513 binary.baseInstaller.subDir = "bootstrap"
514 }
Alex Light3d673592019-01-18 14:37:31 -0800515 binary.baseInstaller.install(ctx, file)
Colin Crossa6159012020-11-12 12:14:36 -0800516
517 var preferredArchSymlinkPath android.OptionalPath
Colin Cross9b09f242016-12-07 13:37:42 -0800518 for _, symlink := range binary.symlinks {
Colin Crossa6159012020-11-12 12:14:36 -0800519 installedSymlink := ctx.InstallSymlink(binary.baseInstaller.installDir(ctx), symlink,
520 binary.baseInstaller.path)
521 if symlink == binary.preferredArchSymlink {
522 // If this is the preferred arch symlink, save the installed path for use as the
523 // tool path.
524 preferredArchSymlinkPath = android.OptionalPathForPath(installedSymlink)
525 }
Colin Cross9b09f242016-12-07 13:37:42 -0800526 }
527
Dan Willemsen4aa75ca2016-09-28 16:18:03 -0700528 if ctx.Os().Class == android.Host {
Colin Crossa6159012020-11-12 12:14:36 -0800529 // If the binary is multilib with a symlink to the preferred architecture, use the
530 // symlink instead of the binary because that's the more "canonical" name.
531 if preferredArchSymlinkPath.Valid() {
532 binary.toolPath = preferredArchSymlinkPath
533 } else {
534 binary.toolPath = android.OptionalPathForPath(binary.baseInstaller.path)
535 }
Dan Willemsen4aa75ca2016-09-28 16:18:03 -0700536 }
537}
538
539func (binary *binaryDecorator) hostToolPath() android.OptionalPath {
540 return binary.toolPath
Colin Cross4d9c2d12016-07-29 12:48:20 -0700541}
Dan Willemsena0790e32018-10-12 00:24:23 -0700542
Inseob Kima1888ce2022-10-04 14:42:02 +0900543func (binary *binaryDecorator) overriddenModules() []string {
544 return binary.Properties.Overrides
545}
546
547var _ overridable = (*binaryDecorator)(nil)
548
Dan Willemsena0790e32018-10-12 00:24:23 -0700549func init() {
Colin Crossf04eb992021-06-11 15:22:41 -0700550 pctx.HostBinToolVariable("verifyHostBionicCmd", "host_bionic_verify")
Dan Willemsena0790e32018-10-12 00:24:23 -0700551}
552
Colin Crossf04eb992021-06-11 15:22:41 -0700553var verifyHostBionic = pctx.AndroidStaticRule("verifyHostBionic",
Dan Willemsena0790e32018-10-12 00:24:23 -0700554 blueprint.RuleParams{
Colin Crossf04eb992021-06-11 15:22:41 -0700555 Command: "$verifyHostBionicCmd -i $in -l $linker && touch $out",
556 CommandDeps: []string{"$verifyHostBionicCmd"},
Dan Willemsena0790e32018-10-12 00:24:23 -0700557 }, "linker")
558
Colin Crossf04eb992021-06-11 15:22:41 -0700559func (binary *binaryDecorator) verifyHostBionicLinker(ctx ModuleContext, in, linker android.Path, out android.WritablePath) {
Dan Willemsena0790e32018-10-12 00:24:23 -0700560 ctx.Build(pctx, android.BuildParams{
Colin Crossf04eb992021-06-11 15:22:41 -0700561 Rule: verifyHostBionic,
562 Description: "verify host bionic",
Dan Willemsena0790e32018-10-12 00:24:23 -0700563 Input: in,
564 Implicit: linker,
565 Output: out,
566 Args: map[string]string{
567 "linker": linker.String(),
568 },
569 })
570}
Liz Kammer2b8004b2021-10-04 13:55:44 -0400571
Yu Liu7f3605f2022-02-08 14:15:12 -0800572type ccBinaryBazelHandler struct {
Yu Liu7f3605f2022-02-08 14:15:12 -0800573 module *Module
574}
575
Chris Parsons6ce2cf92022-05-20 10:54:17 -0400576var _ BazelHandler = (*ccBinaryBazelHandler)(nil)
577
Chris Parsonsf874e462022-05-10 13:50:12 -0400578func (handler *ccBinaryBazelHandler) QueueBazelCall(ctx android.BaseModuleContext, label string) {
Yu Liu7f3605f2022-02-08 14:15:12 -0800579 bazelCtx := ctx.Config().BazelContext
Chris Parsonsf874e462022-05-10 13:50:12 -0400580 bazelCtx.QueueBazelRequest(label, cquery.GetOutputFiles, android.GetConfigKey(ctx))
581}
582
583func (handler *ccBinaryBazelHandler) ProcessBazelQueryResponse(ctx android.ModuleContext, label string) {
584 bazelCtx := ctx.Config().BazelContext
585 filePaths, err := bazelCtx.GetOutputFiles(label, android.GetConfigKey(ctx))
586 if err != nil {
587 ctx.ModuleErrorf(err.Error())
588 return
Yu Liu7f3605f2022-02-08 14:15:12 -0800589 }
Chris Parsonsf874e462022-05-10 13:50:12 -0400590
591 if len(filePaths) != 1 {
592 ctx.ModuleErrorf("expected exactly one output file for '%s', but got %s", label, filePaths)
593 return
594 }
595 outputFilePath := android.PathForBazelOut(ctx, filePaths[0])
596 handler.module.outputFile = android.OptionalPathForPath(outputFilePath)
597 // TODO(b/220164721): We need to decide if we should return the stripped as the unstripped.
598 handler.module.linker.(*binaryDecorator).unstrippedOutputFile = outputFilePath
Yu Liu7f3605f2022-02-08 14:15:12 -0800599}
600
Jingwen Chen537242c2022-08-24 11:53:27 +0000601func binaryBp2buildAttrs(ctx android.TopDownMutatorContext, m *Module) binaryAttributes {
Liz Kammere6583482021-10-19 13:56:10 -0400602 baseAttrs := bp2BuildParseBaseProps(ctx, m)
Liz Kammer12615db2021-09-28 09:19:17 -0400603 binaryLinkerAttrs := bp2buildBinaryLinkerProps(ctx, m)
604
605 if proptools.BoolDefault(binaryLinkerAttrs.Linkshared, true) {
606 baseAttrs.implementationDynamicDeps.Add(baseAttrs.protoDependency)
607 } else {
608 baseAttrs.implementationDeps.Add(baseAttrs.protoDependency)
609 }
Liz Kammer2b8004b2021-10-04 13:55:44 -0400610
Jingwen Chen537242c2022-08-24 11:53:27 +0000611 attrs := binaryAttributes{
Liz Kammer12615db2021-09-28 09:19:17 -0400612 binaryLinkerAttrs: binaryLinkerAttrs,
Liz Kammer2b8004b2021-10-04 13:55:44 -0400613
Liz Kammere6583482021-10-19 13:56:10 -0400614 Srcs: baseAttrs.srcs,
615 Srcs_c: baseAttrs.cSrcs,
616 Srcs_as: baseAttrs.asSrcs,
Liz Kammer2b8004b2021-10-04 13:55:44 -0400617
Liz Kammere6583482021-10-19 13:56:10 -0400618 Copts: baseAttrs.copts,
619 Cppflags: baseAttrs.cppFlags,
620 Conlyflags: baseAttrs.conlyFlags,
621 Asflags: baseAttrs.asFlags,
Liz Kammer2b8004b2021-10-04 13:55:44 -0400622
Liz Kammere6583482021-10-19 13:56:10 -0400623 Deps: baseAttrs.implementationDeps,
624 Dynamic_deps: baseAttrs.implementationDynamicDeps,
625 Whole_archive_deps: baseAttrs.wholeArchiveDeps,
626 System_deps: baseAttrs.systemDynamicDeps,
Cole Faust6b29f592022-08-09 09:50:56 -0700627 Runtime_deps: baseAttrs.runtimeDeps,
Liz Kammer2b8004b2021-10-04 13:55:44 -0400628
Liz Kammere6583482021-10-19 13:56:10 -0400629 Local_includes: baseAttrs.localIncludes,
630 Absolute_includes: baseAttrs.absoluteIncludes,
631 Linkopts: baseAttrs.linkopts,
632 Link_crt: baseAttrs.linkCrt,
633 Use_libcrt: baseAttrs.useLibcrt,
Yu Liua79c9462022-03-22 16:35:22 -0700634 Use_version_lib: baseAttrs.useVersionLib,
Liz Kammere6583482021-10-19 13:56:10 -0400635 Rtti: baseAttrs.rtti,
636 Stl: baseAttrs.stl,
637 Cpp_std: baseAttrs.cppStd,
Liz Kammer2b8004b2021-10-04 13:55:44 -0400638
Liz Kammere6583482021-10-19 13:56:10 -0400639 Additional_linker_inputs: baseAttrs.additionalLinkerInputs,
Liz Kammer2b8004b2021-10-04 13:55:44 -0400640
641 Strip: stripAttributes{
Liz Kammere6583482021-10-19 13:56:10 -0400642 Keep_symbols: baseAttrs.stripKeepSymbols,
643 Keep_symbols_and_debug_frame: baseAttrs.stripKeepSymbolsAndDebugFrame,
644 Keep_symbols_list: baseAttrs.stripKeepSymbolsList,
645 All: baseAttrs.stripAll,
646 None: baseAttrs.stripNone,
Liz Kammer2b8004b2021-10-04 13:55:44 -0400647 },
648
Chris Parsons58852a02021-12-09 18:10:18 -0500649 Features: baseAttrs.features,
Yu Liufc603162022-03-01 15:44:08 -0800650
651 sdkAttributes: bp2BuildParseSdkAttributes(m),
Liz Kammer2b8004b2021-10-04 13:55:44 -0400652 }
653
Jingwen Chen537242c2022-08-24 11:53:27 +0000654 return attrs
655}
656
657func binaryBp2build(ctx android.TopDownMutatorContext, m *Module) {
658 // shared with cc_test
659 binaryAttrs := binaryBp2buildAttrs(ctx, m)
660
Sam Delmerico75539d62022-01-31 14:37:29 +0000661 ctx.CreateBazelTargetModule(bazel.BazelTargetModuleProperties{
Liz Kammer2b8004b2021-10-04 13:55:44 -0400662 Rule_class: "cc_binary",
Liz Kammer2b376bc2022-01-12 12:00:49 -0500663 Bzl_load_location: "//build/bazel/rules/cc:cc_binary.bzl",
Liz Kammer2b8004b2021-10-04 13:55:44 -0400664 },
665 android.CommonAttributes{Name: m.Name()},
Jingwen Chen537242c2022-08-24 11:53:27 +0000666 &binaryAttrs)
Liz Kammer2b8004b2021-10-04 13:55:44 -0400667}
668
669// binaryAttributes contains Bazel attributes corresponding to a cc binary
670type binaryAttributes struct {
671 binaryLinkerAttrs
672 Srcs bazel.LabelListAttribute
673 Srcs_c bazel.LabelListAttribute
674 Srcs_as bazel.LabelListAttribute
675
676 Copts bazel.StringListAttribute
677 Cppflags bazel.StringListAttribute
678 Conlyflags bazel.StringListAttribute
679 Asflags bazel.StringListAttribute
680
681 Deps bazel.LabelListAttribute
682 Dynamic_deps bazel.LabelListAttribute
683 Whole_archive_deps bazel.LabelListAttribute
684 System_deps bazel.LabelListAttribute
Cole Faust6b29f592022-08-09 09:50:56 -0700685 Runtime_deps bazel.LabelListAttribute
Liz Kammer2b8004b2021-10-04 13:55:44 -0400686
687 Local_includes bazel.StringListAttribute
688 Absolute_includes bazel.StringListAttribute
689
690 Linkopts bazel.StringListAttribute
691 Additional_linker_inputs bazel.LabelListAttribute
692
Yu Liua79c9462022-03-22 16:35:22 -0700693 Link_crt bazel.BoolAttribute
694 Use_libcrt bazel.BoolAttribute
695 Use_version_lib bazel.BoolAttribute
Liz Kammer2b8004b2021-10-04 13:55:44 -0400696
697 Rtti bazel.BoolAttribute
698 Stl *string
699 Cpp_std *string
700
701 Strip stripAttributes
702
703 Features bazel.StringListAttribute
Yu Liufc603162022-03-01 15:44:08 -0800704
705 sdkAttributes
Liz Kammer2b8004b2021-10-04 13:55:44 -0400706}