当前位置: 首页>>代码示例>>Python>>正文


Python OPTIONS.is_x86_64方法代码示例

本文整理汇总了Python中build_options.OPTIONS.is_x86_64方法的典型用法代码示例。如果您正苦于以下问题:Python OPTIONS.is_x86_64方法的具体用法?Python OPTIONS.is_x86_64怎么用?Python OPTIONS.is_x86_64使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在build_options.OPTIONS的用法示例。


在下文中一共展示了OPTIONS.is_x86_64方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _filter

# 需要导入模块: from build_options import OPTIONS [as 别名]
# 或者: from build_options.OPTIONS import is_x86_64 [as 别名]
 def _filter(vars):
   if vars.is_shared():
     return False
   make_to_ninja.Filters.convert_to_shared_lib(vars)
   _add_bare_metal_flags_to_make_to_ninja_vars(vars)
   # Builtin rint and rintf call lrint and lrintf,
   # respectively. However, Bionic calls rint and rintf to implement
   # lrint and lrintf and this causes an infinite recurision.
   # TODO(crbug.com/357564): Change this to -fno-builtin.
   vars.get_cflags().append('-fno-builtin-rint')
   vars.get_cflags().append('-fno-builtin-rintf')
   sources = vars.get_sources()
   _remove_assembly_source(sources)
   if OPTIONS.is_arm():
     vars.get_includes().append('android/bionic/libc/arch-arm/include')
   else:
     # TODO(crbug.com/414583): "L" has arch-x86_64 directory so we
     # should have this include path only for i686 targets.
     vars.get_includes().append('android/bionic/libc/arch-x86/include')
     if OPTIONS.is_x86_64():
       vars.get_includes().insert(0, 'android/bionic/libc/arch-amd64/include')
       sources.remove(
           'android/bionic/libm/upstream-freebsd/lib/msun/src/e_sqrtf.c')
       sources.remove('android/bionic/libm/i387/fenv.c')
       sources.extend(['android/bionic/libm/amd64/e_sqrtf.S',
                       'android/bionic/libm/amd64/fenv.c'])
   if OPTIONS.is_bare_metal_i686():
     # long double is double on other architectures. For them,
     # s_nextafter.c defines nextafterl.
     sources.append(
         'android/bionic/libm/upstream-freebsd/lib/msun/src/s_nextafterl.c')
   vars.get_generator_args()['is_system_library'] = True
   vars.get_shared_deps().append('libc')
   return True
开发者ID:NaiveTorch,项目名称:ARC,代码行数:36,代码来源:config.py

示例2: get_chrome_prebuilt_path

# 需要导入模块: from build_options import OPTIONS [as 别名]
# 或者: from build_options.OPTIONS import is_x86_64 [as 别名]
def get_chrome_prebuilt_path():
  # Use 32-bit version of Chrome on Windows regardless of the target bit size.
  if platform_util.is_running_on_cygwin():
    return os.path.join('out', 'chrome32')
  if OPTIONS.is_x86_64():
    return os.path.join('out', 'chrome64')
  else:
    return os.path.join('out', 'chrome32')
开发者ID:NaiveTorch,项目名称:ARC,代码行数:10,代码来源:build_common.py

示例3: _add_runnable_ld_cflags

