Lines Matching full:binary
41 // install symlinks to the binary. Symlink names will have the suffix and the binary
51 // binaries would be installed by default (in PRODUCT_PACKAGES) the other binary will be removed
68 // cc_binary produces a binary that is runnable on a device.
74 // cc_binary_host produces a binary that is runnable on a host.
84 // binaryDecorator is a decorator containing information for C++ binary modules.
94 // Location of the linked, unstripped binary
101 // binary for the preferred arch.
110 // Action command lines to run directly after the binary is installed. For example,
118 // for this binary.
119 func (binary *binaryDecorator) linkerProps() []interface{} {
120 return append(binary.baseLinker.linkerProps(),
121 &binary.Properties,
122 &binary.stripper.StripProperties)
127 // the main output file of this binary module. This may be derived from the module name
129 // For the full symlink name, the `Suffix` property of a binary module must be appended.
130 func (binary *binaryDecorator) getStemWithoutSuffix(ctx BaseModuleContext) string {
132 if String(binary.Properties.Stem) != "" {
133 stem = String(binary.Properties.Stem)
139 // getStem returns the full name to use for the symlink of the main output file of this binary
141 func (binary *binaryDecorator) getStem(ctx BaseModuleContext) string {
142 return binary.getStemWithoutSuffix(ctx) + String(binary.Properties.Suffix)
147 func (binary *binaryDecorator) linkerDeps(ctx DepsContext, deps Deps) Deps {
148 deps = binary.baseLinker.linkerDeps(ctx, deps)
149 if binary.baseLinker.Properties.crt() {
150 if binary.static() {
159 if binary.static() {
164 if binary.static() {
177 if ctx.Os() == android.LinuxBionic && !binary.static() {
182 if !binary.static() && inList("libc", deps.StaticLibs) {
190 // NewBinary builds and returns a new Module corresponding to a C++ binary.
191 // Individual module implementations which comprise a C++ binary should call this function,
199 binary := &binaryDecorator{
204 module.linker = binary
205 module.installer = binary
211 return module, binary
215 // on properties of this binary.
216 func (binary *binaryDecorator) linkerInit(ctx BaseModuleContext) {
217 binary.baseLinker.linkerInit(ctx)
222 if binary.Properties.Static_executable == nil && ctx.Config().HostStaticBinaries() {
223 binary.Properties.Static_executable = BoolPtr(true)
229 binary.Properties.Static_executable = nil
233 func (binary *binaryDecorator) static() bool {
234 return Bool(binary.Properties.Static_executable)
237 func (binary *binaryDecorator) staticBinary() bool {
238 return binary.static()
241 func (binary *binaryDecorator) binary() bool { func
246 // by this binary, or that are implied by attributes of this binary. These flags are
248 func (binary *binaryDecorator) linkerFlags(ctx ModuleContext, flags Flags) Flags {
249 flags = binary.baseLinker.linkerFlags(ctx, flags)
252 if ctx.Host() && !ctx.Windows() && !binary.static() {
266 if binary.static() {
282 if binary.Properties.DynamicLinker != "" {
283 flags.DynamicLinker = binary.Properties.DynamicLinker
321 if binary.static() {
332 // link registers actions to link this binary, and sets various fields
333 // on this binary to reflect information that should be exported up the build
335 func (binary *binaryDecorator) link(ctx ModuleContext,
338 fileName := binary.getStem(ctx) + flags.Toolchain.ExecutableSuffix()
346 } else if (ctx.toolchain().Bionic() || ctx.toolchain().Musl()) && !binary.static() {
358 if binary.stripper.NeedsStrip(ctx) {
364 binary.stripper.StripExecutableOrSharedLib(ctx, outputFile, strippedOutputFile, stripFlags)
367 binary.unstrippedOutputFile = outputFile
369 if String(binary.Properties.Prefix_symbols) != "" {
372 transformBinaryPrefixSymbols(ctx, String(binary.Properties.Prefix_symbols), outputFile,
376 …outputFile = maybeInjectBoringSSLHash(ctx, outputFile, binary.Properties.Inject_bssl_hash, fileNam…
379 if Bool(binary.baseLinker.Properties.Use_version_lib) {
383 binary.injectVersionSymbol(ctx, outputFile, versionedOutputFile)
385 // When dist'ing a library or binary that has use_version_lib set, always
388 binary.distFiles = android.MakeDefaultDistFiles(versionedOutputFile)
390 if binary.stripper.NeedsStrip(ctx) {
392 binary.distFiles = android.MakeDefaultDistFiles(out)
393 binary.stripper.StripExecutableOrSharedLib(ctx, versionedOutputFile, out, stripFlags)
396 binary.injectVersionSymbol(ctx, outputFile, versionedOutputFile)
403 if ctx.Os() == android.LinuxBionic && !binary.static() {
410 binary.verifyHostBionicLinker(ctx, outputFile, deps.DynamicLinker.Path(), verifyFile)
416 if !binary.static() {
440 binary.coverageOutputFile = transformCoverageFilesToZip(ctx, objs, binary.getStem(ctx))
444 binary.setSymlinkList(ctx)
449 func (binary *binaryDecorator) unstrippedOutputFilePath() android.Path {
450 return binary.unstrippedOutputFile
453 func (binary *binaryDecorator) strippedAllOutputFilePath() android.Path {
457 func (binary *binaryDecorator) setSymlinkList(ctx ModuleContext) {
458 for _, symlink := range binary.Properties.Symlinks {
459 binary.symlinks = append(binary.symlinks,
460 symlink+String(binary.Properties.Suffix)+ctx.toolchain().ExecutableSuffix())
463 if Bool(binary.Properties.Symlink_preferred_arch) {
464 if String(binary.Properties.Suffix) == "" {
469 symlinkName := binary.getStemWithoutSuffix(ctx)
470 binary.symlinks = append(binary.symlinks, symlinkName)
471 binary.preferredArchSymlink = symlinkName
476 func (binary *binaryDecorator) symlinkList() []string {
477 return binary.symlinks
480 func (binary *binaryDecorator) nativeCoverage() bool {
484 func (binary *binaryDecorator) coverageOutputFilePath() android.OptionalPath {
485 return binary.coverageOutputFile
489 func (binary *binaryDecorator) installSymlinkToRuntimeApex(ctx ModuleContext, file android.Path) {
490 dir := binary.baseInstaller.installDir(ctx)
495 …binary.postInstallCmds = append(binary.postInstallCmds, makeSymlinkCmd(dirOnDevice, file.Base(), t…
497 for _, symlink := range binary.symlinks {
499 …binary.postInstallCmds = append(binary.postInstallCmds, makeSymlinkCmd(dirOnDevice, symlink, targe…
503 func (binary *binaryDecorator) install(ctx ModuleContext, file android.Path) {
513 binary.installSymlinkToRuntimeApex(ctx, file)
515 binary.baseInstaller.subDir = "bootstrap"
517 binary.baseInstaller.install(ctx, file)
520 for _, symlink := range binary.symlinks {
521 installedSymlink := ctx.InstallSymlink(binary.baseInstaller.installDir(ctx), symlink,
522 binary.baseInstaller.path)
523 if symlink == binary.preferredArchSymlink {
531 // If the binary is multilib with a symlink to the preferred architecture, use the
532 // symlink instead of the binary because that's the more "canonical" name.
534 binary.toolPath = preferredArchSymlinkPath
536 binary.toolPath = android.OptionalPathForPath(binary.baseInstaller.path)
541 func (binary *binaryDecorator) hostToolPath() android.OptionalPath {
542 return binary.toolPath
545 func (binary *binaryDecorator) overriddenModules() []string {
546 return binary.Properties.Overrides
549 func (binary *binaryDecorator) moduleInfoJSON(ctx ModuleContext, moduleInfoJSON *android.ModuleInfo…
551 binary.baseLinker.moduleInfoJSON(ctx, moduleInfoJSON)
566 func (binary *binaryDecorator) verifyHostBionicLinker(ctx ModuleContext, in, linker android.Path, o…