Lines Matching refs:binary

119 func (binary *binaryDecorator) linkerProps() []interface{} {
120 return append(binary.baseLinker.linkerProps(),
121 &binary.Properties,
122 &binary.stripper.StripProperties)
130 func (binary *binaryDecorator) getStemWithoutSuffix(ctx BaseModuleContext) string {
132 if String(binary.Properties.Stem) != "" {
133 stem = String(binary.Properties.Stem)
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)
150 if !Bool(binary.baseLinker.Properties.Nocrt) {
151 if binary.static() {
159 if binary.static() {
179 if ctx.Os() == android.LinuxBionic && !binary.static() {
185 if !binary.static() && inList("libc", deps.StaticLibs) && !ctx.BazelConversionMode() {
193 func (binary *binaryDecorator) isDependencyRoot() bool {
203 binary := &binaryDecorator{
208 module.linker = binary
209 module.installer = binary
215 return module, binary
220 func (binary *binaryDecorator) linkerInit(ctx BaseModuleContext) {
221 binary.baseLinker.linkerInit(ctx)
227 if binary.Properties.Static_executable == nil && ctx.Config().HostStaticBinaries() {
228 binary.Properties.Static_executable = BoolPtr(true)
232 binary.Properties.Static_executable = nil
237 func (binary *binaryDecorator) static() bool {
238 return Bool(binary.Properties.Static_executable)
241 func (binary *binaryDecorator) staticBinary() bool {
242 return binary.static()
245 func (binary *binaryDecorator) binary() bool { func
252 func (binary *binaryDecorator) linkerFlags(ctx ModuleContext, flags Flags) Flags {
253 flags = binary.baseLinker.linkerFlags(ctx, flags)
256 if ctx.Host() && !ctx.Windows() && !binary.static() {
270 if binary.static() {
286 if binary.Properties.DynamicLinker != "" {
287 flags.DynamicLinker = binary.Properties.DynamicLinker
325 if binary.static() {
339 func (binary *binaryDecorator) link(ctx ModuleContext,
342 fileName := binary.getStem(ctx) + flags.Toolchain.ExecutableSuffix()
356 } else if ctx.toolchain().Bionic() && !binary.static() {
362 if binary.stripper.NeedsStrip(ctx) {
368 binary.stripper.StripExecutableOrSharedLib(ctx, outputFile, strippedOutputFile, stripFlags)
371 binary.unstrippedOutputFile = outputFile
373 if String(binary.Properties.Prefix_symbols) != "" {
376 transformBinaryPrefixSymbols(ctx, String(binary.Properties.Prefix_symbols), outputFile,
380 …outputFile = maybeInjectBoringSSLHash(ctx, outputFile, binary.Properties.Inject_bssl_hash, fileNam…
383 if Bool(binary.baseLinker.Properties.Use_version_lib) {
387 binary.injectVersionSymbol(ctx, outputFile, versionedOutputFile)
392 binary.distFiles = android.MakeDefaultDistFiles(versionedOutputFile)
394 if binary.stripper.NeedsStrip(ctx) {
396 binary.distFiles = android.MakeDefaultDistFiles(out)
397 binary.stripper.StripExecutableOrSharedLib(ctx, versionedOutputFile, out, stripFlags)
400 binary.injectVersionSymbol(ctx, outputFile, versionedOutputFile)
405 if ctx.Os() == android.LinuxBionic && !binary.static() {
413binary.injectHostBionicLinkerSymbols(ctx, outputFile, deps.DynamicLinker.Path(), injectedOutputFil…
418 if !binary.static() {
437 binary.coverageOutputFile = transformCoverageFilesToZip(ctx, objs, binary.getStem(ctx))
441 for _, symlink := range binary.Properties.Symlinks {
442 binary.symlinks = append(binary.symlinks,
443 symlink+String(binary.Properties.Suffix)+ctx.toolchain().ExecutableSuffix())
446 if Bool(binary.Properties.Symlink_preferred_arch) {
447 if String(binary.Properties.Suffix) == "" {
452 symlinkName := binary.getStemWithoutSuffix(ctx)
453 binary.symlinks = append(binary.symlinks, symlinkName)
454 binary.preferredArchSymlink = symlinkName
461 func (binary *binaryDecorator) unstrippedOutputFilePath() android.Path {
462 return binary.unstrippedOutputFile
465 func (binary *binaryDecorator) symlinkList() []string {
466 return binary.symlinks
469 func (binary *binaryDecorator) nativeCoverage() bool {
473 func (binary *binaryDecorator) coverageOutputFilePath() android.OptionalPath {
474 return binary.coverageOutputFile
478 func (binary *binaryDecorator) installSymlinkToRuntimeApex(ctx ModuleContext, file android.Path) {
479 dir := binary.baseInstaller.installDir(ctx)
484binary.postInstallCmds = append(binary.postInstallCmds, makeSymlinkCmd(dirOnDevice, file.Base(), t…
486 for _, symlink := range binary.symlinks {
488binary.postInstallCmds = append(binary.postInstallCmds, makeSymlinkCmd(dirOnDevice, symlink, targe…
492 func (binary *binaryDecorator) install(ctx ModuleContext, file android.Path) {
502 binary.installSymlinkToRuntimeApex(ctx, file)
504 binary.baseInstaller.subDir = "bootstrap"
506 binary.baseInstaller.install(ctx, file)
509 for _, symlink := range binary.symlinks {
510 installedSymlink := ctx.InstallSymlink(binary.baseInstaller.installDir(ctx), symlink,
511 binary.baseInstaller.path)
512 if symlink == binary.preferredArchSymlink {
523 binary.toolPath = preferredArchSymlinkPath
525 binary.toolPath = android.OptionalPathForPath(binary.baseInstaller.path)
530 func (binary *binaryDecorator) hostToolPath() android.OptionalPath {
531 return binary.toolPath
544 func (binary *binaryDecorator) injectHostBionicLinkerSymbols(ctx ModuleContext, in, linker android.…