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', 'MIPS32', 'X8632' or |
| 68 # 'X8664'. |
67 # When not set to none, this causes the front-end to | 69 # When not set to none, this causes the front-end to |
68 # act like a target-specific compiler. This bias is | 70 # act like a target-specific compiler. This bias is |
69 # currently needed while compiling newlib, | 71 # currently needed while compiling newlib, |
70 # and some scons tests. | 72 # and some scons tests. |
71 'DRY_RUN' : '0', | 73 'DRY_RUN' : '0', |
72 'DEBUG' : '0', # Print out internal actions | 74 'DEBUG' : '0', # Print out internal actions |
73 'RECURSE' : '0', # In a recursive driver call | 75 'RECURSE' : '0', # In a recursive driver call |
74 'SAVE_TEMPS' : '0', # Do not clean up temporary files | 76 'SAVE_TEMPS' : '0', # Do not clean up temporary files |
75 'SANDBOXED' : '0', # Use sandboxed toolchain for this arch. (main switch) | 77 'SANDBOXED' : '0', # Use sandboxed toolchain for this arch. (main switch) |
76 'HAS_FRONTEND': '', # Set by ReadConfig(). '1' if the driver install | 78 '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', | 123 'SCONS_OS_darwin' : 'mac', |
122 'SCONS_OS_windows' : 'win', | 124 'SCONS_OS_windows' : 'win', |
123 | 125 |
124 # llvm goldplugin | 126 # llvm goldplugin |
125 'GOLD_PLUGIN_SO' : '${BASE_LLVM}/${SO_DIR}/${SO_PREFIX}LLVMgold${SO_EXT}', | 127 'GOLD_PLUGIN_SO' : '${BASE_LLVM}/${SO_DIR}/${SO_PREFIX}LLVMgold${SO_EXT}', |
126 | 128 |
127 'SCONS_STAGING' : '${SCONS_STAGING_%ARCH%}', | 129 'SCONS_STAGING' : '${SCONS_STAGING_%ARCH%}', |
128 'SCONS_STAGING_X8632' : '${SCONS_OUT}/opt-${SCONS_OS}-x86-32/staging', | 130 'SCONS_STAGING_X8632' : '${SCONS_OUT}/opt-${SCONS_OS}-x86-32/staging', |
129 'SCONS_STAGING_X8664' : '${SCONS_OUT}/opt-${SCONS_OS}-x86-64/staging', | 131 'SCONS_STAGING_X8664' : '${SCONS_OUT}/opt-${SCONS_OS}-x86-64/staging', |
130 'SCONS_STAGING_ARM' : '${SCONS_OUT}/opt-${SCONS_OS}-arm/staging', | 132 'SCONS_STAGING_ARM' : '${SCONS_OUT}/opt-${SCONS_OS}-arm/staging', |
| 133 'SCONS_STAGING_MIPS32': '${SCONS_OUT}/opt-${SCONS_OS}-mips32/staging', |
131 | 134 |
132 'SEL_UNIVERSAL_PREFIX': '${USE_EMULATOR ? ${EMULATOR}}', | 135 'SEL_UNIVERSAL_PREFIX': '${USE_EMULATOR ? ${EMULATOR}}', |
133 'SEL_UNIVERSAL' : '${SCONS_STAGING}/sel_universal${EXEC_EXT}', | 136 'SEL_UNIVERSAL' : '${SCONS_STAGING}/sel_universal${EXEC_EXT}', |
134 # NOTE: -Q skips sel_ldr qualification tests, -c -c skips validation | 137 # 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 | 138 # NOTE: We are not using -B to load the IRT, since the translators do not |
136 # use the IRT. | 139 # use the IRT. |
137 'SEL_UNIVERSAL_FLAGS' : '--abort_on_error ' + | 140 'SEL_UNIVERSAL_FLAGS' : '--abort_on_error ' + |
138 '--uses_reverse_service ' + | 141 '--uses_reverse_service ' + |
139 '${USE_EMULATOR ? -Q -c -c --command_prefix ${EMULATOR
}}', | 142 '${USE_EMULATOR ? -Q -c -c --command_prefix ${EMULATOR
}}', |
140 | 143 |
141 'EMULATOR' : '${EMULATOR_%ARCH%}', | 144 'EMULATOR' : '${EMULATOR_%ARCH%}', |
142 'EMULATOR_X8632' : '', | 145 'EMULATOR_X8632' : '', |
143 'EMULATOR_X8664' : '', | 146 'EMULATOR_X8664' : '', |
144 # NOTE: this is currently the only dependency on the arm trusted TC | 147 # NOTE: this is currently the only dependency on the arm trusted TC |
145 'EMULATOR_ARM' : | 148 'EMULATOR_ARM' : |
146 '${BASE_NACL}/toolchain/linux_arm-trusted/run_under_qemu_arm', | 149 '${BASE_NACL}/toolchain/linux_arm-trusted/run_under_qemu_arm', |
| 150 'EMULATOR_MIPS32' : |
| 151 '${BASE_NACL}/toolchain/linux_mips-trusted/run_under_qemu_mips32', |
147 | 152 |
148 'SEL_LDR' : '${SCONS_STAGING}/sel_ldr${EXEC_EXT}', | 153 'SEL_LDR' : '${SCONS_STAGING}/sel_ldr${EXEC_EXT}', |
149 'BOOTSTRAP_LDR' : '${SCONS_STAGING}/nacl_helper_bootstrap${EXEC_EXT}', | 154 'BOOTSTRAP_LDR' : '${SCONS_STAGING}/nacl_helper_bootstrap${EXEC_EXT}', |
150 | 155 |
151 # sandboxed llvm backend | 156 # sandboxed llvm backend |
152 'LLC_SB' : '${TRANSLATOR_BIN}/llc.nexe', | 157 'LLC_SB' : '${TRANSLATOR_BIN}/llc.nexe', |
153 # sandboxed linker (gold based) | 158 # sandboxed linker (gold based) |
154 'LD_SB' : '${TRANSLATOR_BIN}/ld.nexe', | 159 'LD_SB' : '${TRANSLATOR_BIN}/ld.nexe', |
155 | 160 |
156 # Bitcode LLVM tools | 161 # Bitcode LLVM tools |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
509 | 514 |
510 | 515 |
511 env = Environment() | 516 env = Environment() |
512 | 517 |
513 def override_env(meth_name, func): | 518 def override_env(meth_name, func): |
514 """Override a method in the global |env|, given the method name | 519 """Override a method in the global |env|, given the method name |
515 and the new function. | 520 and the new function. |
516 """ | 521 """ |
517 global env | 522 global env |
518 setattr(env, meth_name, types.MethodType(func, env, Environment)) | 523 setattr(env, meth_name, types.MethodType(func, env, Environment)) |
OLD | NEW |