OLD | NEW |
1 # -*- python -*- | 1 # -*- 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 import platform | 6 import platform |
7 import os | 7 import os |
8 | 8 |
9 Import('env') | 9 Import('env') |
10 | 10 |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 if env.Bit('target_arm_thumb2'): | 130 if env.Bit('target_arm_thumb2'): |
131 thumb2_env = env.Clone() | 131 thumb2_env = env.Clone() |
132 thumb2_env.Append(ASFLAGS=['-mthumb']) | 132 thumb2_env.Append(ASFLAGS=['-mthumb']) |
133 ldr_inputs += [ | 133 ldr_inputs += [ |
134 thumb2_env.DualObject('arch/arm/tramp_arm_thumb2.S'), | 134 thumb2_env.DualObject('arch/arm/tramp_arm_thumb2.S'), |
135 ] | 135 ] |
136 else: | 136 else: |
137 ldr_inputs += [ | 137 ldr_inputs += [ |
138 'arch/arm/tramp_arm.S', | 138 'arch/arm/tramp_arm.S', |
139 ] | 139 ] |
| 140 elif env.Bit('build_mips32'): |
| 141 ldr_inputs += [ |
| 142 'arch/mips/nacl_app.c', |
| 143 'arch/mips/nacl_switch_to_app_mips.c', |
| 144 'arch/mips/sel_rt.c', |
| 145 'arch/mips/nacl_tls.c', |
| 146 'arch/mips/sel_ldr_mips.c', |
| 147 'arch/mips/sel_addrspace_mips.c', |
| 148 'arch/mips/nacl_switch.S', |
| 149 'arch/mips/nacl_syscall.S', |
| 150 'arch/mips/tramp_mips.S', |
| 151 ] |
140 | 152 |
141 if env.Bit('windows'): | 153 if env.Bit('windows'): |
142 ldr_inputs += [ | 154 ldr_inputs += [ |
143 'win/addrspace_teardown.c', | 155 'win/addrspace_teardown.c', |
144 'win/nacl_ldt.c', | 156 'win/nacl_ldt.c', |
145 'win/nacl_thread_nice.c', | 157 'win/nacl_thread_nice.c', |
146 'win/sel_memory.c', | 158 'win/sel_memory.c', |
147 'win/sel_segments.c', | 159 'win/sel_segments.c', |
148 ] | 160 ] |
149 elif env.Bit('mac'): | 161 elif env.Bit('mac'): |
(...skipping 23 matching lines...) Expand all Loading... |
173 ] | 185 ] |
174 if env.Bit('build_x86'): | 186 if env.Bit('build_x86'): |
175 ldr_inputs += [ | 187 ldr_inputs += [ |
176 'linux/x86/nacl_ldt.c', | 188 'linux/x86/nacl_ldt.c', |
177 'posix/x86/sel_segments.c', | 189 'posix/x86/sel_segments.c', |
178 ] | 190 ] |
179 elif env.Bit('build_arm'): | 191 elif env.Bit('build_arm'): |
180 ldr_inputs += [ | 192 ldr_inputs += [ |
181 'linux/arm/sel_segments.c', | 193 'linux/arm/sel_segments.c', |
182 ] | 194 ] |
| 195 elif env.Bit('build_mips32'): |
| 196 ldr_inputs += [ |
| 197 'linux/mips/sel_segments.c', |
| 198 ] |
183 | 199 |
184 | 200 |
185 # ------------------------------------------------------------- | 201 # ------------------------------------------------------------- |
186 # Add OS and architecture specific signal handling files. | 202 # Add OS and architecture specific signal handling files. |
187 # | 203 # |
188 if env.Bit('windows'): | 204 if env.Bit('windows'): |
189 ldr_inputs += [ | 205 ldr_inputs += [ |
190 'win/debug_exception_handler.c', | 206 'win/debug_exception_handler.c', |
191 'win/debug_exception_handler_standalone.c', | 207 'win/debug_exception_handler_standalone.c', |
192 'win/nacl_signal.c', | 208 'win/nacl_signal.c', |
(...skipping 17 matching lines...) Expand all Loading... |
210 | 226 |
211 if env.Bit('linux'): | 227 if env.Bit('linux'): |
212 ldr_inputs += [ | 228 ldr_inputs += [ |
213 'linux/thread_suspension.c', | 229 'linux/thread_suspension.c', |
214 'posix/nacl_signal.c', | 230 'posix/nacl_signal.c', |
215 'posix/sel_addrspace_posix.c' | 231 'posix/sel_addrspace_posix.c' |
216 ] | 232 ] |
217 if env.Bit('target_arm'): | 233 if env.Bit('target_arm'): |
218 ldr_inputs += ['linux/nacl_signal_arm.c'] | 234 ldr_inputs += ['linux/nacl_signal_arm.c'] |
219 elif env.Bit('target_mips32'): | 235 elif env.Bit('target_mips32'): |
220 # TODO(petarj): Add support for MIPS. | 236 ldr_inputs += ['linux/nacl_signal_mips.c'] |
221 pass | |
222 elif env.Bit('target_x86_32'): | 237 elif env.Bit('target_x86_32'): |
223 ldr_inputs += ['linux/nacl_signal_32.c'] | 238 ldr_inputs += ['linux/nacl_signal_32.c'] |
224 elif env.Bit('target_x86_64'): | 239 elif env.Bit('target_x86_64'): |
225 ldr_inputs += ['linux/nacl_signal_64.c'] | 240 ldr_inputs += ['linux/nacl_signal_64.c'] |
226 else: | 241 else: |
227 raise Exception("Unsupported target") | 242 raise Exception("Unsupported target") |
228 | 243 |
229 if env.Bit('mac'): | 244 if env.Bit('mac'): |
230 ldr_inputs += [ | 245 ldr_inputs += [ |
231 'osx/thread_suspension.c', | 246 'osx/thread_suspension.c', |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 # safely set reserve_top to 0x100000000. | 407 # safely set reserve_top to 0x100000000. |
393 bootstrap_env.Append(CCFLAGS=['-mcmodel=large']) | 408 bootstrap_env.Append(CCFLAGS=['-mcmodel=large']) |
394 else: | 409 else: |
395 reserve_top = '0x0' | 410 reserve_top = '0x0' |
396 elif env.Bit('target_x86_32'): | 411 elif env.Bit('target_x86_32'): |
397 ld_emul = 'elf_i386' | 412 ld_emul = 'elf_i386' |
398 reserve_top = '0x40000000' | 413 reserve_top = '0x40000000' |
399 elif env.Bit('target_arm'): | 414 elif env.Bit('target_arm'): |
400 ld_emul = 'armelf_linux_eabi' | 415 ld_emul = 'armelf_linux_eabi' |
401 reserve_top = '0x40002000' | 416 reserve_top = '0x40002000' |
| 417 elif env.Bit('target_mips32'): |
| 418 ld_emul = 'elf32ltsmip' |
| 419 reserve_top = '0x40002000' |
402 | 420 |
403 bootstrap_obj = bootstrap_env.ComponentObject('linux/nacl_bootstrap.c') | 421 bootstrap_obj = bootstrap_env.ComponentObject('linux/nacl_bootstrap.c') |
404 bootstrap_raw = bootstrap_env.Command( | 422 bootstrap_raw = bootstrap_env.Command( |
405 'nacl_bootstrap_raw', | 423 'nacl_bootstrap_raw', |
406 [bootstrap_obj], | 424 [bootstrap_obj], |
407 ("env CXX='${CXX}' ${PYTHON} %s " + | 425 ("env CXX='${CXX}' ${PYTHON} %s " + |
408 '-m %s --build-id -static -z max-page-size=0x1000 ' + | 426 '-m %s --build-id -static -z max-page-size=0x1000 ' + |
409 '--defsym RESERVE_TOP=%s --script %s -o ${TARGET} ${SOURCES}') % | 427 '--defsym RESERVE_TOP=%s --script %s -o ${TARGET} ${SOURCES}') % |
410 (bootstrap_env.File('linux/ld_bfd.py'), ld_emul, reserve_top, | 428 (bootstrap_env.File('linux/ld_bfd.py'), ld_emul, reserve_top, |
411 bootstrap_env.File('linux/nacl_bootstrap.x')), | 429 bootstrap_env.File('linux/nacl_bootstrap.x')), |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
611 EXTRA_LIBS=['sel']) | 629 EXTRA_LIBS=['sel']) |
612 node = env.CommandTest( | 630 node = env.CommandTest( |
613 'nacl_resource_test.out', | 631 'nacl_resource_test.out', |
614 command=[nacl_resource_test_exe]) | 632 command=[nacl_resource_test_exe]) |
615 env.AddNodeToTestSuite(node, ['small_tests'], 'run_nacl_resource_test') | 633 env.AddNodeToTestSuite(node, ['small_tests'], 'run_nacl_resource_test') |
616 | 634 |
617 # Test nacl_signal | 635 # Test nacl_signal |
618 if env.Bit('posix'): | 636 if env.Bit('posix'): |
619 if (not env.Bit('coverage_enabled') and | 637 if (not env.Bit('coverage_enabled') and |
620 not env.Bit('target_arm') and | 638 not env.Bit('target_arm') and |
| 639 not env.Bit('target_mips32') and |
621 not env.IsRunningUnderValgrind()): | 640 not env.IsRunningUnderValgrind()): |
622 nacl_signal_exe = env.ComponentProgram( | 641 nacl_signal_exe = env.ComponentProgram( |
623 'nacl_signal_unittest', 'nacl_signal_unittest.c', | 642 'nacl_signal_unittest', 'nacl_signal_unittest.c', |
624 EXTRA_LIBS=['sel']) | 643 EXTRA_LIBS=['sel']) |
625 node = env.CommandTest('nacl_signal_unittest.out', | 644 node = env.CommandTest('nacl_signal_unittest.out', |
626 command=[nacl_signal_exe], | 645 command=[nacl_signal_exe], |
627 exit_status='trusted_sigsegv_or_equivalent', | 646 exit_status='trusted_sigsegv_or_equivalent', |
628 using_nacl_signal_handler=True) | 647 using_nacl_signal_handler=True) |
629 | 648 |
630 env.AddNodeToTestSuite(node, ['small_tests'], 'run_nacl_signal_test') | 649 env.AddNodeToTestSuite(node, ['small_tests'], 'run_nacl_signal_test') |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
975 node = env.CommandTest( | 994 node = env.CommandTest( |
976 'nacl_error_log_test.out', | 995 'nacl_error_log_test.out', |
977 command=[exe], | 996 command=[exe], |
978 exit_status=expected_exit, | 997 exit_status=expected_exit, |
979 filter_regex='"(NaClCrashLogWriter.*)|(This is a test of the emergency.*)"', | 998 filter_regex='"(NaClCrashLogWriter.*)|(This is a test of the emergency.*)"', |
980 filter_group_only='true', | 999 filter_group_only='true', |
981 stdout_golden=env.File('nacl_error_log_test.stdout')) | 1000 stdout_golden=env.File('nacl_error_log_test.stdout')) |
982 | 1001 |
983 env.AddNodeToTestSuite(node, ['small_tests'], | 1002 env.AddNodeToTestSuite(node, ['small_tests'], |
984 'run_nacl_error_log_test') | 1003 'run_nacl_error_log_test') |
OLD | NEW |