예제 #1
0
def _generate_test_framework_ninjas():
    # Build two versions of libgtest and libgmock that are built and linked with
    # STLport or libc++. It is used to build tests that depends on each library.
    _generate_gtest_ninja('libgtest', enable_libcxx=False)

    if not OPTIONS.run_tests():
        gtest_libcxx_instances = 0
    else:
        # libart-gtest.so, libarttest.so, and libnativebridgetest.so uses
        # libgtest_libc++.a. But when --disable-debug-code is specified,
        # libart-gtest.so is not built.
        if OPTIONS.is_debug_code_enabled():
            gtest_libcxx_instances = 3
        else:
            gtest_libcxx_instances = 2
    _generate_gtest_ninja('libgtest_libc++',
                          instances=gtest_libcxx_instances,
                          enable_libcxx=True)

    # libartd.so for host uses libgtest_host.a. Although it is built with
    # libc++, it is not named libgtest_libc++_host.a by Android.mk.
    if OPTIONS.is_debug_code_enabled():
        _generate_gtest_ninja('libgtest_host', host=True, enable_libcxx=True)

    _generate_gmock_ninja('libgmock', enable_libcxx=False)
    _generate_gmock_ninja('libgmock_libc++', enable_libcxx=True)
예제 #2
0
파일: config.py 프로젝트: zhangpf/arc
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
0
def generate_ninjas():
  needs_clobbering, cache_to_save = _set_up_generate_ninja()
  ninja_list, independent_ninja_cache = _generate_independent_ninjas(
      needs_clobbering)
  cache_to_save.extend(independent_ninja_cache)
  ninja_list.extend(
      _generate_shared_lib_depending_ninjas(ninja_list))
  ninja_list.extend(_generate_dependent_ninjas(ninja_list))

  top_level_ninja = _generate_top_level_ninja(ninja_list)
  ninja_list.append(top_level_ninja)

  # Run verification before emitting to files.
  _verify_ninja_generator_list(ninja_list)

  # Emit each ninja script to a file.
  timer = build_common.SimpleTimer()
  timer.start('Emitting ninja scripts', OPTIONS.verbose())
  for ninja in ninja_list:
    ninja.emit()
  top_level_ninja.emit_depfile()
  top_level_ninja.cleanup_out_directories(ninja_list)
  timer.done()

  if OPTIONS.enable_config_cache():
    for cache_object, cache_path in cache_to_save:
      cache_object.save_to_file(cache_path)
예제 #4
0
def main():
  OPTIONS.parse_configure_file()
  logging.getLogger().setLevel(logging.INFO)

  if len(sys.argv) != 3:
    logging.fatal('Usage: %s android-lib.so arc-lib.so' % sys.argv[0])
    return 1

  android_lib = sys.argv[1]
  arc_lib = sys.argv[2]

  android_syms = get_defined_symbols(android_lib)
  arc_syms = get_defined_symbols(arc_lib)

  missing_syms = set(android_syms - arc_syms)

  # Ignore symbols starting with two underscores since they are internal ones.
  # However, we do not ignore symbols starting with one underscore so that the
  # script can check symbols such as _Zxxx (mangled C++ symbols), _setjmp, and
  # _longjmp.
  important_missing_syms = [
      sym for sym in missing_syms if not sym.startswith('__')]

  if important_missing_syms:
    for sym in sorted(important_missing_syms):
      logging.error('Missing symbol: %s' % sym)
    return 1
  return 0
예제 #5
0
def main():
    OPTIONS.parse_configure_file()
    logging.getLogger().setLevel(logging.INFO)

    if len(sys.argv) != 3:
        logging.fatal('Usage: %s android-lib.so arc-lib.so' % sys.argv[0])
        return 1

    android_lib = sys.argv[1]
    arc_lib = sys.argv[2]

    android_syms = get_defined_symbols(android_lib)
    arc_syms = get_defined_symbols(arc_lib)

    missing_syms = set(android_syms - arc_syms)

    # Ignore symbols starting with two underscores since they are internal ones.
    # However, we do not ignore symbols starting with one underscore so that the
    # script can check symbols such as _Zxxx (mangled C++ symbols), _setjmp, and
    # _longjmp.
    important_missing_syms = [
        sym for sym in missing_syms if not sym.startswith('__')
    ]

    if important_missing_syms:
        for sym in sorted(important_missing_syms):
            logging.error('Missing symbol: %s' % sym)
        return 1
    return 0