# 需要导入模块: from build_options import OPTIONS [as 别名]
# 或者: from build_options.OPTIONS import is_x86_64 [as 别名]
def _add_runnable_ld_cflags(n):
  n.add_c_flags('-std=gnu99')
  if OPTIONS.is_arm():
    # If we specify -fstack-protector, the ARM compiler emits code
    # which requires relocation even for the code to be executed
    # before the self relocation. We disable the stack smashing
    # protector for the Bionic loader for now.
    # TODO(crbug.com/342292): Enable stack protector for the Bionic
    # loader on Bare Metal ARM.
    n.add_compiler_flags('-fno-stack-protector')
  n.add_compiler_flags(
      '-ffunction-sections', '-fdata-sections',
      # The loader does not need to export any symbols.
      '-fvisibility=hidden',
      '-W', '-Wno-unused', '-Wno-unused-parameter', '-Werror')

  # TODO(crbug.com/243244): Consider using -Wsystem-headers.
  n.add_include_paths('android/bionic/libc',
                      'android/bionic/libc/private',
                      'android/bionic/linker/arch/nacl')
  if OPTIONS.is_debug_code_enabled() or OPTIONS.is_bionic_loader_logging():
    n.add_defines('LINKER_DEBUG=1')
  else:
    n.add_defines('LINKER_DEBUG=0')
  n.add_defines('ANDROID_SMP=1')
  if OPTIONS.is_arm():
    n.add_defines('ANDROID_ARM_LINKER')
  elif OPTIONS.is_x86_64():
    n.add_defines('ANDROID_X86_64_LINKER')
    n.add_c_flags('-Wno-pointer-to-int-cast')
    n.add_c_flags('-Wno-int-to-pointer-cast')
  else:
    n.add_defines('ANDROID_X86_LINKER')
  if build_common.use_ndk_direct_execution():
    n.add_defines('USE_NDK_DIRECT_EXECUTION')

  if OPTIONS.is_bionic_loader_logging():
    n.add_defines('BIONIC_LOADER_LOGGING')
  _add_bare_metal_flags_to_ninja_generator(n)
开发者ID:NaiveTorch,项目名称:ARC,代码行数:41,代码来源:config.py

示例4: _filter_libc

# 需要导入模块: from build_options import OPTIONS [as 别名]
# 或者: from build_options.OPTIONS import is_x86_64 [as 别名]
def _filter_libc(vars):
  if vars.is_static():
    return False

  vars.get_sources().remove('android/bionic/libc/bionic/pthread_debug.cpp')
  vars.get_sources().extend([
      'android/bionic/libc/arch-nacl/bionic/atexit.c',
      'android/bionic/libc/arch-nacl/syscalls/clock_nanosleep.c',
      'android/bionic/libc/arch-nacl/syscalls/irt_syscalls.c',
      'android/bionic/libc/arch-nacl/syscalls/nanosleep.c',
      'android/bionic/libc/arch-nacl/syscalls/sched_yield.c',
      'android/bionic/libc/arch-nacl/tmp/libc_stubs.c',
      'android/bionic/libc/string/rindex.c'
  ])
  if OPTIONS.is_i686():
    vars.get_sources().append(
        'android/bionic/libc/arch-x86/bionic/setjmp.S')
  if OPTIONS.is_x86_64():
    vars.get_sources().append(
        'android/bionic/libc/arch-amd64/bionic/setjmp.S')
    vars.get_includes().insert(0, 'android/bionic/libc/arch-amd64/include')
  if OPTIONS.is_arm():
    vars.get_sources().append(
        'android/bionic/libc/arch-arm/bionic/setjmp.S')
    # Remove the sources that contain the functions we implement.
    vars.get_sources().remove(
        'android/bionic/libc/arch-arm/bionic/atexit_legacy.c')
    if OPTIONS.is_bare_metal_build():
      # TODO(crbug.com/319020): Use Bare Metal IRT instead of
      # calling a syscall directly.
      vars.get_sources().extend([
          'android/bionic/libc/arch-arm/bionic/_setjmp.S',
          'android/bionic/libc/arch-arm/bionic/sigsetjmp.S',
          'android/bionic/libc/arch-nacl/syscalls/cacheflush.c'])
  vars.get_includes().append('android/bionic/libc/arch-nacl/syscalls')
  vars.get_implicit_deps().extend([build_common.get_bionic_crtbegin_so_o(),
                                   build_common.get_bionic_crtend_o()])
  # This looks weird libc depends on libdl, but the upstream
  # bionic also does the same thing. Note that libdl.so just has
  # stub functions and their actual implementations are in the
  # loader (see third_party/android/bionic/linker/dlfcn.c).
  vars.get_shared_deps().append('libdl')
  vars.get_whole_archive_deps().append('libc_bionic')
  vars.get_whole_archive_deps().append('libc_freebsd')
  vars.get_whole_archive_deps().append('libc_netbsd')
  # We do not support stack protector on NaCl, but NDK may require a
  # symbol in this file. So, we always link this.
  vars.get_whole_archive_deps().append('libbionic_ssp')
  vars.get_whole_archive_deps().append('libc_tzcode')
  # Let dlmalloc not use sbrk as NaCl Bionic does not provide brk/sbrk.
  vars.get_cflags().append('-DHAVE_MORECORE=0')
  _remove_unnecessary_defines(vars)
  if OPTIONS.is_arm():
    # libc/upstream-dlmalloc/malloc.c checks "linux" to check if
    # mremap is available, which we do not have. We need this fix
    # only for Bare Metal ARM because NaCl toolchain does not
    # define "linux" and Android undefines "linux" by default for
    # x86 (android/build/core/combo/TARGET_linux-x86.mk).
    vars.get_cflags().append('-Ulinux')
  vars.get_generator_args()['is_system_library'] = True
  if OPTIONS.is_arm():
    # Set False to 'link_crtbegin' because Android.mk for libc.so
    # compiles android/bionic/libc/arch-arm/bionic/crtbegin_so.c by
    # default with -DCRT_LEGACY_WORKAROUND to export the __dso_handle
    # symbol.
    #
    # __dso_handle is passed to __cxa_atexit so that libc knows which
    # atexit handler belongs to which module. In general, __dso_handle
    # should be a private symbol. Otherwise, a module (say A) can
    # depend on __dso_handle in another module (B), and the atexit
    # handler in A will not be called when the module A is unloaded.
    #
    # However, it seems the old version of Android had a bug and
    # __dso_handle was exposed. Several NDKs depend on __dso_handle
    # in libc.so. To execute such binaries directly, we need to define
    # a public __dso_handle, too. This effectively means atexit
    # handlers in such NDKs will never be called, as we will never
    # unload libc.so. This is a known upstream issue. See
    # third_party/android/bionic/ABI-bugs.txt.
    #
    # Note it is OK not to have crtbegin_so.o as the first object when
    # we link libc.so because we are using init_array/fini_array,
    # which do not require specific watchdogs, for ARM.
    vars.get_generator_args()['link_crtbegin'] = False
  return True
