本文整理汇总了Python中src.build.build_options.OPTIONS.is_nacl_build方法的典型用法代码示例。如果您正苦于以下问题:Python OPTIONS.is_nacl_build方法的具体用法?Python OPTIONS.is_nacl_build怎么用?Python OPTIONS.is_nacl_build使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类src.build.build_options.OPTIONS
的用法示例。
在下文中一共展示了OPTIONS.is_nacl_build方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _filter_params_for_v8
# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import is_nacl_build [as 别名]
def _filter_params_for_v8(vars):
# Switch V8 to always emit ARM code and use simulator to run that on
# x86 NaCl.
# Also disable snapshots as they are not working in ARC yet.
if OPTIONS.is_nacl_build():
if '-DV8_TARGET_ARCH_IA32' in vars.get_cflags():
vars.get_cflags().remove('-DV8_TARGET_ARCH_IA32')
if '-DV8_TARGET_ARCH_X64' in vars.get_cflags():
vars.get_cflags().remove('-DV8_TARGET_ARCH_X64')
vars.get_cflags().append('-DV8_TARGET_ARCH_ARM')
vars.get_cflags().append('-D__ARM_ARCH_7__')
sources = vars.get_sources()
new_sources = []
v8_src = 'android/external/chromium_org/v8/src/'
for path in sources:
if OPTIONS.is_nacl_build():
if path.startswith(v8_src + 'x64/'):
path = v8_src + 'arm/' + os.path.basename(path).replace('x64', 'arm')
if path.startswith(v8_src + 'ia32/'):
path = v8_src + 'arm/' + os.path.basename(path).replace('ia32', 'arm')
if path.endswith('/snapshot.cc'):
path = 'android/external/chromium_org/v8/src/snapshot-empty.cc'
new_sources.append(path)
if not OPTIONS.is_arm() and OPTIONS.is_nacl_build():
new_sources.append(v8_src + 'arm/constants-arm.cc')
new_sources.append(v8_src + 'arm/simulator-arm.cc')
vars.get_sources()[:] = new_sources
示例2: main
# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import is_nacl_build [as 别名]
def main(self):
args = []
if self._enable_play_services:
variant = '+play_services'
# Enable minimum service as baseline
args += ['--additional-metadata', '{"usePlayServices": ["gcm"]}']
else:
variant = ''
if self._args.test_mode:
output = self._load_output()
else:
if OPTIONS.is_nacl_build():
# Enable to allow collecting memory usage on NaCl
args += ['--enable-nacl-list-mappings']
self._perftest(args)
output = self._load_output()
logging.debug(_OUTPUT_DUMP_FORMAT % output)
data = self._parse_output(output)
if data:
self._post(data, variant)
else:
logging.error(_OUTPUT_DUMP_FORMAT % output)
sys.exit(-1)
示例3: _cleanup_output
# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import is_nacl_build [as 别名]
def _cleanup_output(raw):
if OPTIONS.is_nacl_build():
filter_pattern = _NACL_FILTER_PATTERN
elif OPTIONS.is_bare_metal_build():
filter_pattern = _BARE_METAL_FILTER_PATTERN
else:
assert False, 'Must not reach here'
lines = [line for line in raw.split('\n') if not filter_pattern.match(line)]
return '\n'.join(lines)
示例4: _get_app_mem_info
# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import is_nacl_build [as 别名]
def _get_app_mem_info(pid):
"""Returns a dictionary showing the process memory usage in MB."""
stat = _get_process_stat_line(pid).split()
mem = {
'res': float(stat[23]) * 4096 / 1024 / 1024,
# On NaCl, hide uselessly and confusingly big vsize due to memory mapping.
'virt': 0 if OPTIONS.is_nacl_build() else float(stat[22]) / 1024 / 1024,
'pdirt': _get_private_dirty_pages_in_mb(pid),
}
return mem
示例5: _terminate_chrome
# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import is_nacl_build [as 别名]
def _terminate_chrome(chrome):
_remove_chrome_pid_file(chrome.pid)
if OPTIONS.is_nacl_build():
# For now use sigkill, as NaCl's debug stub seems to cause sigterm to
# be ignored.
chrome.kill()
else:
chrome.terminate()
chrome.wait(_CHROME_KILL_TIMEOUT)
示例6: _get_nacl_irt_path
# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import is_nacl_build [as 别名]
def _get_nacl_irt_path(parsed_args):
if not OPTIONS.is_nacl_build():
return None
chrome_path = _get_chrome_path(parsed_args)
irt = toolchain.get_tool(OPTIONS.target(), 'irt')
nacl_irt_path = os.path.join(os.path.dirname(chrome_path), irt)
nacl_irt_debug_path = nacl_irt_path + '.debug'
# Use debug version nacl_irt if it exists.
if os.path.exists(nacl_irt_debug_path):
return nacl_irt_debug_path
else:
return nacl_irt_path
示例7: _filter
# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import is_nacl_build [as 别名]
def _filter(vars):
if OPTIONS.is_nacl_build():
# The flag is valid only for C/ObjC but not for C++ on NaCl gcc.
vars.remove_c_or_cxxflag('-Wno-int-to-pointer-cast')
# TODO(crbug.com/327496): Move this to generic functionality of
# make_to_ninja.
intermediates_dir = (
make_to_ninja.MakefileNinjaTranslator.get_intermediate_headers_dir())
vars.get_includes().append(intermediates_dir)
# TODO(crbug.com/414569): L-rebase: These include directories do not seem to
# be being added. Fix that.
vars.get_includes().append('android/frameworks/av/media/img_utils/include')
vars.get_includes().append('android/external/skia/include/pathops')
vars.get_includes().append('android/system/core/libprocessgroup/include')
vars.get_implicit_deps().extend(
[intermediates_dir + '/' + i for i in [
'libsonivox/eas.h',
'libsonivox/eas_types.h',
'libsonivox/eas_reverb.h',
'libsonivox/jet.h']])
# Exclude ZygoteInit for which we have stubbed out jni registrations.
vars.get_sources().remove('android/frameworks/base/core/jni/'
'com_android_internal_os_ZygoteInit.cpp')
# Exclude GLES31+ functionality since we do not currently support it.
vars.get_sources().remove('android/frameworks/base/core/jni/'
'android_opengl_GLES31.cpp')
vars.get_sources().remove('android/frameworks/base/core/jni/'
'android_opengl_GLES31Ext.cpp')
# Add ARC specific JNIs.
vars.get_sources().extend([
'android/frameworks/base/core/jni/org_chromium_arc_internal_Tracing.cpp', # NOQA
'android/frameworks/base/core/jni/org_chromium_arc_ArcProxySelector.cpp', # NOQA
])
if OPTIONS.disable_hwui():
# Defining this enables support for hardware accelerated rendering in the
# user interface code, such as when an application uses a TextureView. The
# primary effect is to use libhwui. It is enabled by default in the
# Android.mk file, we disable it here when not enabling hwui.
vars.get_cflags().remove('-DUSE_OPENGL_RENDERER')
if build_common.use_ndk_direct_execution():
vars.get_cflags().append('-DUSE_NDK_DIRECT_EXECUTION')
deps = vars.get_shared_deps()
excluded_libs = (
'libprocessgroup', # Not built
'libhardware_legacy', # Not built
'libnetutils', # Not built
'libselinux', # Not built
'libusbhost', # Not built (only for MTP)
'libwpa_client') # Not built
deps[:] = [x for x in deps if x not in excluded_libs]
return True
示例8: _filter_ldflags_for_libwebviewchromium
# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import is_nacl_build [as 别名]
def _filter_ldflags_for_libwebviewchromium(vars):
if OPTIONS.is_bare_metal_build() or OPTIONS.is_nacl_build():
# We need to pass in --no-keep-memory or ld runs out of memory linking.
vars.get_ldflags().append('-Wl,--no-keep-memory')
# --no-undefined allows undefined symbols to be present in the linked .so
# without errors, which is what we want so they are resolved at runtime.
vars.get_ldflags().remove('-Wl,--no-undefined')
# TODO(crbug.com/489972): Suppress warnings caused by hidden skia symbols.
vars.get_ldflags().remove('-Wl,--fatal-warnings')
for idx, flag in enumerate(vars.get_ldflags()):
if 'android_exports.lst' in flag:
version_script = os.path.join(build_common.get_target_common_dir(),
'android_gen_sources/GYP',
'shared_intermediates/android_exports.lst')
vars.get_ldflags()[idx] = '-Wl,--version-script=' + version_script
if OPTIONS.is_nacl_build():
# This causes libdl.so to be dropped for some reason, even when it provides
# the reference to the required dlerror function. Remove it.
vars.get_ldflags().remove('-Wl,--as-needed')
示例9: _compute_chrome_sandbox_params
# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import is_nacl_build [as 别名]
def _compute_chrome_sandbox_params(parsed_args):
params = []
if _is_no_sandbox_needed(parsed_args):
params.append('--no-sandbox')
if OPTIONS.is_bare_metal_build():
# Non-SFI NaCl helper, which heavily depends on seccomp-bpf,
# does not start without seccomp sandbox initialized unless we
# specify this flag explicitly.
params.append('--nacl-dangerous-no-sandbox-nonsfi')
# Environment variables to pass through to nacl_helper.
passthrough_env_vars = []
if OPTIONS.is_nacl_build() and parsed_args.disable_nacl_sandbox:
os.environ['NACL_DANGEROUS_ENABLE_FILE_ACCESS'] = '1'
passthrough_env_vars.append('NACL_DANGEROUS_ENABLE_FILE_ACCESS')
if OPTIONS.is_nacl_build() and parsed_args.enable_nacl_list_mappings:
os.environ['NACL_DANGEROUS_ENABLE_LIST_MAPPINGS'] = '1'
passthrough_env_vars.append('NACL_DANGEROUS_ENABLE_LIST_MAPPINGS')
if passthrough_env_vars:
os.environ['NACL_ENV_PASSTHROUGH'] = ','.join(passthrough_env_vars)
return params
示例10: _find_nacl_helper_pids
# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import is_nacl_build [as 别名]
def _find_nacl_helper_pids(chrome_pid):
if OPTIONS.is_nacl_build():
nacl_helper = 'nacl_helper$'
else:
nacl_helper = 'nacl_helper_nonsfi$'
pids = subprocess.check_output([
'pgrep',
# Use the full command-line to match against, because first 15
# chars are used without '-f' and nacl_helper_nonsfi is longer than that.
'-f',
nacl_helper]).split()
results = []
for pid in pids:
pid = int(pid)
if _is_descendent_of_pid(pid, chrome_pid):
results.append(pid)
return results
示例11: _filter_sources_for_openssl
# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import is_nacl_build [as 别名]
def _filter_sources_for_openssl(vars):
if OPTIONS.is_nacl_build():
# Disable asm enabling defines.
flags_to_remove = ['-DAES_ASM', '-DGHASH_ASM', '-DMD5_ASM',
'-DOPENSSL_BN_ASM_PART_WORDS', '-DOPENSSL_BN_ASM_GF2m',
'-DOPENSSL_BN_ASM_MONT', '-DOPENSSL_CPUID_OBJ',
'-DSHA1_ASM', '-DSHA256_ASM', '-DSHA512_ASM']
cflags_to_add = ['-DOPENSSL_NO_ASM', '-DOPENSSL_NO_INLINE_ASM']
_update_flags(vars, cflags_to_add, flags_to_remove)
sources = vars.get_sources()
# Drop asm sources, which don't work under NaCl for now. These asm files
# are for i686 or x86_64.
sources[:] = filter(lambda s: not s.endswith('.S') and '/asm/' not in s,
sources)
# Build C implementations instead.
replacement_sources = [
'aes/aes_cbc.c',
'aes/aes_core.c',
'bn/bn_asm.c',
'mem_clr.c']
if OPTIONS.is_i686():
replacement_sources.extend([
'bf/bf_enc.c',
'des/des_enc.c',
'des/fcrypt_b.c'])
if OPTIONS.is_x86_64():
replacement_sources.extend([
'rc4/rc4_enc.c',
'rc4/rc4_skey.c'])
for s in replacement_sources:
sources.append(
'android/external/chromium_org/third_party/openssl/openssl/crypto/'
+ s)
if OPTIONS.is_x86_64():
# Replace the sources that does not seem to work under NaCl x86_64.
# Especially chacha_vec.c includes code that assumes the bit size of
# size_t is 64 bit, which is not true under NaCl x86_64.
sources.remove('android/external/chromium_org/third_party/openssl/'
'openssl/crypto/chacha/chacha_vec.c')
sources.append('android/external/chromium_org/third_party/openssl/'
'openssl/crypto/chacha/chacha_enc.c')
sources.remove('android/external/chromium_org/third_party/openssl/'
'openssl/crypto/poly1305/poly1305_vec.c')
sources.append('android/external/chromium_org/third_party/openssl/'
'openssl/crypto/poly1305/poly1305.c')
示例12: _select_output_handler
# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import is_nacl_build [as 别名]
def _select_output_handler(parsed_args, stats, chrome_process, **kwargs):
if parsed_args.mode == 'atftest':
handler = output_handler.AtfTestHandler()
elif parsed_args.mode == 'perftest':
handler = output_handler.PerfTestHandler(
parsed_args, stats, chrome_process, **kwargs)
else:
handler = concurrent_subprocess.RedirectOutputHandler(
*['.*' + re.escape(suppress) for suppress in _SUPPRESS_LIST])
if 'gpu' in parsed_args.gdb or 'renderer' in parsed_args.gdb:
handler = gdb_util.GdbHandlerAdapter(
handler, parsed_args.gdb, parsed_args.gdb_type)
if 'plugin' in parsed_args.gdb:
if OPTIONS.is_nacl_build():
handler = gdb_util.NaClGdbHandlerAdapter(
handler, _get_nacl_irt_path(parsed_args), parsed_args.gdb_type)
elif OPTIONS.is_bare_metal_build():
handler = gdb_util.BareMetalGdbHandlerAdapter(
handler, _get_nacl_helper_nonsfi_path(parsed_args),
parsed_args.gdb_type)
if (parsed_args.enable_arc_strace and
parsed_args.arc_strace_output != 'stderr'):
handler = output_handler.ArcStraceFilter(
handler, parsed_args.arc_strace_output)
handler = output_handler.CrashAddressFilter(handler)
if not platform_util.is_running_on_remote_host():
# Filters that need to run on local host.
# See remote_executor_util.run_with_filter
handler = minidump_filter.MinidumpFilter(handler)
if parsed_args.jdb_port:
handler = jdb_util.JdbHandlerAdapter(
handler, parsed_args.jdb_port, parsed_args.jdb_type)
if parsed_args.chrome_flakiness_retry:
handler = output_handler.ChromeFlakinessHandler(handler, chrome_process)
return output_handler.ChromeStatusCodeHandler(handler)
示例13: _filter
# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import is_nacl_build [as 别名]
def _filter(vars):
if vars.is_executable():
return False
if vars.get_module_name() == 'lib64cutils':
assert vars.is_host()
return False
assert vars.get_module_name() == 'libcutils'
if vars.is_host():
# On host, we build libcutils.a only.
assert vars.is_static()
else:
# On target, we build both libutils_static.a and libutils.so.
# libutils_static.a is linked to unit tests.
if vars.is_static():
vars.set_module_name(vars.get_module_name() + '_static')
if vars.is_target() and vars.is_shared():
# libcutils.so links liblog.a because some legacy Android prebuilt
# binaries expect liblog symbols in libcutils.so. It is not the case
# with ARC, so do not static link liblog.a. See Android.mk for details.
vars.get_whole_archive_deps().remove('liblog')
# TODO(crbug.com/163446): Get the assembly working with nacl.
src = vars.get_sources()
# Not usable/compilable in ARC.
if vars.is_shared():
deps = vars.get_whole_archive_deps()
deps.remove('libcutils')
deps.append('libcutils_static')
else:
if not vars.is_host():
src.remove('android/system/core/libcutils/android_reboot.c')
src.remove('android/system/core/libcutils/iosched_policy.c')
# TODO(crbug.com/462555): L-rebase: enable assembly implementation.
# Use C implementation in memory.c for NaCl.
if OPTIONS.is_nacl_build():
vars.remove_c_or_cxxflag('-DHAVE_MEMSET16')
vars.remove_c_or_cxxflag('-DHAVE_MEMSET32')
src[:] = [x for x in src if not x.endswith('.S')]
return True
示例14: run_with_filter
# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import is_nacl_build [as 别名]
def run_with_filter(self, cmd, cwd=None):
if cwd is None:
cwd = self.get_remote_arc_root()
cmd = 'cd %s && %s' % (cwd, cmd)
handler = minidump_filter.MinidumpFilter(
concurrent_subprocess.RedirectOutputHandler())
if self._attach_nacl_gdb_type:
if OPTIONS.is_nacl_build():
handler = gdb_util.NaClGdbHandlerAdapter(
handler, None, self._attach_nacl_gdb_type,
remote_executor=self)
elif OPTIONS.is_bare_metal_build():
handler = gdb_util.BareMetalGdbHandlerAdapter(
handler, self._nacl_helper_nonsfi_binary,
self._attach_nacl_gdb_type, host=self._remote,
ssh_options=self.get_ssh_options(),
remote_executor=self)
if self._jdb_type and self._jdb_port:
handler = jdb_util.JdbHandlerAdapter(
handler, self._jdb_port, self._jdb_type, self)
return run_command_with_filter(self._build_ssh_command(cmd),
output_handler=handler)
示例15: _compute_chrome_debugging_params
# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import is_nacl_build [as 别名]
def _compute_chrome_debugging_params(parsed_args):
params = []
# This reduce one step necessary to enable filesystem inspector.
params.append('--enable-devtools-experiments')
if OPTIONS.is_nacl_build() and 'plugin' in parsed_args.gdb:
params.append('--enable-nacl-debug')
if len(parsed_args.gdb):
params.append('--disable-hang-monitor')
if 'gpu' in parsed_args.gdb:
params.append('--gpu-startup-dialog')
params.append('--disable-gpu-watchdog')
if 'renderer' in parsed_args.gdb:
params.append('--renderer-startup-dialog')
if parsed_args.enable_fake_video_source:
params.append('--use-fake-device-for-media-stream')
return params