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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 # safely set reserve_top to 0x100000000. | 404 # safely set reserve_top to 0x100000000. |
390 bootstrap_env.Append(CCFLAGS=['-mcmodel=large']) | 405 bootstrap_env.Append(CCFLAGS=['-mcmodel=large']) |
391 else: | 406 else: |
392 reserve_top = '0x0' | 407 reserve_top = '0x0' |
393 elif env.Bit('target_x86_32'): | 408 elif env.Bit('target_x86_32'): |
394 ld_emul = 'elf_i386' | 409 ld_emul = 'elf_i386' |
395 reserve_top = '0x40000000' | 410 reserve_top = '0x40000000' |
396 elif env.Bit('target_arm'): | 411 elif env.Bit('target_arm'): |
397 ld_emul = 'armelf_linux_eabi' | 412 ld_emul = 'armelf_linux_eabi' |
398 reserve_top = '0x40002000' | 413 reserve_top = '0x40002000' |
| 414 elif env.Bit('target_mips32'): |
| 415 ld_emul = 'elf32ltsmip' |
| 416 reserve_top = '0x40002000' |
399 | 417 |
400 bootstrap_obj = bootstrap_env.ComponentObject('linux/nacl_bootstrap.c') | 418 bootstrap_obj = bootstrap_env.ComponentObject('linux/nacl_bootstrap.c') |
401 bootstrap_raw = bootstrap_env.Command( | 419 bootstrap_raw = bootstrap_env.Command( |
402 'nacl_bootstrap_raw', | 420 'nacl_bootstrap_raw', |
403 [bootstrap_obj], | 421 [bootstrap_obj], |
404 ("env CXX='${CXX}' ${PYTHON} %s " + | 422 ("env CXX='${CXX}' ${PYTHON} %s " + |
405 '-m %s --build-id -static -z max-page-size=0x1000 ' + | 423 '-m %s --build-id -static -z max-page-size=0x1000 ' + |
406 '--defsym RESERVE_TOP=%s --script %s -o ${TARGET} ${SOURCES}') % | 424 '--defsym RESERVE_TOP=%s --script %s -o ${TARGET} ${SOURCES}') % |
407 (bootstrap_env.File('linux/ld_bfd.py'), ld_emul, reserve_top, | 425 (bootstrap_env.File('linux/ld_bfd.py'), ld_emul, reserve_top, |
408 bootstrap_env.File('linux/nacl_bootstrap.x')), | 426 bootstrap_env.File('linux/nacl_bootstrap.x')), |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
608 EXTRA_LIBS=['sel']) | 626 EXTRA_LIBS=['sel']) |
609 node = env.CommandTest( | 627 node = env.CommandTest( |
610 'nacl_resource_test.out', | 628 'nacl_resource_test.out', |
611 command=[nacl_resource_test_exe]) | 629 command=[nacl_resource_test_exe]) |
612 env.AddNodeToTestSuite(node, ['small_tests'], 'run_nacl_resource_test') | 630 env.AddNodeToTestSuite(node, ['small_tests'], 'run_nacl_resource_test') |
613 | 631 |
614 # Test nacl_signal | 632 # Test nacl_signal |
615 if env.Bit('posix'): | 633 if env.Bit('posix'): |
616 if (not env.Bit('coverage_enabled') and | 634 if (not env.Bit('coverage_enabled') and |
617 not env.Bit('target_arm') and | 635 not env.Bit('target_arm') and |
| 636 not env.Bit('target_mips32') and |
618 not env.IsRunningUnderValgrind()): | 637 not env.IsRunningUnderValgrind()): |
619 nacl_signal_exe = env.ComponentProgram( | 638 nacl_signal_exe = env.ComponentProgram( |
620 'nacl_signal_unittest', 'nacl_signal_unittest.c', | 639 'nacl_signal_unittest', 'nacl_signal_unittest.c', |
621 EXTRA_LIBS=['sel']) | 640 EXTRA_LIBS=['sel']) |
622 node = env.CommandTest('nacl_signal_unittest.out', | 641 node = env.CommandTest('nacl_signal_unittest.out', |
623 command=[nacl_signal_exe], | 642 command=[nacl_signal_exe], |
624 exit_status='trusted_sigsegv_or_equivalent', | 643 exit_status='trusted_sigsegv_or_equivalent', |
625 using_nacl_signal_handler=True) | 644 using_nacl_signal_handler=True) |
626 | 645 |
627 env.AddNodeToTestSuite(node, ['small_tests'], 'run_nacl_signal_test') | 646 env.AddNodeToTestSuite(node, ['small_tests'], 'run_nacl_signal_test') |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
966 node = env.CommandTest( | 985 node = env.CommandTest( |
967 'nacl_error_log_test.out', | 986 'nacl_error_log_test.out', |
968 command=[exe], | 987 command=[exe], |
969 exit_status=expected_exit, | 988 exit_status=expected_exit, |
970 filter_regex='"(NaClCrashLogWriter.*)|(This is a test of the emergency.*)"', | 989 filter_regex='"(NaClCrashLogWriter.*)|(This is a test of the emergency.*)"', |
971 filter_group_only='true', | 990 filter_group_only='true', |
972 stdout_golden=env.File('nacl_error_log_test.stdout')) | 991 stdout_golden=env.File('nacl_error_log_test.stdout')) |
973 | 992 |
974 env.AddNodeToTestSuite(node, ['small_tests'], | 993 env.AddNodeToTestSuite(node, ['small_tests'], |
975 'run_nacl_error_log_test') | 994 'run_nacl_error_log_test') |
OLD | NEW |