예제 #6
0
파일: config.py 프로젝트: epowers/arc
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')
예제 #7
0
파일: config.py 프로젝트: epowers/arc
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')
예제 #8
0
파일: sync_arc_int.py 프로젝트: epowers/arc
def run():
  OPTIONS.parse_configure_file()

  # Check if internal/ exists. Run git-clone if not.
  if not os.path.isdir(_ARC_INTERNAL_DIR):
    # TODO(tandrii): Move this nacl-x86_64-bionic-internal recipe's botupdate
    # step.
    url = 'https://chrome-internal.googlesource.com/arc/internal-packages.git'
    logging.info('Cloning %s' % url)
    subprocess.check_call('git clone %s internal' % url,
                          cwd=_ARC_ROOT, shell=True)

  # On 'internal' mode, sync the HEAD to the DEPS revision.
  # On 'internal-dev', just use the current HEAD.
  if OPTIONS.internal_apks_source() == 'internal':
    # Check if internal/ is clean and on master.
    if _git_has_local_modification():
      logging.error('%s has local modification' % _ARC_INTERNAL_DIR)
      sys.exit(-1)

    # Check if internal/ is up to date. Run git-reset if not.
    with open(_DEPS_FILE) as f:
      target_revision = f.read().rstrip()
    logging.info('%s has %s' % (_DEPS_FILE, target_revision))
    if target_revision != _get_current_arc_int_revision():
      sync_repo(target_revision)

  # Run the configuration for the current HEAD revision. This steps includes
  # syncing internal/third_party/ repositories when needed.
  subprocess.check_call(os.path.join(_ARC_INTERNAL_DIR, 'build/configure.py'))

  return 0
예제 #9
0
def main():
    OPTIONS.parse_configure_file()
    target = OPTIONS.target()
    regular_expectations = _get_expectations()
    large_expectations = _get_expectations(['--include-large'])
    for botname in os.listdir(_BOTLOGS_DIR):
        if not botname.replace('-', '_').startswith(target):
            continue
        botdir = os.path.join(_BOTLOGS_DIR, botname)
        lognames = [
            os.path.join(botdir, filename) for filename in os.listdir(botdir)
        ]
        failures, incompletes = _parse(lognames)
        top_flake = sorted([(freq, name)
                            for name, freq in failures.iteritems()],
                           reverse=True)
        print '%s:' % botname
        if 'large_tests' in botname:
            expectations = large_expectations
        else:
            expectations = regular_expectations
        for freq, name in top_flake:
            assert name in expectations, '%s is not in expectations list' % name
            run, flags = expectations[name]
            if run == 'SKIP':
                continue
            failrate = 100.0 * freq / float(len(lognames))
            print '%5.2f%% fail rate [%-4s %-19s] %s' % (failrate, run,
                                                         ','.join(flags), name)
        print
    return 0
예제 #10
0
파일: config.py 프로젝트: nehz/google-arc
def generate_ninjas():
    base_path = os.path.join("graphics_translation", "egl")

    n = ninja_generator.ArchiveNinjaGenerator("libegl", force_compiler="clang", enable_cxx11=True, base_path=base_path)
    n.add_compiler_flags("-Werror")
    n.add_notice_sources(["mods/graphics_translation/NOTICE"])
    n.add_include_paths(
        "mods",
        "android/system/core/include",
        "android/hardware/libhardware/include",
        "android/frameworks/native/include",
        "android/frameworks/native/opengl/include",
    )

    n.emit_gl_common_flags(False)
    n.add_ppapi_compile_flags()
    if OPTIONS.is_egl_api_tracing():
        n.add_defines("ENABLE_API_TRACING")
    if OPTIONS.is_egl_api_logging():
        n.add_defines("ENABLE_API_LOGGING")
    if OPTIONS.is_ansi_fb_logging():
        n.add_defines("ANSI_FB_LOGGING")

    sources = n.find_all_sources()
    n.build_default(sources, base_path="mods")
    n.archive()
예제 #11
0
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
예제 #12
0
파일: config.py 프로젝트: nehz/google-arc
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
예제 #13
0
def _process_args(raw_args):
    args = parse_args(raw_args)
    logging_util.setup(
        level=logging.DEBUG if args.output == 'verbose' else logging.WARNING)

    OPTIONS.parse_configure_file()

    # Limit to one job at a time when running a suite multiple times.  Otherwise
    # suites start interfering with each others operations and bad things happen.
    if args.repeat_runs > 1:
        args.jobs = 1

    if args.buildbot and OPTIONS.weird():
        args.exclude_patterns.append('cts.*')

    # Fixup all patterns to at least be a prefix match for all tests.
    # This allows options like "-t cts.CtsHardwareTestCases" to work to select all
    # the tests in the suite.
    args.include_patterns = [(pattern if '*' in pattern else (pattern + '*'))
                             for pattern in args.include_patterns]
    args.exclude_patterns = [(pattern if '*' in pattern else (pattern + '*'))
                             for pattern in args.exclude_patterns]

    set_test_global_state(args)

    if (not args.remote and args.buildbot
            and not platform_util.is_running_on_cygwin()):
        print_chrome_version()

    if platform_util.is_running_on_remote_host():
        args.run_ninja = False

    return args
