From 4289c28fb9291f95d1372059bf8cfef60059bf7d Mon Sep 17 00:00:00 2001 From: machenbach Date: Tue, 2 Aug 2016 08:35:24 -0700 Subject: [PATCH] [build] Conditionally print to stdout on Android This adds a gyp/gn variable to control printing to stdout on Android. This is false by default and true for all v8 stand-alone android bots. BUG=chromium:629806 Review-Url: https://codereview.chromium.org/2183063002 Cr-Commit-Position: refs/heads/master@{#38253} --- BUILD.gn | 6 ++++++ gypfiles/standalone.gypi | 1 - gypfiles/toolchain.gypi | 8 ++++++++ infra/mb/mb_config.pyl | 4 ++-- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index 2972224d8e..9dad9cd2a0 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -19,6 +19,9 @@ import("//build_overrides/v8.gni") import("snapshot_toolchain.gni") declare_args() { + # Print to stdout on Android. + v8_android_log_stdout = false + # Sets -DVERIFY_HEAP. v8_enable_verify_heap = false @@ -313,6 +316,9 @@ config("toolchain") { ldflags += [ "/STACK:2097152" ] } } + if (is_android && v8_android_log_stdout) { + defines += [ "V8_ANDROID_LOG_STDOUT" ] + } # TODO(jochen): Support v8_enable_prof on Windows. # TODO(jochen): Add support for compiling with simulators. diff --git a/gypfiles/standalone.gypi b/gypfiles/standalone.gypi index 54f0fca398..3672a56b59 100644 --- a/gypfiles/standalone.gypi +++ b/gypfiles/standalone.gypi @@ -1116,7 +1116,6 @@ 'target_defaults': { 'defines': [ 'ANDROID', - 'V8_ANDROID_LOG_STDOUT', ], 'configurations': { 'Release': { diff --git a/gypfiles/toolchain.gypi b/gypfiles/toolchain.gypi index 98c8074fb1..95eb1d99cb 100644 --- a/gypfiles/toolchain.gypi +++ b/gypfiles/toolchain.gypi @@ -57,6 +57,9 @@ # Similar to the ARM hard float ABI but on MIPS. 'v8_use_mips_abi_hardfloat%': 'true', + # Print to stdout on Android. + 'v8_android_log_stdout%': 0, + # Force disable libstdc++ debug mode. 'disable_glibcxx_debug%': 0, @@ -1082,6 +1085,11 @@ }], ], }], + ['OS=="android" and v8_android_log_stdout==1', { + 'defines': [ + 'V8_ANDROID_LOG_STDOUT', + ], + }], ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \ or OS=="netbsd" or OS=="qnx" or OS=="aix"', { 'conditions': [ diff --git a/infra/mb/mb_config.pyl b/infra/mb/mb_config.pyl index e4b751b9e0..06a84962d5 100644 --- a/infra/mb/mb_config.pyl +++ b/infra/mb/mb_config.pyl @@ -389,8 +389,8 @@ 'mixins': { 'android': { - 'gn_args': 'target_os="android"', - 'gyp_defines': 'OS=android', + 'gn_args': 'target_os="android" v8_android_log_stdout=true', + 'gyp_defines': 'OS=android v8_android_log_stdout=1', }, 'arm': {