开发者ID:NaiveTorch,项目名称:ARC,代码行数:87,代码来源:config.py

示例5: _filter_libc_common

# 需要导入模块: from build_options import OPTIONS [as 别名]
# 或者: from build_options.OPTIONS import is_x86_64 [as 别名]
def _filter_libc_common(vars):
  sources = vars.get_sources()
  _remove_assembly_source(sources)
  # libc_common is used from both the loader and libc.so. Functions
  # which are necessary for the bionic loader must be in this list.
  sources.extend([
      # TODO(crbug.com/243244): If possible, move arch-nacl/ files into a
      # separate archive and build them with -Werror.
      'android/bionic/libc/arch-nacl/bionic/__get_sp.c',
      'android/bionic/libc/arch-nacl/bionic/__set_tls.c',
      'android/bionic/libc/arch-nacl/bionic/clone.c',
      'android/bionic/libc/arch-nacl/bionic/popcount.c',
      'android/bionic/libc/arch-nacl/syscalls/__getcwd.c',
      'android/bionic/libc/arch-nacl/syscalls/__open.c',
      'android/bionic/libc/arch-nacl/syscalls/_exit.c',
      'android/bionic/libc/arch-nacl/syscalls/_exit_thread.c',
      'android/bionic/libc/arch-nacl/syscalls/clock_getres.c',
      'android/bionic/libc/arch-nacl/syscalls/clock_gettime.c',
      'android/bionic/libc/arch-nacl/syscalls/close.c',
      'android/bionic/libc/arch-nacl/syscalls/dup.c',
      'android/bionic/libc/arch-nacl/syscalls/dup2.c',
      'android/bionic/libc/arch-nacl/syscalls/enosys.c',
      'android/bionic/libc/arch-nacl/syscalls/fdatasync.c',
      'android/bionic/libc/arch-nacl/syscalls/fstat.c',
      'android/bionic/libc/arch-nacl/syscalls/fsync.c',
      'android/bionic/libc/arch-nacl/syscalls/futex.c',
      'android/bionic/libc/arch-nacl/syscalls/getdents.c',
      'android/bionic/libc/arch-nacl/syscalls/getpid.c',
      'android/bionic/libc/arch-nacl/syscalls/gettid.c',
      'android/bionic/libc/arch-nacl/syscalls/gettimeofday.c',
      'android/bionic/libc/arch-nacl/syscalls/getuid.c',
      'android/bionic/libc/arch-nacl/syscalls/lseek.c',
      'android/bionic/libc/arch-nacl/syscalls/lseek64.c',
      'android/bionic/libc/arch-nacl/syscalls/lstat.c',
      'android/bionic/libc/arch-nacl/syscalls/mmap.c',
      'android/bionic/libc/arch-nacl/syscalls/mprotect.c',
      'android/bionic/libc/arch-nacl/syscalls/munmap.c',
      'android/bionic/libc/arch-nacl/syscalls/nacl_stat.c',
      'android/bionic/libc/arch-nacl/syscalls/nacl_timespec.c',
      'android/bionic/libc/arch-nacl/syscalls/nacl_timeval.c',
      'android/bionic/libc/arch-nacl/syscalls/read.c',
      'android/bionic/libc/arch-nacl/syscalls/stat.c',
      'android/bionic/libc/arch-nacl/syscalls/unlink.c',
      'android/bionic/libc/arch-nacl/syscalls/write.c',
      'android/bionic/libc/arch-nacl/syscalls/writev.c',
      'android/bionic/libc/arch-nacl/tmp/raw_print.c',
      # TODO(crbug.com/352917): Use assembly version on Bare Metal ARM.
      'android/bionic/libc/bionic/memcmp.c',
      'android/bionic/libc/bionic/memcpy.c',
      'android/bionic/libc/bionic/property_service.c',
      'android/bionic/libc/string/ffs.c',
      'android/bionic/libc/string/strcat.c',
      'android/bionic/libc/string/strcmp.c',
      'android/bionic/libc/string/strlen.c'])
  if OPTIONS.is_nacl_build():
    # They define SFI NaCl specific functions for dynamic code.
    sources.extend([
        'android/bionic/libc/arch-nacl/syscalls/__allocate_nacl_dyncode.c',
        'android/bionic/libc/arch-nacl/syscalls/nacl_dyncode_create.c',
        'android/bionic/libc/arch-nacl/syscalls/nacl_dyncode_delete.c',
        'android/bionic/libc/arch-nacl/syscalls/nacl_list_mappings.c'])

  if OPTIONS.is_arm():
    # TODO(crbug.com/352917): Use assembly version on Bare Metal ARM.
    sources.extend([
        'android/bionic/libc/bionic/__memcpy_chk.cpp',
        'android/bionic/libc/bionic/__memset_chk.cpp',
        'android/bionic/libc/bionic/__strcat_chk.cpp',
        'android/bionic/libc/bionic/__strcpy_chk.cpp'])
  else:
    sources.extend([
        'android/bionic/libc/bionic/memchr.c',
        'android/bionic/libc/bionic/memrchr.c',
        'android/bionic/libc/bionic/memmove.c',
        'android/bionic/libc/bionic/strnlen.c',
        'android/bionic/libc/string/bcopy.c',
        'android/bionic/libc/string/index.c',
        'android/bionic/libc/string/strncmp.c',
        'android/bionic/libc/string/strrchr.c',
        'android/bionic/libc/upstream-freebsd/lib/libc/string/wcschr.c',
        'android/bionic/libc/upstream-freebsd/lib/libc/string/wcsrchr.c',
        'android/bionic/libc/upstream-freebsd/lib/libc/string/wcscmp.c',
        'android/bionic/libc/upstream-freebsd/lib/libc/string/wcslen.c'])

  if OPTIONS.is_arm():
    _filter_libc_common_for_arm(vars, sources)
  elif OPTIONS.is_i686():
    _filter_libc_common_for_i686(vars, sources)
  elif OPTIONS.is_x86_64():
    _filter_libc_common_for_x86_64(vars, sources)

  # NaCl does not have fork so we do not need the fork wrapper
  # which does preparation before we actually run fork system call.
  sources.remove('android/bionic/libc/bionic/fork.c')
  # lseek64 in this file splits off64_t into two integer values to
  # make assembly code easier. We can define lseek64 in C so we do
  # not need this wrapper.
  sources.remove('android/bionic/libc/bionic/lseek64.c')
  if OPTIONS.is_x86_64() or OPTIONS.is_bare_metal_i686():
    # We define __get_tls in nacl_read_tp.c.
#.........这里部分代码省略.........
开发者ID:NaiveTorch,项目名称:ARC,代码行数:103,代码来源:config.py


注:本文中的build_options.OPTIONS.is_x86_64方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。