Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / native_client / pnacl / driver / driver_env.py
index 62488d4..d0a0606 100755 (executable)
@@ -2,11 +2,6 @@
 # Copyright (c) 2012 The Native Client Authors. All rights reserved.
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
-#
-# IMPORTANT NOTE: If you make local mods to this file, you must run:
-#   %  pnacl/build.sh driver
-# in order for them to take effect in the scons build.  This command
-# updates the copy in the toolchain/ tree.
 
 # Global environment and expression parsing for the PNaCl driver
 
@@ -23,43 +18,63 @@ INITIAL_ENV = {
   # Set by DriverMain
   'DRIVER_PATH'     : '', # Absolute path to this driver invocation
   'DRIVER_BIN'      : '', # PNaCl driver bin/ directory
+  'DRIVER_REV_FILE' : '${BASE}/REV',
 
   'BASE_NACL'       : '${@FindBaseNaCl}',      # Absolute path of native_client/
-  'BASE_TOOLCHAIN'  : '${@FindBaseToolchain}', # Absolute path to toolchain/
+  'BASE_TOOLCHAIN'  : '${@FindBaseToolchain}', # Absolute path to toolchain/OS_ARCH/
   'BASE'            : '${@FindBasePNaCl}',     # Absolute path to PNaCl
   'BUILD_OS'        : '${@GetBuildOS}',        # "linux", "darwin" or "windows"
   'BUILD_ARCH'      : '${@GetBuildArch}',      # "x86_64" or "i686" or "i386"
 
   # Directories
-  'BASE_HOST'       : '${BASE}/host_${HOST_ARCH}',
-  'BASE_LLVM'       : '${BASE_HOST}',
-  'BASE_BINUTILS'   : '${BASE_HOST}',
+  'CLANG_VER'       : '3.4', # Included in path to compiler-owned libs/headers.
+  'BPREFIXES'       : '', # Prefixes specified using the -B flag.
+  'BASE_LLVM'       : '${@FindBaseHost:clang}',
+  'BASE_BINUTILS'   : '${@FindBaseHost:le32-nacl-ar}',
 
-  'BASE_LIB_NATIVE' : '${BASE}/lib-',
+  'BASE_LIB_NATIVE' : '${BASE}/translator/',
 
-  'BASE_USR'        : '${BASE}/usr',
+  'BASE_USR'        : '${BASE}/le32-nacl',
   'BASE_SDK'        : '${BASE}/sdk',
-  'BASE_LIB'        : '${BASE}/lib',
+  'BASE_LIB'        : '${BASE}/lib/clang/${CLANG_VER}/lib/le32-nacl',
   'BASE_USR_ARCH'   : '${BASE_USR_%BCLIB_ARCH%}',
-  'BASE_USR_X8664'   : '${BASE}/usr-bc-x86-64',
+  'BASE_USR_X8632'  : '${BASE}/x86-32_bc-nacl',
+  'BASE_USR_X8664'  : '${BASE}/x86-64_bc-nacl',
+  'BASE_USR_ARM'    : '${BASE}/arm_bc-nacl',
   'BASE_LIB_ARCH'   : '${BASE_LIB_%BCLIB_ARCH%}',
-  'BASE_LIB_X8664'   : '${BASE}/lib-bc-x86-64',
+  'BASE_LIB_X8632'  : '${BASE}/lib/clang/${CLANG_VER}/lib/x86-32_bc-nacl',
+  'BASE_LIB_X8664'  : '${BASE}/lib/clang/${CLANG_VER}/lib/x86-64_bc-nacl',
+  'BASE_LIB_ARM'    : '${BASE}/lib/clang/${CLANG_VER}/lib/arm_bc-nacl',
+
+  'LIBS_NATIVE_ARCH' : '${LIBS_NATIVE_%ARCH%}',
+  'LIBS_NATIVE_ARM' : '${BASE_LIB_NATIVE}arm/lib',
+  'LIBS_NATIVE_ARM_NONSFI' : '${BASE_LIB_NATIVE}arm-nonsfi/lib',
+  'LIBS_NATIVE_X8632' : '${BASE_LIB_NATIVE}x86-32/lib',
+  'LIBS_NATIVE_X8632_NONSFI' : '${BASE_LIB_NATIVE}x86-32-nonsfi/lib',
+  'LIBS_NATIVE_X8664' : '${BASE_LIB_NATIVE}x86-64/lib',
+  'LIBS_NATIVE_MIPS32' : '${BASE_LIB_NATIVE}mips32/lib',
 
   'BASE_LLVM_BIN'   : '${BASE_LLVM}/bin',
   'TRANSLATOR_BIN'  :
-    '${BASE_TOOLCHAIN}/pnacl_translator/${STANDARD_ARCH}/bin',
+    '${BASE_TOOLCHAIN}/pnacl_translator/translator/${TRANSLATOR_ARCH}/bin',
 
-  # TODO(pdox): Unify this with ARCH.
-  'STANDARD_ARCH'       : '${STANDARD_ARCH_%ARCH%}',
-  'STANDARD_ARCH_X8632' : 'i686',
-  'STANDARD_ARCH_X8664' : 'x86_64',
-  'STANDARD_ARCH_ARM'   : 'armv7',
-  'STANDARD_ARCH_MIPS32': 'mips32',
+  # TODO(dschuff): Switch these directories to be triple-style arches,
+  # to match the main toolchain?
+  'TRANSLATOR_ARCH'       : '${TRANSLATOR_ARCH_%ARCH%}',
+  'TRANSLATOR_ARCH_X8632' : 'x86-32',
+  'TRANSLATOR_ARCH_X8664' : 'x86-64',
+  'TRANSLATOR_ARCH_ARM'   : 'arm',
+  'TRANSLATOR_ARCH_MIPS32': 'mips32',
 
   'SCONS_OUT'       : '${BASE_NACL}/scons-out',
 
   # Driver settings
-  'ARCH'        : '',     # Target architecture
+  'ARCH'        : '',     # Target architecture, including optional
+                          # suffixes such as '_NONSFI' or '_LINUX'.
+  'BASE_ARCH'   : '',     # Target architecture without any '_NONSFI' suffix.
+                          # Derived from ARCH field.
+  'NONSFI_NACL' : '0',    # Whether targeting Non-SFI Mode.  Derived from
+                          # ARCH field.
   'BIAS'        : 'NONE', # This can be 'NONE', 'ARM', 'MIPS32', 'X8632' or
                           # 'X8664'.
                           # When not set to none, this causes the front-end to
@@ -67,29 +82,21 @@ INITIAL_ENV = {
                           # currently needed while compiling newlib,
                           # and some scons tests.
   'DRY_RUN'     : '0',
-  'DEBUG'       : '0',    # Print out internal actions
-  'RECURSE'     : '0',    # In a recursive driver call
   'SAVE_TEMPS'  : '0',    # Do not clean up temporary files
   'SANDBOXED'   : '0',    # Use sandboxed toolchain for this arch. (main switch)
   'HAS_FRONTEND': '',     # Set by ReadConfig().  '1' if the driver install
                           # has support for front-end bitcode tools, or '0'
                           # if it only has the backend translator.
 
-  'FORCE_INTERMEDIATE_S': '0',
   'USE_EMULATOR'        : '0',
-  'USE_BOOTSTRAP'       : '${BUILD_OS==linux ? 1 : 0}',
   # Args passed from one driver invocation to another
   'INHERITED_DRIVER_ARGS' : '',
 
   'BCLIB_ARCH'          : '',
   # Logging settings
-  'LOGGING'            : '0', # True if logging is enabled.
   'LOG_VERBOSE'        : '0', # Log to stdout (--pnacl-driver-verbose)
-  'LOG_TO_FILE'        : '0', # Log to file (--pnacl-driver-log-to-file)
-  'LOG_FILENAME'       : '${BASE}/driver.log',
-  'LOG_FILE_SIZE_LIMIT': str(20 * 1024 * 1024),
 
-   # Conventions
+  # Conventions
   'SO_EXT'          : '${SO_EXT_%BUILD_OS%}',
   'SO_EXT_darwin'   : '.dylib',
   'SO_EXT_linux'    : '.so',
@@ -101,11 +108,6 @@ INITIAL_ENV = {
   'SO_DIR_windows'  : 'bin',  # On Windows, DLLs are placed in bin/
                               # because the dynamic loader searches %PATH%
 
-  'SO_PREFIX'        : '${SO_PREFIX_%BUILD_OS%}',
-  'SO_PREFIX_darwin' : 'lib',
-  'SO_PREFIX_linux'  : 'lib',
-  'SO_PREFIX_windows': 'cyg',
-
   'EXEC_EXT'        : '${EXEC_EXT_%BUILD_OS%}',
   'EXEC_EXT_darwin' : '',
   'EXEC_EXT_linux'  : '',
@@ -117,7 +119,7 @@ INITIAL_ENV = {
   'SCONS_OS_windows'    : 'win',
 
   # llvm goldplugin
-  'GOLD_PLUGIN_SO'  : '${BASE_LLVM}/${SO_DIR}/${SO_PREFIX}LLVMgold${SO_EXT}',
+  'GOLD_PLUGIN_SO'  : '${BASE_LLVM}/${SO_DIR}/LLVMgold${SO_EXT}',
 
   'SCONS_STAGING'       : '${SCONS_STAGING_%ARCH%}',
   'SCONS_STAGING_X8632' : '${SCONS_OUT}/opt-${SCONS_OS}-x86-32/staging',
@@ -139,9 +141,9 @@ INITIAL_ENV = {
   'EMULATOR_X8664'      : '',
   # NOTE: this is currently the only dependency on the arm trusted TC
   'EMULATOR_ARM'        :
-      '${BASE_NACL}/toolchain/linux_arm-trusted/run_under_qemu_arm',
+      '${BASE_NACL}/toolchain/linux_x86/arm_trusted/run_under_qemu_arm',
   'EMULATOR_MIPS32'     :
-      '${BASE_NACL}/toolchain/linux_mips-trusted/run_under_qemu_mips32',
+      '${BASE_NACL}/toolchain/linux_x86/mips_trusted/run_under_qemu_mips32',
 
   'SEL_LDR'       : '${SCONS_STAGING}/sel_ldr${EXEC_EXT}',
   'BOOTSTRAP_LDR' : '${SCONS_STAGING}/nacl_helper_bootstrap${EXEC_EXT}',
@@ -154,15 +156,15 @@ INITIAL_ENV = {
   # Bitcode LLVM tools
   'CLANG'         : '${BASE_LLVM_BIN}/clang${EXEC_EXT}',
   # 'clang++' doesn't work on Windows (outside of Cygwin),
-  # because it is a symlink. '-ccc-cxx' enables C++ mode.
-  'CLANGXX'       : '${BASE_LLVM_BIN}/clang${EXEC_EXT} -ccc-cxx',
+  # because it is a symlink.
+  'CLANGXX'       : '${BASE_LLVM_BIN}/clang${EXEC_EXT} --driver-mode=g++',
   'LLVM_OPT'      : '${BASE_LLVM_BIN}/opt${EXEC_EXT}',
   'LLVM_DIS'      : '${BASE_LLVM_BIN}/llvm-dis${EXEC_EXT}',
   'LLVM_NM'       : '${BASE_LLVM_BIN}/llvm-nm${EXEC_EXT}',
   # llvm-as compiles llvm assembly (.ll) to bitcode (.bc/.po)
   'LLVM_AS'       : '${BASE_LLVM_BIN}/llvm-as${EXEC_EXT}',
-  'LLVM_BCWRAP'   : '${BASE_LLVM_BIN}/bc-wrap${EXEC_EXT}',
   'PNACL_ABICHECK': '${BASE_LLVM_BIN}/pnacl-abicheck${EXEC_EXT}',
+  'PNACL_COMPRESS': '${BASE_LLVM_BIN}/pnacl-bccompress${EXEC_EXT}',
 
   # Native LLVM tools
   'LLVM_PNACL_LLC': '${BASE_LLVM_BIN}/pnacl-llc${EXEC_EXT}',
@@ -179,9 +181,6 @@ INITIAL_ENV = {
   'STRIP'          : '${BINUTILS_BASE}strip${EXEC_EXT}',
   # linker (used for both bitcode and ELF linking)
   'LD'        : '${BINUTILS_BASE}ld.gold${EXEC_EXT}',
-
-  # Use the default command line arguments to the sandboxed translator.
-  'USE_DEFAULT_CMD_LINE': '1',
 }
 
 ######################################################################