예제 #14
0
def _set_up_internal_repo():
    if OPTIONS.internal_apks_source_is_internal():
        # Checkout internal/ repository if needed, and sync internal/third_party/*
        # to internal/build/DEPS.*.  The files needs to be re-staged and is done
        # in staging.create_staging.
        subprocess.check_call('src/build/sync_arc_int.py')

    # Create a symlink to the integration_test definition directory, either in the
    # internal repository checkout or in the downloaded archive.
    # It is used to determine the definitions loaded in run_integration_tests.py
    # without relying on OPTIONS. Otherwise, run_integration_tests_test may fail
    # due to the mismatch between the expectations and the actual test apk since
    # it always runs under the default OPTIONS.
    if OPTIONS.internal_apks_source_is_internal():
        test_dir = 'internal/integration_tests'
    else:
        test_dir = 'out/internal-apks/integration_tests'

    symlink_location = 'out/internal-apks-integration-tests'
    if not os.path.islink(symlink_location) and os.path.isdir(
            symlink_location):
        # TODO(crbug.com/517306): This is a short-term fix for making bots green.
        # Remove once we implement a more proper solution (like, isolating the
        # test bundle extraction directory from the checkout, or stop running
        # ./configure on test-only builders.)
        #
        # 'Test only' bots extracts a directory structure from test-bundle zip, so
        # in that case we don't need to create a symlink.
        print 'WARNING: A directory exists at %s.' % symlink_location
        print 'WARNING: If not on test-only bot, gms test expectation may be stale.'
    else:
        # Otherwise, (re)create the link.
        file_util.create_link(symlink_location, test_dir, overwrite=True)
예제 #15
0
파일: config.py 프로젝트: epowers/arc
def _generate_test_framework_ninjas():
  # Build two versions of libgtest and libgmock that are built and linked with
  # STLport or libc++. It is used to build tests that depends on each library.
  _generate_gtest_ninja('libgtest', enable_libcxx=False)

  if not OPTIONS.run_tests():
    gtest_libcxx_instances = 0
  else:
    # libart-gtest.so, libarttest.so, and libnativebridgetest.so uses
    # libgtest_libc++.a. But when --disable-debug-code is specified,
    # libart-gtest.so is not built.
    if OPTIONS.is_debug_code_enabled():
      gtest_libcxx_instances = 3
    else:
      gtest_libcxx_instances = 2
  _generate_gtest_ninja('libgtest_libc++',
                        instances=gtest_libcxx_instances, enable_libcxx=True)

  # libartd.so for host uses libgtest_host.a. Although it is built with
  # libc++, it is not named libgtest_libc++_host.a by Android.mk.
  if OPTIONS.is_debug_code_enabled():
    _generate_gtest_ninja('libgtest_host', host=True, enable_libcxx=True)

  _generate_gmock_ninja('libgmock', enable_libcxx=False)
  _generate_gmock_ninja('libgmock_libc++', enable_libcxx=True)
예제 #16
0
def _generate_shared_lib_depending_ninjas(ninja_list):
  timer = build_common.SimpleTimer()

  timer.start('Generating plugin and packaging ninjas', OPTIONS.verbose())
  # We must generate plugin/nexe ninjas after make->ninja lazy generation
  # so that we have the full list of production shared libraries to
  # pass to the load test.
  # These modules depend on shared libraries generated in the previous phase.
  production_shared_libs = (
      ninja_generator.NinjaGenerator.get_production_shared_libs(ninja_list[:]))
  generator_list = list(_list_ninja_generators(
      _config_loader, 'generate_shared_lib_depending_ninjas'))

  if OPTIONS.run_tests():
    generator_list.extend(_list_ninja_generators(
        _config_loader, 'generate_shared_lib_depending_test_ninjas'))

  result_list = ninja_generator_runner.run_in_parallel(
      [ninja_generator_runner.GeneratorTask(
          config_context,
          (generator, production_shared_libs))
       for config_context, generator in generator_list],
      OPTIONS.configure_jobs())
  ninja_list = []
  for config_result in result_list:
    ninja_list.extend(config_result.generated_ninjas)
  ninja_list.sort(key=lambda ninja: ninja.get_module_name())

  timer.done()
  return ninja_list
예제 #17
0
def _stub_parse_configure_file():
  """A helper function for trapping calls to read the build options file.

  Populate them with the default build configuration instead, so this test
  behaves the same regardless of the actual configuration.
  """
  OPTIONS.parse([])
예제 #18
0
파일: config.py 프로젝트: zhangpf/arc
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')
예제 #19
0
def main():
    OPTIONS.parse_configure_file()
    target = OPTIONS.target()
    regular_expectations = _get_expectations()
    large_expectations = _get_expectations(["--include-large"])
    for botname in os.listdir(_BOTLOGS_DIR):
        if not botname.replace("-", "_").startswith(target):
            continue
        botdir = os.path.join(_BOTLOGS_DIR, botname)
        lognames = [os.path.join(botdir, filename) for filename in os.listdir(botdir)]
        failures, incompletes = _parse(lognames)
        top_flake = sorted([(freq, name) for name, freq in failures.iteritems()], reverse=True)
        print "%s:" % botname
        if "large_tests" in botname:
            expectations = large_expectations
        else:
            expectations = regular_expectations
        for freq, name in top_flake:
            assert name in expectations, "%s is not in expectations list" % name
            run, flags = expectations[name]
            if run == "SKIP":
                continue
            failrate = 100.0 * freq / float(len(lognames))
            print "%5.2f%% fail rate [%-4s %-19s] %s" % (failrate, run, ",".join(flags), name)
        print
    return 0
