Lines Matching refs:binary
109 func (binary *binaryDecorator) linkerProps() []interface{} {
110 return append(binary.baseLinker.linkerProps(),
111 &binary.Properties,
112 &binary.stripper.StripProperties)
116 func (binary *binaryDecorator) getStemWithoutSuffix(ctx BaseModuleContext) string {
118 if String(binary.Properties.Stem) != "" {
119 stem = String(binary.Properties.Stem)
125 func (binary *binaryDecorator) getStem(ctx BaseModuleContext) string {
126 return binary.getStemWithoutSuffix(ctx) + String(binary.Properties.Suffix)
129 func (binary *binaryDecorator) linkerDeps(ctx DepsContext, deps Deps) Deps {
130 deps = binary.baseLinker.linkerDeps(ctx, deps)
132 if !Bool(binary.baseLinker.Properties.Nocrt) {
134 if binary.static() {
150 if binary.static() {
153 if binary.static() {
163 if binary.static() {
176 if ctx.Os() == android.LinuxBionic && !binary.static() {
182 if !binary.static() && inList("libc", deps.StaticLibs) {
190 func (binary *binaryDecorator) isDependencyRoot() bool {
196 binary := &binaryDecorator{
201 module.linker = binary
202 module.installer = binary
208 return module, binary
211 func (binary *binaryDecorator) linkerInit(ctx BaseModuleContext) {
212 binary.baseLinker.linkerInit(ctx)
216 if binary.Properties.Static_executable == nil && ctx.Config().HostStaticBinaries() {
217 binary.Properties.Static_executable = BoolPtr(true)
221 binary.Properties.Static_executable = nil
226 func (binary *binaryDecorator) static() bool {
227 return Bool(binary.Properties.Static_executable)
230 func (binary *binaryDecorator) staticBinary() bool {
231 return binary.static()
234 func (binary *binaryDecorator) binary() bool { func
238 func (binary *binaryDecorator) linkerFlags(ctx ModuleContext, flags Flags) Flags {
239 flags = binary.baseLinker.linkerFlags(ctx, flags)
241 if ctx.Host() && !ctx.Windows() && !binary.static() {
255 if binary.static() {
271 if binary.Properties.DynamicLinker != "" {
272 flags.DynamicLinker = binary.Properties.DynamicLinker
310 if binary.static() {
321 func (binary *binaryDecorator) link(ctx ModuleContext,
324 fileName := binary.getStem(ctx) + flags.Toolchain.ExecutableSuffix()
337 } else if ctx.toolchain().Bionic() && !binary.static() {
343 if binary.stripper.needsStrip(ctx) {
349 binary.stripper.stripExecutableOrSharedLib(ctx, outputFile, strippedOutputFile, builderFlags)
352 binary.unstrippedOutputFile = outputFile
354 if String(binary.Properties.Prefix_symbols) != "" {
357 TransformBinaryPrefixSymbols(ctx, String(binary.Properties.Prefix_symbols), outputFile,
361 …outputFile = maybeInjectBoringSSLHash(ctx, outputFile, binary.Properties.Inject_bssl_hash, fileNam…
363 if Bool(binary.baseLinker.Properties.Use_version_lib) {
367 binary.injectVersionSymbol(ctx, outputFile, versionedOutputFile)
370 binary.distFiles = android.MakeDefaultDistFiles(versionedOutputFile)
372 if binary.stripper.needsStrip(ctx) {
374 binary.distFiles = android.MakeDefaultDistFiles(out)
375 binary.stripper.stripExecutableOrSharedLib(ctx, versionedOutputFile, out, builderFlags)
378 binary.injectVersionSymbol(ctx, outputFile, versionedOutputFile)
382 if ctx.Os() == android.LinuxBionic && !binary.static() {
390 …binary.injectHostBionicLinkerSymbols(ctx, outputFile, deps.DynamicLinker.Path(), injectedOutputFil…
395 if !binary.static() {
413 binary.coverageOutputFile = TransformCoverageFilesToZip(ctx, objs, binary.getStem(ctx))
417 for _, symlink := range binary.Properties.Symlinks {
418 binary.symlinks = append(binary.symlinks,
419 symlink+String(binary.Properties.Suffix)+ctx.toolchain().ExecutableSuffix())
422 if Bool(binary.Properties.Symlink_preferred_arch) {
423 if String(binary.Properties.Suffix) == "" {
427 binary.symlinks = append(binary.symlinks, binary.getStemWithoutSuffix(ctx))
434 func (binary *binaryDecorator) unstrippedOutputFilePath() android.Path {
435 return binary.unstrippedOutputFile
438 func (binary *binaryDecorator) symlinkList() []string {
439 return binary.symlinks
442 func (binary *binaryDecorator) nativeCoverage() bool {
446 func (binary *binaryDecorator) coverageOutputFilePath() android.OptionalPath {
447 return binary.coverageOutputFile
451 func (binary *binaryDecorator) installSymlinkToRuntimeApex(ctx ModuleContext, file android.Path) {
452 dir := binary.baseInstaller.installDir(ctx)
457 …binary.post_install_cmds = append(binary.post_install_cmds, makeSymlinkCmd(dirOnDevice, file.Base(…
459 for _, symlink := range binary.symlinks {
461 …binary.post_install_cmds = append(binary.post_install_cmds, makeSymlinkCmd(dirOnDevice, symlink, t…
465 func (binary *binaryDecorator) install(ctx ModuleContext, file android.Path) {
472 binary.installSymlinkToRuntimeApex(ctx, file)
474 binary.baseInstaller.subDir = "bootstrap"
476 binary.baseInstaller.install(ctx, file)
477 for _, symlink := range binary.symlinks {
478 ctx.InstallSymlink(binary.baseInstaller.installDir(ctx), symlink, binary.baseInstaller.path)
482 binary.toolPath = android.OptionalPathForPath(binary.baseInstaller.path)
486 func (binary *binaryDecorator) hostToolPath() android.OptionalPath {
487 return binary.toolPath
500 func (binary *binaryDecorator) injectHostBionicLinkerSymbols(ctx ModuleContext, in, linker android.…