本文整理汇总了Python中src.build.build_options.OPTIONS.is_arm方法的典型用法代码示例。如果您正苦于以下问题:Python OPTIONS.is_arm方法的具体用法?Python OPTIONS.is_arm怎么用?Python OPTIONS.is_arm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类src.build.build_options.OPTIONS
的用法示例。
在下文中一共展示了OPTIONS.is_arm方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _filter_cflags_for_chromium_org
# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import is_arm [as 别名]
def _filter_cflags_for_chromium_org(vars):
append_cflags = []
# TODO(http://crbug.com/509945): Use Gold once it's ready.
strip_flags = ['-fuse-ld=gold', '-march=pentium4', '-finline-limit=64']
if OPTIONS.is_arm():
# ARM clang does not support these flags.
strip_flags.extend(['-fno-partial-inlining', '-fno-early-inlining',
'-fno-tree-copy-prop', '-fno-tree-loop-optimize',
'-fno-move-loop-invariants',
'-Wa,-mimplicit-it=always'])
if not OPTIONS.is_bare_metal_build():
# nacl-clang supports -Oz, which is more aggressive than -Os.
strip_flags.append('-Os')
# TODO(crbug.com/346783): Remove this once we NaCl'ize PageAllocator.cpp.
# It is only necessary for NaCl, but we do this for linux as well
# to minimize platform differences.
append_cflags.append('-DMEMORY_TOOL_REPLACES_ALLOCATOR')
_update_flags(vars, append_cflags, strip_flags)
# -finline-limit=32 experimentally provides the smallest binary across
# the ni and nx targets. Also specify -finline-functions so all functions
# are candidates for inlining.
size_opts = ['-finline-limit=32', '-finline-functions']
if not OPTIONS.is_bare_metal_build():
# -Oz is not valid for asmflags, so just add it for C and C++.
vars.get_conlyflags().append('-Oz')
vars.get_cxxflags().append('-Oz')
# With these flags, compilers will not emit .eh_frame* sections and
# the size of libwebviewchromium.so reduces from 84MB to 75MB on L.
# As these options disables libgcc's _Unwind_Backtrace, we keep
# using them for non-production build. Note GDB and breakpad can
# produce backtraces without .eh_frame.
#
# It is intentional this condition is inconsistent with
# ninja_generator.py and make_to_ninja.py. Removing .eh_frame from
# production binary did not make a significant difference for file
# size of L. We would rather prefer keeping .eh_frame for
# _Unwind_Backtrace.
if not OPTIONS.is_debug_code_enabled():
size_opts += ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables']
vars.get_cflags()[:] = vars.get_cflags() + size_opts
# dlopen fails for the following undefined reference without -mthumb
# _ZN7WebCore26feLightingConstantsForNeonEv
# TODO(crbug.com/358333): Investigate if this is actually needed.
if OPTIONS.is_arm():
vars.get_cflags().append('-mthumb')
# OpenSSL makes wrong assumption that sizeof(long) == 8 under x86_64.
# Remove the x86_64-specific include path to fall back to x86 config.
# Note that this include path is set in many modules depending on OpenSSL,
# not limited to third_party_openssl_openssl_gyp.a itself.
if OPTIONS.is_nacl_x86_64():
openssl_x64_include = (
'android/external/chromium_org/third_party/openssl/config/x64')
includes = vars.get_includes()
if openssl_x64_include in includes:
includes.remove(openssl_x64_include)
示例2: _get_generate_libvpx_asm_ninja
# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import is_arm [as 别名]
def _get_generate_libvpx_asm_ninja():
if not OPTIONS.is_arm():
return None
gen_asm_ninja = ninja_generator.NinjaGenerator('libvpx_asm')
# Translate RVCT format assembly code into GNU Assembler format.
gen_asm_ninja.rule(
_GEN_LIBVPX_ASM_RULE,
command=_ADS2GAS + ' < $in > $out.tmp && (mv $out.tmp $out)')
# Translate C source code into assembly code and run grep to
# generate a list of constants. Assembly code generated by this rule
# will be included from other assembly code. See
# third_party/android/external/libvpx/libvpx.mk for corresponding
# rules written in Makefile.
asm_include_paths = [
'-I' + staging.as_staging('android/external/libvpx/armv7a-neon'),
'-I' + staging.as_staging('android/external/libvpx/libvpx')
]
gen_asm_ninja.rule(
_GEN_LIBVPX_OFFSETS_ASM_RULE,
command=('%s -DINLINE_ASM %s -S $in -o $out.s && '
'grep \'^[a-zA-Z0-9_]* EQU\' $out.s | '
'tr -d \'$$\\#\' | '
'%s > $out.tmp && (mv $out.tmp $out)' % (toolchain.get_tool(
OPTIONS.target(), 'cc'), ' '.join(asm_include_paths),
_ADS2GAS)))
return gen_asm_ninja
示例3: main
# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import is_arm [as 别名]
def main(args):
OPTIONS.parse_configure_file()
# TODO(crbug.com/378196): Make qemu-arm available in open source in order to
# run any unit tests there.
if open_source.is_open_source_repo() and OPTIONS.is_arm():
return 0
for test_name in args[1:]:
pipe = subprocess.Popen(['python', 'src/build/run_unittest.py',
test_name],
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
out = pipe.communicate()[0]
sys.stdout.write(out)
if pipe.returncode:
sys.stdout.write('FAIL (exit=%d)\n' % pipe.returncode)
sys.stdout.write(out + '\n')
return 1
elif out.find('PASS\n') < 0:
sys.stdout.write('FAIL (no PASS)\n')
sys.stdout.write(out + '\n')
return 1
else:
sys.stdout.write('OK\n')
return 0
示例4: _filter
# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import is_arm [as 别名]
def _filter(vars):
# Android uses two different C++ libraries: bionic's libstdc++ (instead of
# GCC's libstdc++) and clang's libc++ (only for ART and a few other
# libraries). STLport does not have compiler dependent functions (functions
# which are called from code generated by compiler), so use bionic's and
# link it into libstlport.so for simplicity.
vars.get_sources().extend([
'android/bionic/libc/bionic/new.cpp',
'android/bionic/libc/bionic/__cxa_guard.cpp',
'android/bionic/libc/bionic/__cxa_pure_virtual.cpp',
# Needed for __libc_fatal.
'android/bionic/libc/bionic/libc_logging.cpp'])
vars.get_includes().append('android/bionic/libc')
vars.get_includes().remove('android/bionic/libstdc++/include')
vars.get_sys_includes().remove('android/bionic/libstdc++/include')
# This is necessary to use atomic operations in bionic. 1 indicates
# compilation for symmetric multi-processor (0 for uniprocessor).
vars.get_cflags().append('-DANDROID_SMP=1')
if vars.is_shared():
# This is for not emitting syscall wrappers.
vars.get_shared_deps().extend(['libc', 'libm'])
# Note: libstlport.so must be a system library because other system
# libraries such as libchromium_ppapi.so and libposix_translation.so
# depend on it. We already have some ARC MODs against STLPort to make
# it work without --wrap, and the cost of maintaining the MODs seems
# very low because STLPort is not under active development anymore.
vars.get_generator_args()['is_system_library'] = True
# TODO(crbug.com/364344): Once Renderscript is built from source, this
# canned install can be removed.
if not OPTIONS.is_arm():
vars.set_canned_arm(True)
return True
示例5: main
# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import is_arm [as 别名]
def main():
# Disable line buffering
sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)
if not _configure_build_options():
return -1
_update_arc_version_file()
_ensure_downloads_up_to_date()
if not open_source.is_open_source_repo():
import sync_chrome
sync_chrome.run()
adb_target = 'linux-arm' if OPTIONS.is_arm() else 'linux-x86_64'
sync_adb.run(adb_target)
_set_up_internal_repo()
_gclient_sync_third_party()
_check_javac_version()
_cleanup_orphaned_pyc_files()
_set_up_git_hooks()
_set_up_chromium_org_submodules()
# Make sure the staging directory is up to date whenever configure
# runs to make it easy to generate rules by scanning directories.
staging.create_staging()
config_runner.generate_ninjas()
return 0
示例6: _filter_params_for_v8
# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import is_arm [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
示例7: _generate_check_symbols_ninja
# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import is_arm [as 别名]
def _generate_check_symbols_ninja():
# If we do not use NDK direct execution, the compatibility is less
# important.
if not build_common.use_ndk_direct_execution():
return
n = ninja_generator.NinjaGenerator('check_symbols')
script = staging.as_staging('src/build/check_symbols.py')
rule_name = 'check_symbols'
n.rule(rule_name,
command=('src/build/run_python %s $android_lib $in %s' % (
script, build_common.get_test_output_handler())),
description=(rule_name + ' $in'))
if OPTIONS.is_arm():
arch_subdir = 'arch-arm'
else:
arch_subdir = 'arch-x86'
lib_dir = os.path.join(_ANDROID_SYSTEM_IMAGE_DIR, arch_subdir, 'usr/lib')
for so_file in build_common.find_all_files(lib_dir, suffixes='.so'):
lib_name = os.path.basename(so_file)
if lib_name not in ['libc.so', 'libdl.so', 'libm.so']:
# For now, we only check Bionic.
# TODO(crbug.com/408548): Extend this for other libraries.
continue
result_path = os.path.join(build_common.get_build_dir(),
'check_symbols',
'check_symbols.%s.result' % lib_name)
n.build(result_path, rule_name,
build_common.get_build_path_for_library(lib_name),
variables={'android_lib': staging.as_staging(so_file)},
implicit=[script, staging.as_staging(so_file)])
示例8: _generate_jemalloc_integration_tests
# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import is_arm [as 别名]
def _generate_jemalloc_integration_tests():
paths = build_common.find_all_files(
'android/external/jemalloc/test/integration', ['.c'], include_tests=True)
# Disable some multi-threaded tests flaky under ARM qemu.
if OPTIONS.is_arm():
paths.remove('android/external/jemalloc/test/integration/MALLOCX_ARENA.c')
paths.remove('android/external/jemalloc/test/integration/thread_arena.c')
for path in paths:
name = os.path.splitext(os.path.basename(path))[0]
n = ninja_generator.TestNinjaGenerator('jemalloc_integartion_test_' + name)
n.add_include_paths(
'android/external/jemalloc/include',
'android/external/jemalloc/test/include')
n.add_c_flags('-Werror')
n.add_c_flags('-DJEMALLOC_INTEGRATION_TEST')
if OPTIONS.enable_jemalloc_debug():
n.add_c_flags('-DJEMALLOC_DEBUG')
# Needs C99 for "restrict" keyword.
n.add_c_flags('-std=gnu99')
n.add_library_deps('libjemalloc.a')
n.add_library_deps('libjemalloc_integrationtest.a')
n.build_default([path])
n.run(n.link(), enable_valgrind=OPTIONS.enable_valgrind(), rule='run_test')
示例9: _generate_jemalloc_unit_tests
# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import is_arm [as 别名]
def _generate_jemalloc_unit_tests():
paths = build_common.find_all_files(
'android/external/jemalloc/test/unit', ['.c'], include_tests=True)
# These tests need -DJEMALLOC_PROF which we do not enable.
paths.remove('android/external/jemalloc/test/unit/prof_accum.c')
paths.remove('android/external/jemalloc/test/unit/prof_accum_a.c')
paths.remove('android/external/jemalloc/test/unit/prof_accum_b.c')
paths.remove('android/external/jemalloc/test/unit/prof_gdump.c')
paths.remove('android/external/jemalloc/test/unit/prof_idump.c')
# Disable some multi-threaded tests flaky under ARM qemu.
if OPTIONS.is_arm():
paths.remove('android/external/jemalloc/test/unit/mq.c')
paths.remove('android/external/jemalloc/test/unit/mtx.c')
for path in paths:
name = os.path.splitext(os.path.basename(path))[0]
n = ninja_generator.TestNinjaGenerator('jemalloc_unit_test_' + name)
n.add_include_paths(
'android/external/jemalloc/include',
'android/external/jemalloc/test/include')
n.add_c_flags('-Werror')
n.add_c_flags('-DJEMALLOC_UNIT_TEST')
if OPTIONS.enable_jemalloc_debug():
n.add_c_flags('-DJEMALLOC_DEBUG')
# Needs C99 for "restrict" keyword.
n.add_c_flags('-std=gnu99')
n.add_library_deps('libjemalloc_jet.a')
n.add_library_deps('libjemalloc_unittest.a')
n.build_default([path])
n.run(n.link(), enable_valgrind=OPTIONS.enable_valgrind(), rule='run_test')
示例10: _filter_libvpx
# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import is_arm [as 别名]
def _filter_libvpx(vars, gen_asm_ninja):
# They only have some definitions of constants, and are meant to be
# included from other assembly code, so we do not need to compile
# them.
offset_asms = [
'vp8/encoder/vp8_asm_enc_offsets.asm',
'vpx_scale/vpx_scale_asm_offsets.asm'
]
for remove in offset_asms:
match = [m for m in vars.get_sources() if remove in m]
for m in match:
vars.get_sources().remove(m)
if OPTIONS.is_arm():
# Build the 'offsets' assembly files.
generated_offset_asms = []
for offset_asm in offset_asms:
generated_offset_asm_dir = os.path.join(
vars.get_android_gen_path(), os.path.dirname(offset_asm),
'arm/neon')
# The generated assembly code will be included from other
# files. Here we pass the appropriate include path.
vars.get_cflags().append('-Wa,-I' + generated_offset_asm_dir)
generated_offset_asm = os.path.join(generated_offset_asm_dir,
os.path.basename(offset_asm))
gen_asm_ninja.build(
generated_offset_asm,
_GEN_LIBVPX_OFFSETS_ASM_RULE,
staging.as_staging(
os.path.join('android/external/libvpx/libvpx',
offset_asm.replace('.asm', '.c'))),
implicit=[_ADS2GAS])
generated_offset_asms.append(generated_offset_asm)
# Translate RVCT format to GNU Assembler format.
for f in filter(lambda f: '/arm/' in f, vars.get_sources()):
if f.endswith('.asm.s'):
assert f.startswith(vars.get_android_gen_path())
source = f.replace(
vars.get_android_gen_path(),
staging.as_staging('android/external/libvpx/libvpx'))
source = source.replace('.asm.s', '.asm')
# We manually set generated_offset_asms as their implicit
# dependencies because our 'asm' compiler rule does not
# support ninja's 'deps' attribute.
gen_asm_ninja.build(
f,
_GEN_LIBVPX_ASM_RULE,
source,
implicit=[_ADS2GAS] + generated_offset_asms)
else:
# TODO(crbug.com/263712): Enable assembly code in libvpx for Bare
# Metal i686.
assert not gen_asm_ninja
# libvpx is used by libstagefright, libstagefright_soft_vpxdec and
# libwebviewchromium, hence 3 instances.
vars.set_instances_count(3)
return True
示例11: get_art_isa
# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import is_arm [as 别名]
def get_art_isa():
if OPTIONS.is_i686():
return "x86"
elif OPTIONS.is_x86_64():
return "x86_64"
elif OPTIONS.is_arm():
return "arm"
raise Exception("Unable to map target into an ART ISA: %s" % OPTIONS.target())
示例12: get_android_config_header
# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import is_arm [as 别名]
def get_android_config_header(is_host):
if is_host:
arch_subdir = "linux-x86"
elif OPTIONS.is_arm():
arch_subdir = "linux-arm"
else:
arch_subdir = "target_linux-x86"
return os.path.join(get_staging_root(), "android/build/core/combo/include/arch", arch_subdir, "AndroidConfig.h")
示例13: get_bionic_arch_name
# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import is_arm [as 别名]
def get_bionic_arch_name():
"""Returns Bionic's architecture name as used in sub directories.
The architecture name is used in sub directories like
android/bionic/libc/kernel/uapi/asm-arm.
android/bionic/libc/arch-arm.
"""
if OPTIONS.is_arm():
return "arm"
else:
return "x86"
示例14: _filter_sources_for_opus
# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import is_arm [as 别名]
def _filter_sources_for_opus(vars):
# TODO(crbug.com/414569): L-Rebase: This ARM-specific assembly file can be
# generated using a perl script, similar to how libvpx uses ads2gas.pl. For
# now, the generated file will be added directly to the mods/ directory, but
# we should centralize all gnu assembler-conversion somewhere.
if OPTIONS.is_arm():
sources = vars.get_sources()
pitch_correction_asm = 'celt_pitch_xcorr_arm_gnu.S'
sources.remove(os.path.join(vars.get_android_gen_path(),
pitch_correction_asm))
sources.append(os.path.join(vars.get_path(), 'third_party', 'opus', 'src',
'celt', 'arm', pitch_correction_asm))
# Opus complains when not building with optimization. Always enable them.
vars.force_optimization()
示例15: _filter_all_make_to_ninja
# 需要导入模块: from src.build.build_options import OPTIONS [as 别名]
# 或者: from src.build.build_options.OPTIONS import is_arm [as 别名]
def _filter_all_make_to_ninja(vars):
# All the following filters are only for the target.
if vars.is_host():
return True
if vars.is_java_library() and open_source.is_open_source_repo():
# We do not yet build all of the Java prerequisites in the open source
# repository.
return False
if vars.is_c_library() or vars.is_executable():
_filter_excluded_libs(vars)
if not OPTIONS.is_arm():
_filter_for_when_not_arm(vars)
return True