예제 #20
0
def _process_args(raw_args):
  args = parse_args(raw_args)
  logging_util.setup(
      level=logging.DEBUG if args.output == 'verbose' else logging.WARNING)

  OPTIONS.parse_configure_file()

  # Limit to one job at a time when running a suite multiple times.  Otherwise
  # suites start interfering with each others operations and bad things happen.
  if args.repeat_runs > 1:
    args.jobs = 1

  if args.buildbot and OPTIONS.weird():
    args.exclude_patterns.append('cts.*')

  # Fixup all patterns to at least be a prefix match for all tests.
  # This allows options like "-t cts.CtsHardwareTestCases" to work to select all
  # the tests in the suite.
  args.include_patterns = [(pattern if '*' in pattern else (pattern + '*'))
                           for pattern in args.include_patterns]
  args.exclude_patterns = [(pattern if '*' in pattern else (pattern + '*'))
                           for pattern in args.exclude_patterns]

  set_test_global_state(args)

  if (not args.remote and args.buildbot and
      not platform_util.is_running_on_cygwin()):
    print_chrome_version()

  if platform_util.is_running_on_remote_host():
    args.run_ninja = False

  return args
예제 #21
0
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
예제 #22
0
파일: configure.py 프로젝트: epowers/arc
def _set_up_internal_repo():
  if OPTIONS.internal_apks_source_is_internal():
    # Checkout internal/ repository if needed, and sync internal/third_party/*
    # to internal/build/DEPS.*.  The files needs to be re-staged and is done
    # in staging.create_staging.
    subprocess.check_call('src/build/sync_arc_int.py')

  # Create a symlink to the integration_test definition directory, either in the
  # internal repository checkout or in the downloaded archive.
  # It is used to determine the definitions loaded in run_integration_tests.py
  # without relying on OPTIONS. Otherwise, run_integration_tests_test may fail
  # due to the mismatch between the expectations and the actual test apk since
  # it always runs under the default OPTIONS.
  if OPTIONS.internal_apks_source_is_internal():
    test_dir = 'internal/integration_tests'
  else:
    test_dir = 'out/internal-apks/integration_tests'

  symlink_location = 'out/internal-apks-integration-tests'
  if not os.path.islink(symlink_location) and os.path.isdir(symlink_location):
    # TODO(crbug.com/517306): This is a short-term fix for making bots green.
    # Remove once we implement a more proper solution (like, isolating the
    # test bundle extraction directory from the checkout, or stop running
    # ./configure on test-only builders.)
    #
    # 'Test only' bots extracts a directory structure from test-bundle zip, so
    # in that case we don't need to create a symlink.
    print 'WARNING: A directory exists at %s.' % symlink_location
    print 'WARNING: If not on test-only bot, gms test expectation may be stale.'
  else:
    # Otherwise, (re)create the link.
    file_util.create_link(symlink_location, test_dir, overwrite=True)
예제 #23
0
    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)
예제 #24
0
def _convert_launch_chrome_options_to_external_metadata(parsed_args):
  metadata = parsed_args.additional_metadata

  for definition in manager.get_metadata_definitions():
    value = getattr(parsed_args, definition.python_name, None)
    if value is not None:
      metadata[definition.name] = value

  if bool(parsed_args.jdb_port or parsed_args.gdb):
    metadata['disableChildPluginRetry'] = True
    metadata['disableHeartbeat'] = True
    metadata['sleepOnBlur'] = False

  if (parsed_args.mode == 'atftest' or parsed_args.mode == 'system' or
      OPTIONS.get_system_packages()):
    # An app may briefly go through empty stack while running
    # addAccounts() in account manager service.
    # TODO(igorc): Find a more precise detection mechanism to support GSF,
    # implement empty stack timeout, or add a flag if this case is more common.
    metadata['allowEmptyActivityStack'] = True

  command = _generate_shell_command(parsed_args)
  if command:
    metadata['shell'] = command

  metadata['isDebugCodeEnabled'] = OPTIONS.is_debug_code_enabled()

  return metadata
예제 #25
0
파일: config.py 프로젝트: zhangpf/arc
def generate_ninjas():
    base_path = os.path.join('graphics_translation', 'egl')

    n = ninja_generator.ArchiveNinjaGenerator('libegl',
                                              force_compiler='clang',
                                              enable_cxx11=True,
                                              base_path=base_path)
    n.add_compiler_flags('-Werror')
    n.add_notice_sources(['mods/graphics_translation/NOTICE'])
    n.add_include_paths('mods', 'android/system/core/include',
                        'android/hardware/libhardware/include',
                        'android/frameworks/native/include',
                        'android/frameworks/native/opengl/include')

    n.emit_gl_common_flags(False)
    n.add_ppapi_compile_flags()
    if OPTIONS.is_egl_api_tracing():
        n.add_defines('ENABLE_API_TRACING')
    if OPTIONS.is_egl_api_logging():
        n.add_defines('ENABLE_API_LOGGING')
    if OPTIONS.is_ansi_fb_logging():
        n.add_defines('ANSI_FB_LOGGING')

    sources = n.find_all_sources()
    n.build_default(sources, base_path='mods')
    n.archive()
