Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 # | 5 # |
| 6 # IMPORTANT NOTE: If you make local mods to this file, you must run: | 6 # IMPORTANT NOTE: If you make local mods to this file, you must run: |
| 7 # % pnacl/build.sh driver | 7 # % pnacl/build.sh driver |
| 8 # in order for them to take effect in the scons build. This command | 8 # in order for them to take effect in the scons build. This command |
| 9 # updates the copy in the toolchain/ tree. | 9 # updates the copy in the toolchain/ tree. |
| 10 | 10 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 47 'BASE_USR_ARCH' : '${BASE_USR_%ARCH%}', | 47 'BASE_USR_ARCH' : '${BASE_USR_%ARCH%}', |
| 48 'BASE_USR_ARM' : '${BASE_LIBMODE}/usr-bc-arm', | 48 'BASE_USR_ARM' : '${BASE_LIBMODE}/usr-bc-arm', |
| 49 'BASE_LIB_ARCH' : '${BASE_LIB_%ARCH%}', | 49 'BASE_LIB_ARCH' : '${BASE_LIB_%ARCH%}', |
| 50 'BASE_LIB_ARM' : '${BASE_LIBMODE}/lib-bc-arm', | 50 'BASE_LIB_ARM' : '${BASE_LIBMODE}/lib-bc-arm', |
| 51 | 51 |
| 52 'BASE_LLVM_BIN' : '${BASE_LLVM}/bin', | 52 'BASE_LLVM_BIN' : '${BASE_LLVM}/bin', |
| 53 'TRANSLATOR_BIN' : | 53 'TRANSLATOR_BIN' : |
| 54 '${BASE_TOOLCHAIN}/pnacl_translator/${STANDARD_ARCH}/bin', | 54 '${BASE_TOOLCHAIN}/pnacl_translator/${STANDARD_ARCH}/bin', |
| 55 | 55 |
| 56 # TODO(pdox): Unify this with ARCH. | 56 # TODO(pdox): Unify this with ARCH. |
| 57 'STANDARD_ARCH' : '${STANDARD_ARCH_%ARCH%}', | 57 'STANDARD_ARCH' : '${STANDARD_ARCH_%ARCH%}', |
| 58 'STANDARD_ARCH_X8632': 'i686', | 58 'STANDARD_ARCH_X8632' : 'i686', |
| 59 'STANDARD_ARCH_X8664': 'x86_64', | 59 'STANDARD_ARCH_X8664' : 'x86_64', |
| 60 'STANDARD_ARCH_ARM' : 'armv7', | 60 'STANDARD_ARCH_ARM' : 'armv7', |
| 61 'STANDARD_ARCH_MIPS32': 'mips32', | |
| 61 | 62 |
| 62 'SCONS_OUT' : '${BASE_NACL}/scons-out', | 63 'SCONS_OUT' : '${BASE_NACL}/scons-out', |
| 63 | 64 |
| 64 # Driver settings | 65 # Driver settings |
| 65 'ARCH' : '', # Target architecture | 66 'ARCH' : '', # Target architecture |
| 66 'BIAS' : 'NONE', # This can be 'NONE', 'ARM', 'X8632', or 'X8664'. | 67 'BIAS' : 'NONE', # This can be 'NONE', 'ARM', 'X8632', or 'X8664'. |
|
jvoung - send to chromium...
2013/02/13 19:30:43
Can also add MIPS32 to this list.
petarj
2013/02/14 01:06:52
Done.
| |
| 67 # When not set to none, this causes the front-end to | 68 # When not set to none, this causes the front-end to |
| 68 # act like a target-specific compiler. This bias is | 69 # act like a target-specific compiler. This bias is |
| 69 # currently needed while compiling newlib, | 70 # currently needed while compiling newlib, |
| 70 # and some scons tests. | 71 # and some scons tests. |
| 71 'DRY_RUN' : '0', | 72 'DRY_RUN' : '0', |
| 72 'DEBUG' : '0', # Print out internal actions | 73 'DEBUG' : '0', # Print out internal actions |
| 73 'RECURSE' : '0', # In a recursive driver call | 74 'RECURSE' : '0', # In a recursive driver call |
| 74 'SAVE_TEMPS' : '0', # Do not clean up temporary files | 75 'SAVE_TEMPS' : '0', # Do not clean up temporary files |
| 75 'SANDBOXED' : '0', # Use sandboxed toolchain for this arch. (main switch) | 76 'SANDBOXED' : '0', # Use sandboxed toolchain for this arch. (main switch) |
| 76 'HAS_FRONTEND': '', # Set by ReadConfig(). '1' if the driver install | 77 'HAS_FRONTEND': '', # Set by ReadConfig(). '1' if the driver install |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 121 'SCONS_OS_darwin' : 'mac', | 122 'SCONS_OS_darwin' : 'mac', |
| 122 'SCONS_OS_windows' : 'win', | 123 'SCONS_OS_windows' : 'win', |
| 123 | 124 |
| 124 # llvm goldplugin | 125 # llvm goldplugin |
| 125 'GOLD_PLUGIN_SO' : '${BASE_LLVM}/${SO_DIR}/${SO_PREFIX}LLVMgold${SO_EXT}', | 126 'GOLD_PLUGIN_SO' : '${BASE_LLVM}/${SO_DIR}/${SO_PREFIX}LLVMgold${SO_EXT}', |
| 126 | 127 |
| 127 'SCONS_STAGING' : '${SCONS_STAGING_%ARCH%}', | 128 'SCONS_STAGING' : '${SCONS_STAGING_%ARCH%}', |
| 128 'SCONS_STAGING_X8632' : '${SCONS_OUT}/opt-${SCONS_OS}-x86-32/staging', | 129 'SCONS_STAGING_X8632' : '${SCONS_OUT}/opt-${SCONS_OS}-x86-32/staging', |
| 129 'SCONS_STAGING_X8664' : '${SCONS_OUT}/opt-${SCONS_OS}-x86-64/staging', | 130 'SCONS_STAGING_X8664' : '${SCONS_OUT}/opt-${SCONS_OS}-x86-64/staging', |
| 130 'SCONS_STAGING_ARM' : '${SCONS_OUT}/opt-${SCONS_OS}-arm/staging', | 131 'SCONS_STAGING_ARM' : '${SCONS_OUT}/opt-${SCONS_OS}-arm/staging', |
| 132 'SCONS_STAGING_MIPS32': '${SCONS_OUT}/opt-${SCONS_OS}-mips32/staging', | |
| 131 | 133 |
| 132 'SEL_UNIVERSAL_PREFIX': '${USE_EMULATOR ? ${EMULATOR}}', | 134 'SEL_UNIVERSAL_PREFIX': '${USE_EMULATOR ? ${EMULATOR}}', |
| 133 'SEL_UNIVERSAL' : '${SCONS_STAGING}/sel_universal${EXEC_EXT}', | 135 'SEL_UNIVERSAL' : '${SCONS_STAGING}/sel_universal${EXEC_EXT}', |
| 134 # NOTE: -Q skips sel_ldr qualification tests, -c -c skips validation | 136 # NOTE: -Q skips sel_ldr qualification tests, -c -c skips validation |
| 135 # NOTE: We are not using -B to load the IRT, since the translators do not | 137 # NOTE: We are not using -B to load the IRT, since the translators do not |
| 136 # use the IRT. | 138 # use the IRT. |
| 137 'SEL_UNIVERSAL_FLAGS' : '--abort_on_error ' + | 139 'SEL_UNIVERSAL_FLAGS' : '--abort_on_error ' + |
| 138 '--uses_reverse_service ' + | 140 '--uses_reverse_service ' + |
| 139 '${USE_EMULATOR ? -Q -c -c --command_prefix ${EMULATOR }}', | 141 '${USE_EMULATOR ? -Q -c -c --command_prefix ${EMULATOR }}', |
| 140 | 142 |
| 141 'EMULATOR' : '${EMULATOR_%ARCH%}', | 143 'EMULATOR' : '${EMULATOR_%ARCH%}', |
| 142 'EMULATOR_X8632' : '', | 144 'EMULATOR_X8632' : '', |
| 143 'EMULATOR_X8664' : '', | 145 'EMULATOR_X8664' : '', |
| 144 # NOTE: this is currently the only dependency on the arm trusted TC | 146 # NOTE: this is currently the only dependency on the arm trusted TC |
| 145 'EMULATOR_ARM' : | 147 'EMULATOR_ARM' : |
| 146 '${BASE_NACL}/toolchain/linux_arm-trusted/run_under_qemu_arm', | 148 '${BASE_NACL}/toolchain/linux_arm-trusted/run_under_qemu_arm', |
| 149 'EMULATOR_MIPS32' : | |
| 150 '${BASE_NACL}/toolchain/linux_mips-trusted/run_under_qemu_mips32', | |
| 147 | 151 |
| 148 'SEL_LDR' : '${SCONS_STAGING}/sel_ldr${EXEC_EXT}', | 152 'SEL_LDR' : '${SCONS_STAGING}/sel_ldr${EXEC_EXT}', |
| 149 'BOOTSTRAP_LDR' : '${SCONS_STAGING}/nacl_helper_bootstrap${EXEC_EXT}', | 153 'BOOTSTRAP_LDR' : '${SCONS_STAGING}/nacl_helper_bootstrap${EXEC_EXT}', |
| 150 | 154 |
| 151 # sandboxed llvm backend | 155 # sandboxed llvm backend |
| 152 'LLC_SB' : '${TRANSLATOR_BIN}/llc.nexe', | 156 'LLC_SB' : '${TRANSLATOR_BIN}/llc.nexe', |
| 153 # sandboxed linker (gold based) | 157 # sandboxed linker (gold based) |
| 154 'LD_SB' : '${TRANSLATOR_BIN}/ld.nexe', | 158 'LD_SB' : '${TRANSLATOR_BIN}/ld.nexe', |
| 155 | 159 |
| 156 # Bitcode LLVM tools | 160 # Bitcode LLVM tools |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 509 | 513 |
| 510 | 514 |
| 511 env = Environment() | 515 env = Environment() |
| 512 | 516 |
| 513 def override_env(meth_name, func): | 517 def override_env(meth_name, func): |
| 514 """Override a method in the global |env|, given the method name | 518 """Override a method in the global |env|, given the method name |
| 515 and the new function. | 519 and the new function. |
| 516 """ | 520 """ |
| 517 global env | 521 global env |
| 518 setattr(env, meth_name, types.MethodType(func, env, Environment)) | 522 setattr(env, meth_name, types.MethodType(func, env, Environment)) |
| OLD | NEW |