예제 #26
0
파일: perf_test.py 프로젝트: zhangpf/arc
def main():
    OPTIONS.parse_configure_file()
    parser = argparse.ArgumentParser(
        description=__doc__, formatter_class=argparse.RawTextHelpFormatter)
    parser.add_argument('mode', choices=_TEST_CLASS_MAP.keys())
    parser.add_argument(
        '--iterations',
        default=20,
        type=int,
        help=('Number of iterations to run after warmup phase. '
              'The default is 20.'))
    parser.add_argument('--test-mode',
                        action='store_true',
                        help='Test mode. Parse %s and exit.' %
                        _OUTPUT_LOG_FILE)
    parser.add_argument('--verbose',
                        '-v',
                        action='store_true',
                        help='Verbose mode')

    remote_executor.add_remote_arguments(parser)

    args = parser.parse_args()
    remote_executor.maybe_detect_remote_host_type(args)
    logging_util.setup(
        level=logging.DEBUG if args.verbose else logging.WARNING)

    clazz = create_test_class(args.mode)
    clazz(args).main()
예제 #27
0
def run():
    OPTIONS.parse_configure_file()

    # Check if internal/ exists. Run git-clone if not.
    if not os.path.isdir(_ARC_INTERNAL_DIR):
        # TODO(tandrii): Move this nacl-x86_64-bionic-internal recipe's botupdate
        # step.
        url = 'https://chrome-internal.googlesource.com/arc/internal-packages.git'
        logging.info('Cloning %s' % url)
        subprocess.check_call('git clone %s internal' % url,
                              cwd=_ARC_ROOT,
                              shell=True)

    # On 'internal' mode, sync the HEAD to the DEPS revision.
    # On 'internal-dev', just use the current HEAD.
    if OPTIONS.internal_apks_source() == 'internal':
        # Check if internal/ is clean and on master.
        if _git_has_local_modification():
            logging.error('%s has local modification' % _ARC_INTERNAL_DIR)
            sys.exit(-1)

        # Check if internal/ is up to date. Run git-reset if not.
        with open(_DEPS_FILE) as f:
            target_revision = f.read().rstrip()
        logging.info('%s has %s' % (_DEPS_FILE, target_revision))
        if target_revision != _get_current_arc_int_revision():
            sync_repo(target_revision)

    # Run the configuration for the current HEAD revision. This steps includes
    # syncing internal/third_party/ repositories when needed.
    subprocess.check_call(os.path.join(_ARC_INTERNAL_DIR,
                                       'build/configure.py'))

    return 0
예제 #28
0
파일: config.py 프로젝트: zhangpf/arc
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')
예제 #29
0
파일: config.py 프로젝트: zhangpf/arc
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
예제 #30
0
파일: symbol_tool.py 프로젝트: zhangpf/arc
def main():
    description = 'Tool to manipulate symbol list files.'
    parser = argparse.ArgumentParser(description=description)
    parser.add_argument(
        '--dump-defined',
        action='store_true',
        help='Dump defined symbols from the given shared object.')
    parser.add_argument(
        '--dump-undefined',
        action='store_true',
        help='Dump defined symbols from the given shared object.')
    parser.add_argument('--clean',
                        action='store_true',
                        help='Copy symbols file with comments stripped.')
    parser.add_argument(
        '--verify',
        action='store_true',
        help='Verify that file 1 does not contain symbols listed in file 2.')
    parser.add_argument('args', nargs=argparse.REMAINDER)

    args = parser.parse_args()

    OPTIONS.parse_configure_file()
    nm = toolchain.get_tool(OPTIONS.target(), 'nm')

    if args.dump_defined:
        command = (nm + ' --defined-only --extern-only --format=posix %s | '
                   'sed -n \'s/^\(.*\) [A-Za-z].*$/\\1/p\' | '
                   'LC_ALL=C sort -u' % args.args[0])
        return subprocess.check_call(command, shell=True)

    elif args.dump_undefined:
        command = (nm + ' --undefined-only --format=posix %s | '
                   'sed -n \'s/^\(.*\) U.*$/\\1/p\' | '
                   'LC_ALL=C sort -u' % args.args[0])
        return subprocess.check_call(command, shell=True)

    elif args.clean:
        command = ('egrep -ve "^#" %s | LC_ALL=C sort' % args.args[0])
        return subprocess.check_call(command, shell=True)

    elif args.verify:
        command = ('LC_ALL=C comm -12 %s %s' % (args.args[0], args.args[1]))
        try:
            diff = subprocess.check_output(command,
                                           shell=True,
                                           stderr=subprocess.STDOUT)
        except subprocess.CalledProcessError as e:
            # This can happen if files are not sorted
            print e.output.rstrip()
            return 1
        if diff:
            print '%s has disallowed symbols: ' % (args.args[0])
            print diff.rstrip()
            return 1
        return 0

    print 'No command specified.'
    return 1
예제 #31
0
파일: build_common.py 프로젝트: zhangpf/arc
def get_chrome_prebuilt_arch_bits():
    # Use 32-bit version of Chrome on Windows regardless of the target bit size.
    if platform_util.is_running_on_cygwin():
        return '32'
    elif OPTIONS.is_x86_64() or OPTIONS.is_bare_metal_i686():
        return '64'
    else:
        return '32'
예제 #32
0
파일: build_common.py 프로젝트: zhangpf/arc
def _get_ninja_jobs_argument():
    # -j200 might be good because having more tasks doesn't help a
    # lot and Z620 doesn't die even if everything runs locally for
    # some reason.
    if OPTIONS.set_up_goma():
        OPTIONS.wait_for_goma_ctl()
        return ['-j200', '-l40']
    return []
예제 #33
0
def main():
  args = _parse_args()
  logging_util.setup()
  OPTIONS.parse_configure_file()
  if args.mode == 'stackwalk':
    _stackwalk(args.minidump)
  elif args.mode == 'dump':
    _dump(args.minidump)
예제 #34
0
def _get_ninja_jobs_argument():
    # -j200 might be good because having more tasks doesn't help a
    # lot and Z620 doesn't die even if everything runs locally for
    # some reason.
    if OPTIONS.set_up_goma():
        OPTIONS.wait_for_goma_ctl()
        return ["-j200", "-l40"]
    return []
예제 #35
0
def get_chrome_prebuilt_arch_bits():
    # Use 32-bit version of Chrome on Windows regardless of the target bit size.
    if platform_util.is_running_on_cygwin():
        return "32"
    elif OPTIONS.is_x86_64() or OPTIONS.is_bare_metal_i686():
        return "64"
    else:
        return "32"
예제 #36
0
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())
예제 #37
0
def main():
  OPTIONS.parse_configure_file()
  args = _parse_args()
  for arg in args.target_files:
    with open(arg) as f:
      analyzer = CrashAnalyzer(is_annotating=args.annotate)
      for line in f:
        if analyzer.handle_line(line):
          print analyzer.get_crash_report()
예제 #38
0
def main():
    OPTIONS.parse_configure_file()
    args = _parse_args()
    for arg in args.target_files:
        with open(arg) as f:
            analyzer = CrashAnalyzer(is_annotating=args.annotate)
            for line in f:
                if analyzer.handle_line(line):
                    print analyzer.get_crash_report()
예제 #39
0
파일: build_common.py 프로젝트: zhangpf/arc
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())
예제 #40
0
파일: config.py 프로젝트: zhangpf/arc
def _filter_sources_for_webkit_asm(vars):
  # Add one arch-specific assembly.
  sources = vars.get_sources()
  path = os.path.join(vars.get_path(),
                      'third_party/WebKit/Source/platform/heap/asm')
  if OPTIONS.is_i686():
    sources.append(os.path.join(path, 'SaveRegisters_x86.S'))
  elif OPTIONS.is_x86_64():
    sources.append(os.path.join(path, 'SaveRegisters_x86_64.S'))
예제 #41
0
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)
예제 #42
0
파일: toolchain.py 프로젝트: epowers/arc
def get_target_runner(bin_dir=None, extra_library_paths=None, extra_envs=None):
  if OPTIONS.is_bare_metal_build():
    return get_bare_metal_runner(bin_dir=bin_dir,
                                 extra_library_paths=extra_library_paths,
                                 extra_envs=extra_envs)
  else:
    return get_nacl_runner(OPTIONS.get_target_bitsize(), bin_dir=bin_dir,
                           extra_library_paths=extra_library_paths,
                           extra_envs=extra_envs)
예제 #43
0
    def build_gms_core_or_use_prebuilt(self):
        if OPTIONS.enable_art_aot():
            # Rule for pre-optimizing gms-core apk.
            boot_image_dir = os.path.join(build_common.get_android_fs_root(),
                                          'system/framework',
                                          build_common.get_art_isa())
            self.rule(
                'gms_core_apk_preoptimize',
                'src/build/gms_core_apk_preoptimize.py --input $in --output $out',
                description='Preoptimizing gmscore sub apks contained in $in')
            self.build(GmsCoreNinjaGenerator._APK_PATH,
                       'gms_core_apk_preoptimize',
                       GmsCoreNinjaGenerator._ORIGINAL_APK_PATH,
                       implicit=[
                           toolchain.get_tool('java', 'dex2oat'),
                           os.path.join(boot_image_dir, 'boot.art'),
                           os.path.join(boot_image_dir, 'boot.oat')
                       ])

        if not OPTIONS.internal_apks_source_is_internal():
            return

        flags = '--eng' if OPTIONS.is_debug_code_enabled() else ''
        build_log = os.path.join('out/gms-core-build/build.log')
        command = ('internal/build/build.py gms-core %s > %s 2>&1 || '
                   '(cat %s; exit 1)') % (flags, build_log, build_log)

        if OPTIONS.internal_apks_source() == 'internal-dev':
            # Only for local development.  play-services.apk dependes on jars below to
            # build, just to use ARC specific feature like ArcMessageBridge and
            # Tracing.  This dependency is a must-have for a clean build.  But this
            # dependency can cause unrelated framework change to trigger rebuild of
            # play-services.apk, which is very slow.  With this option, eng will self
            # manages the dependency, which is almost always satisfied.
            jars = []
        else:
            # Simply make these jars the dependencies of gms-core-build, which
            # references ArcMessage and ArcMessageBridge in the jar.  Note that these
            # jars changes often and is like to cause unnecessary rebuild of gms-core,
            # which is very slow.  We may think about a way to minimize the
            # dependency.
            #
            # See also: internal/mods/gms-core/vendor/unbundled_google/packages/ \
            #     OneUp/package/Android.mk
            #     OneUp/package/generate_package.mk
            jars = [
                build_common.get_build_path_for_jar('arc-services-framework',
                                                    subpath='classes.jar'),
                build_common.get_build_path_for_jar('framework',
                                                    subpath='classes.jar'),
            ]

        self.build(GmsCoreNinjaGenerator._ALL_OUTPUTS,
                   'run_shell_command',
                   implicit=['src/build/DEPS.arc-int'] + jars,
                   variables={'command': command})
예제 #44
0
def main():
  OPTIONS.parse_configure_file()

  functions = []
  for function in wrapped_functions.get_wrapped_functions():
    functions.append('  { "%s", reinterpret_cast<void*>(%s) },' %
                     (function, function))
  sys.stdout.write(_WRAPPED_FUNCTIONS_CC_TEMPLATE.substitute({
      'WRAPPED_FUNCTIONS': '\n'.join(functions)
  }))
예제 #45
0
파일: toolchain.py 프로젝트: zhangpf/arc
def get_target_runner(bin_dir=None, extra_library_paths=None, extra_envs=None):
    if OPTIONS.is_bare_metal_build():
        return get_bare_metal_runner(bin_dir=bin_dir,
                                     extra_library_paths=extra_library_paths,
                                     extra_envs=extra_envs)
    else:
        return get_nacl_runner(OPTIONS.get_target_bitsize(),
                               bin_dir=bin_dir,
                               extra_library_paths=extra_library_paths,
                               extra_envs=extra_envs)
예제 #46
0
파일: symbol_tool.py 프로젝트: epowers/arc
def main():
  description = 'Tool to manipulate symbol list files.'
  parser = argparse.ArgumentParser(description=description)
  parser.add_argument(
      '--dump-defined', action='store_true',
      help='Dump defined symbols from the given shared object.')
  parser.add_argument(
      '--dump-undefined', action='store_true',
      help='Dump defined symbols from the given shared object.')
  parser.add_argument(
      '--clean', action='store_true',
      help='Copy symbols file with comments stripped.')
  parser.add_argument(
      '--verify', action='store_true',
      help='Verify that file 1 does not contain symbols listed in file 2.')
  parser.add_argument('args', nargs=argparse.REMAINDER)

  args = parser.parse_args()

  OPTIONS.parse_configure_file()
  nm = toolchain.get_tool(OPTIONS.target(), 'nm')

  if args.dump_defined:
    command = (nm + ' --defined-only --extern-only --format=posix %s | '
               'sed -n \'s/^\(.*\) [A-Za-z].*$/\\1/p\' | '
               'LC_ALL=C sort -u' % args.args[0])
    return subprocess.check_call(command, shell=True)

  elif args.dump_undefined:
    command = (nm + ' --undefined-only --format=posix %s | '
               'sed -n \'s/^\(.*\) U.*$/\\1/p\' | '
               'LC_ALL=C sort -u' % args.args[0])
    return subprocess.check_call(command, shell=True)

  elif args.clean:
    command = ('egrep -ve "^#" %s | LC_ALL=C sort' % args.args[0])
    return subprocess.check_call(command, shell=True)

  elif args.verify:
    command = ('LC_ALL=C comm -12 %s %s' % (args.args[0], args.args[1]))
    try:
      diff = subprocess.check_output(command, shell=True,
                                     stderr=subprocess.STDOUT)
    except subprocess.CalledProcessError as e:
      # This can happen if files are not sorted
      print e.output.rstrip()
      return 1
    if diff:
      print '%s has disallowed symbols: ' % (args.args[0])
      print diff.rstrip()
      return 1
    return 0

  print 'No command specified.'
  return 1
예제 #47
0
  def build_gms_core_or_use_prebuilt(self):
    if OPTIONS.enable_art_aot():
      # Rule for pre-optimizing gms-core apk.
      boot_image_dir = os.path.join(build_common.get_android_fs_root(),
                                    'system/framework',
                                    build_common.get_art_isa())
      self.rule(
          'gms_core_apk_preoptimize',
          'src/build/gms_core_apk_preoptimize.py --input $in --output $out',
          description='Preoptimizing gmscore sub apks contained in $in')
      self.build(GmsCoreNinjaGenerator._APK_PATH,
                 'gms_core_apk_preoptimize',
                 GmsCoreNinjaGenerator._ORIGINAL_APK_PATH,
                 implicit=[toolchain.get_tool('java', 'dex2oat'),
                           os.path.join(boot_image_dir, 'boot.art'),
                           os.path.join(boot_image_dir, 'boot.oat')])

    if not OPTIONS.internal_apks_source_is_internal():
      return

    flags = '--eng' if OPTIONS.is_debug_code_enabled() else ''
    build_log = os.path.join('out/gms-core-build/build.log')
    command = ('internal/build/build.py gms-core %s > %s 2>&1 || '
               '(cat %s; exit 1)') % (flags, build_log, build_log)

    if OPTIONS.internal_apks_source() == 'internal-dev':
      # Only for local development.  play-services.apk dependes on jars below to
      # build, just to use ARC specific feature like ArcMessageBridge and
      # Tracing.  This dependency is a must-have for a clean build.  But this
      # dependency can cause unrelated framework change to trigger rebuild of
      # play-services.apk, which is very slow.  With this option, eng will self
      # manages the dependency, which is almost always satisfied.
      jars = []
    else:
      # Simply make these jars the dependencies of gms-core-build, which
      # references ArcMessage and ArcMessageBridge in the jar.  Note that these
      # jars changes often and is like to cause unnecessary rebuild of gms-core,
      # which is very slow.  We may think about a way to minimize the
      # dependency.
      #
      # See also: internal/mods/gms-core/vendor/unbundled_google/packages/ \
      #     OneUp/package/Android.mk
      #     OneUp/package/generate_package.mk
      jars = [
          build_common.get_build_path_for_jar('arc-services-framework',
                                              subpath='classes.jar'),
          build_common.get_build_path_for_jar('framework',
                                              subpath='classes.jar'),
      ]

    self.build(GmsCoreNinjaGenerator._ALL_OUTPUTS,
               'run_shell_command',
               implicit=['src/build/DEPS.arc-int'] + jars,
               variables={'command': command})
예제 #48
0
    def get_crash_report(self):
        assert self._crash_addr is not None
        for binary_name, start_addr, end_addr in self._text_segments:
            if start_addr > self._crash_addr or self._crash_addr >= end_addr:
                continue

            addr = self._crash_addr
            # For PIC or PIE, we need to subtract the load bias.
            if binary_name.endswith('.so') or OPTIONS.is_bare_metal_build():
                addr -= start_addr

            if os.path.exists(binary_name):
                binary_filename = binary_name
            else:
                self.init_binary_map()
                if binary_name not in self._binary_map:
                    return '%s %x (binary file not found)\n' % (binary_name,
                                                                addr)
                binary_filename = self._binary_map[binary_name]

            pipe = subprocess.Popen([
                toolchain.get_tool(OPTIONS.target(), 'addr2line'), '-e',
                binary_filename
            ],
                                    stdin=subprocess.PIPE,
                                    stdout=subprocess.PIPE,
                                    stderr=subprocess.STDOUT)
            addr2line_result = pipe.communicate('%x\n' % addr)[0]

            # We can always get clean result using 32 byte aligned start
            # address as NaCl binary does never overlap 32 byte boundary.
            objdump_start_addr = (addr & ~31) - 32
            objdump_end_addr = addr + 64
            pipe = subprocess.Popen([
                toolchain.get_tool(OPTIONS.target(), 'objdump'), '-SC',
                binary_filename, '--start-address',
                '0x%x' % objdump_start_addr, '--stop-address',
                '0x%x' % objdump_end_addr
            ],
                                    stdout=subprocess.PIPE,
                                    stderr=subprocess.STDOUT)
            objdump_result = pipe.communicate('%x\n' % addr)[0]

            if self._is_annotating:
                report = ('[[ %s 0x%x %s ]]' %
                          (binary_filename, addr, addr2line_result.strip()))
                # The result of objdump is too verbose for annotation.
            else:
                report = '%s 0x%x\n' % (binary_filename, addr)
                report += addr2line_result
                report += objdump_result

            return report
        return 'Failed to retrieve a crash report\n'
예제 #49
0
파일: config.py 프로젝트: epowers/arc
def _add_compile_flags(ninja):
  if OPTIONS.is_memory_usage_logging():
    ninja.add_defines('MEMORY_USAGE_LOGGING')
  if OPTIONS.log_thread_ids():
    ninja.add_defines('LOG_THREAD_IDS')
  if OPTIONS.log_timestamps():
    ninja.add_defines('LOG_TIMESTAMPS')

  ninja.add_ppapi_compile_flags()  # for mprotect_rwx.cc
  ninja.add_libchromium_base_compile_flags()
  ninja.add_cxx_flags('-isystem',
                      staging.as_staging('android/external/stlport/stlport'))
예제 #50
0
파일: config.py 프로젝트: epowers/arc
def generate_test_ninjas():
  if not OPTIONS.is_nacl_x86_64():
    return

  n = ninja_generator.TestNinjaGenerator('libunwind_test',
                                         base_path='android/external/libunwind',
                                         enable_cxx11=True)
  sources = []
  if OPTIONS.is_x86_64():
    sources.append('src/x86_64/ucontext_i_test.cc')
  n.build_default(sources)
  n.run(n.link())
예제 #51
0
파일: toolchain.py 프로젝트: epowers/arc
def get_tool(target, tool, with_cc_wrapper=True):
  tool = {
      'asm_with_preprocessing': 'asm',
      'clang.ld': 'clang',
      'clang.ld_system_library': 'clang',
      'ld_system_library': 'ld',
  }.get(tool, tool)
  command = _get_tool_map()[target][tool]
  if (tool in ['cc', 'cxx', 'clang', 'clangxx'] and
      OPTIONS.cc_wrapper() and with_cc_wrapper):
    command = OPTIONS.cc_wrapper() + ' ' + command
  return command