| 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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 # | 199 # |
| 200 if env.Bit('windows'): | 200 if env.Bit('windows'): |
| 201 ldr_inputs += [ | 201 ldr_inputs += [ |
| 202 'win/debug_exception_handler.c', | 202 'win/debug_exception_handler.c', |
| 203 'win/debug_exception_handler_standalone.c', | 203 'win/debug_exception_handler_standalone.c', |
| 204 'win/nacl_signal_stack.c', | 204 'win/nacl_signal_stack.c', |
| 205 'win/thread_handle_map.c', | 205 'win/thread_handle_map.c', |
| 206 'win/thread_suspension.c', | 206 'win/thread_suspension.c', |
| 207 'win/sel_addrspace_win.c', | 207 'win/sel_addrspace_win.c', |
| 208 ] | 208 ] |
| 209 if env.Bit('target_x86_32'): | 209 if env.Bit('build_x86_32'): |
| 210 ldr_inputs += [ | 210 ldr_inputs += [ |
| 211 'win/nacl_signal_32.c', | 211 'win/nacl_signal_32.c', |
| 212 ] | 212 ] |
| 213 elif env.Bit('target_x86_64'): | 213 elif env.Bit('build_x86_64'): |
| 214 ldr_inputs += [ | 214 ldr_inputs += [ |
| 215 'win/exception_patch/exit_fast.S', | 215 'win/exception_patch/exit_fast.S', |
| 216 'win/exception_patch/intercept.S', | 216 'win/exception_patch/intercept.S', |
| 217 'win/exception_patch/ntdll_patch.c', | 217 'win/exception_patch/ntdll_patch.c', |
| 218 'win/nacl_signal_64.c', | 218 'win/nacl_signal_64.c', |
| 219 ] | 219 ] |
| 220 else: | 220 else: |
| 221 raise Exception("Unsupported target") | 221 raise Exception("Unsupported target") |
| 222 | 222 |
| 223 if env.Bit('linux'): | 223 if env.Bit('linux'): |
| 224 ldr_inputs += [ | 224 ldr_inputs += [ |
| 225 'linux/thread_suspension.c', | 225 'linux/thread_suspension.c', |
| 226 'posix/nacl_signal_stack.c', | 226 'posix/nacl_signal_stack.c', |
| 227 'posix/sel_addrspace_posix.c' | 227 'posix/sel_addrspace_posix.c' |
| 228 ] | 228 ] |
| 229 if env.Bit('target_arm'): | 229 if env.Bit('build_arm'): |
| 230 ldr_inputs += ['linux/nacl_signal_arm.c'] | 230 ldr_inputs += ['linux/nacl_signal_arm.c'] |
| 231 elif env.Bit('target_mips32'): | 231 elif env.Bit('build_mips32'): |
| 232 ldr_inputs += ['linux/nacl_signal_mips.c'] | 232 ldr_inputs += ['linux/nacl_signal_mips.c'] |
| 233 elif env.Bit('target_x86_32'): | 233 elif env.Bit('build_x86_32'): |
| 234 ldr_inputs += ['linux/nacl_signal_32.c'] | 234 ldr_inputs += ['linux/nacl_signal_32.c'] |
| 235 elif env.Bit('target_x86_64'): | 235 elif env.Bit('build_x86_64'): |
| 236 ldr_inputs += ['linux/nacl_signal_64.c'] | 236 ldr_inputs += ['linux/nacl_signal_64.c'] |
| 237 else: | 237 else: |
| 238 raise Exception("Unsupported target") | 238 raise Exception("Unsupported target") |
| 239 | 239 |
| 240 nacl_signal_env = env.Clone() | 240 nacl_signal_env = env.Clone() |
| 241 if env.Bit('target_x86_32'): | 241 if env.Bit('build_x86_32'): |
| 242 # nacl_signal.c needs to be compiled without the stack protector | 242 # nacl_signal.c needs to be compiled without the stack protector |
| 243 # on i386. | 243 # on i386. |
| 244 # See https://code.google.com/p/nativeclient/issues/detail?id=3581. | 244 # See https://code.google.com/p/nativeclient/issues/detail?id=3581. |
| 245 nacl_signal_env.FilterOut(CCFLAGS=['-fstack-protector', | 245 nacl_signal_env.FilterOut(CCFLAGS=['-fstack-protector', |
| 246 '-fstack-protector-all']) | 246 '-fstack-protector-all']) |
| 247 nacl_signal_env.Append(CCFLAGS=['-fno-stack-protector']) | 247 nacl_signal_env.Append(CCFLAGS=['-fno-stack-protector']) |
| 248 ldr_inputs += [nacl_signal_env.ComponentObject('linux/nacl_signal.c')] | 248 ldr_inputs += [nacl_signal_env.ComponentObject('linux/nacl_signal.c')] |
| 249 | 249 |
| 250 if env.Bit('mac'): | 250 if env.Bit('mac'): |
| 251 ldr_inputs += [ | 251 ldr_inputs += [ |
| 252 'osx/thread_suspension.c', | 252 'osx/thread_suspension.c', |
| 253 'posix/nacl_signal_stack.c', | 253 'posix/nacl_signal_stack.c', |
| 254 'posix/sel_addrspace_posix.c' | 254 'posix/sel_addrspace_posix.c' |
| 255 ] | 255 ] |
| 256 if env.Bit('target_x86_32'): | 256 if env.Bit('build_x86_32'): |
| 257 ldr_inputs += ['osx/nacl_signal_32.c'] | 257 ldr_inputs += ['osx/nacl_signal_32.c'] |
| 258 elif env.Bit('target_x86_64'): | 258 elif env.Bit('build_x86_64'): |
| 259 ldr_inputs += ['osx/nacl_signal_64.c'] | 259 ldr_inputs += ['osx/nacl_signal_64.c'] |
| 260 else: | 260 else: |
| 261 raise Exception("Unsupported target") | 261 raise Exception("Unsupported target") |
| 262 | 262 |
| 263 if env.Bit('windows'): | 263 if env.Bit('windows'): |
| 264 ldr_inputs += [ | 264 ldr_inputs += [ |
| 265 'win/nacl_syscall_impl.c', | 265 'win/nacl_syscall_impl.c', |
| 266 'win/vm_hole.c', | 266 'win/vm_hole.c', |
| 267 ] | 267 ] |
| 268 else: | 268 else: |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 'nacl_ldt_unittest.c', | 359 'nacl_ldt_unittest.c', |
| 360 EXTRA_LIBS=['sel', | 360 EXTRA_LIBS=['sel', |
| 361 'env_cleanser', | 361 'env_cleanser', |
| 362 'nacl_perf_counter', | 362 'nacl_perf_counter', |
| 363 'nacl_fault_inject', | 363 'nacl_fault_inject', |
| 364 'platform', | 364 'platform', |
| 365 ]) | 365 ]) |
| 366 | 366 |
| 367 env.SDKInstallBin('sel_ldr', SEL_LDR_NODE) | 367 env.SDKInstallBin('sel_ldr', SEL_LDR_NODE) |
| 368 | 368 |
| 369 if env.Bit('linux') and env.Bit('target_x86_64'): | 369 if env.Bit('linux') and env.Bit('build_x86_64'): |
| 370 sel_ldr_seccomp_node = env.ComponentProgram('sel_ldr_seccomp', | 370 sel_ldr_seccomp_node = env.ComponentProgram('sel_ldr_seccomp', |
| 371 ['sel_ldr_seccomp_main.c'], | 371 ['sel_ldr_seccomp_main.c'], |
| 372 EXTRA_LIBS=['sel_main', | 372 EXTRA_LIBS=['sel_main', |
| 373 'seccomp_bpf']) | 373 'seccomp_bpf']) |
| 374 env.SDKInstallBin('sel_ldr_seccomp', sel_ldr_seccomp_node) | 374 env.SDKInstallBin('sel_ldr_seccomp', sel_ldr_seccomp_node) |
| 375 | 375 |
| 376 env.EnsureRequiredBuildWarnings() | 376 env.EnsureRequiredBuildWarnings() |
| 377 | 377 |
| 378 # Bootstrap loader used on Linux. | 378 # Bootstrap loader used on Linux. |
| 379 if (env.Bit('linux') and not env.Bit('built_elsewhere')): | 379 if (env.Bit('linux') and not env.Bit('built_elsewhere')): |
| 380 bootstrap_env = env.Clone() | 380 bootstrap_env = env.Clone() |
| 381 bootstrap_env.Replace(CLANG_OPTS='') | 381 bootstrap_env.Replace(CLANG_OPTS='') |
| 382 bootstrap_env.FilterOut(CCFLAGS=['-fstack-protector', '-fPIC', '-fPIE', | 382 bootstrap_env.FilterOut(CCFLAGS=['-fstack-protector', '-fPIC', '-fPIE', |
| 383 '-pedantic', '$COVERAGE_CCFLAGS'], | 383 '-pedantic', '$COVERAGE_CCFLAGS'], |
| 384 CFLAGS=['-Wdeclaration-after-statement']) | 384 CFLAGS=['-Wdeclaration-after-statement']) |
| 385 bootstrap_env.Append(CCFLAGS=['-fno-pic', '-fno-PIC', '-fno-pie', '-fno-pie', | 385 bootstrap_env.Append(CCFLAGS=['-fno-pic', '-fno-PIC', '-fno-pie', '-fno-pie', |
| 386 '-fno-stack-protector']) | 386 '-fno-stack-protector']) |
| 387 | 387 |
| 388 # TODO(bbudge) Remove -Qunused-arguments when Clang supports -fno-pic. | 388 # TODO(bbudge) Remove -Qunused-arguments when Clang supports -fno-pic. |
| 389 if env.Bit('clang'): | 389 if env.Bit('clang'): |
| 390 bootstrap_env.Append(CCFLAGS=['-ffreestanding', | 390 bootstrap_env.Append(CCFLAGS=['-ffreestanding', |
| 391 '-U__STDC_HOSTED__', | 391 '-U__STDC_HOSTED__', |
| 392 '-D__STDC_HOSTED__=1', | 392 '-D__STDC_HOSTED__=1', |
| 393 '-Qunused-arguments']) | 393 '-Qunused-arguments']) |
| 394 | 394 |
| 395 if env.Bit('target_x86_64'): | 395 if env.Bit('build_x86_64'): |
| 396 ld_emul = 'elf_x86_64' | 396 ld_emul = 'elf_x86_64' |
| 397 if env.Bit('x86_64_zero_based_sandbox'): | 397 if env.Bit('x86_64_zero_based_sandbox'): |
| 398 # For the zero-based 64-bit sandbox, we want to reserve 44GB of address | 398 # For the zero-based 64-bit sandbox, we want to reserve 44GB of address |
| 399 # space: 4GB for the program plus 40GB of guard pages. Due to a binutils | 399 # space: 4GB for the program plus 40GB of guard pages. Due to a binutils |
| 400 # bug (see http://sourceware.org/bugzilla/show_bug.cgi?id=13400), the | 400 # bug (see http://sourceware.org/bugzilla/show_bug.cgi?id=13400), the |
| 401 # amount of address space that the linker can pre-reserve is capped | 401 # amount of address space that the linker can pre-reserve is capped |
| 402 # at 4GB. For proper reservation, GNU ld version 2.22 or higher | 402 # at 4GB. For proper reservation, GNU ld version 2.22 or higher |
| 403 # needs to be used. | 403 # needs to be used. |
| 404 # | 404 # |
| 405 # Without the bug fix, trying to reserve 44GB will result in | 405 # Without the bug fix, trying to reserve 44GB will result in |
| 406 # pre-reserving the entire capped space of 4GB. This tricks the run-time | 406 # pre-reserving the entire capped space of 4GB. This tricks the run-time |
| 407 # into thinking that we can mmap up to 44GB. This is unsafe as it can | 407 # into thinking that we can mmap up to 44GB. This is unsafe as it can |
| 408 # overwrite the run-time program itself and/or other programs. Because | 408 # overwrite the run-time program itself and/or other programs. Because |
| 409 # of this, we only reserve 4GB. | 409 # of this, we only reserve 4GB. |
| 410 # | 410 # |
| 411 # TODO(arbenson): remove these comments and reserve 44GB once the | 411 # TODO(arbenson): remove these comments and reserve 44GB once the |
| 412 # necessary ld version becomes standard. | 412 # necessary ld version becomes standard. |
| 413 reserve_top = '0x100000000' | 413 reserve_top = '0x100000000' |
| 414 # The reserve_top value gets interpreted as a pointer in | 414 # The reserve_top value gets interpreted as a pointer in |
| 415 # linux/nacl_bootstrap.c. By default, mcmodel is set to small, | 415 # linux/nacl_bootstrap.c. By default, mcmodel is set to small, |
| 416 # which restricts code and data to the first 2GB. With | 416 # which restricts code and data to the first 2GB. With |
| 417 # mcmodel set to small or medium, the reserve_top value is | 417 # mcmodel set to small or medium, the reserve_top value is |
| 418 # truncated, which produces an error. With mcmodel set to large, | 418 # truncated, which produces an error. With mcmodel set to large, |
| 419 # there is no restriction on the code and data, so we can | 419 # there is no restriction on the code and data, so we can |
| 420 # safely set reserve_top to 0x100000000. | 420 # safely set reserve_top to 0x100000000. |
| 421 bootstrap_env.Append(CCFLAGS=['-mcmodel=large']) | 421 bootstrap_env.Append(CCFLAGS=['-mcmodel=large']) |
| 422 else: | 422 else: |
| 423 reserve_top = '0x0' | 423 reserve_top = '0x0' |
| 424 elif env.Bit('target_x86_32'): | 424 elif env.Bit('build_x86_32'): |
| 425 ld_emul = 'elf_i386' | 425 ld_emul = 'elf_i386' |
| 426 reserve_top = '0x40000000' | 426 reserve_top = '0x40000000' |
| 427 elif env.Bit('target_arm'): | 427 elif env.Bit('build_arm'): |
| 428 ld_emul = 'armelf_linux_eabi' | 428 ld_emul = 'armelf_linux_eabi' |
| 429 reserve_top = '0x40002000' | 429 reserve_top = '0x40002000' |
| 430 elif env.Bit('target_mips32'): | 430 elif env.Bit('build_mips32'): |
| 431 ld_emul = 'elf32ltsmip' | 431 ld_emul = 'elf32ltsmip' |
| 432 reserve_top = '0x40008000' | 432 reserve_top = '0x40008000' |
| 433 | 433 |
| 434 bootstrap_obj = bootstrap_env.ComponentObject('linux/nacl_bootstrap.c') | 434 bootstrap_obj = bootstrap_env.ComponentObject('linux/nacl_bootstrap.c') |
| 435 bootstrap_raw = bootstrap_env.Command( | 435 bootstrap_raw = bootstrap_env.Command( |
| 436 'nacl_bootstrap_raw', | 436 'nacl_bootstrap_raw', |
| 437 [bootstrap_obj], | 437 [bootstrap_obj], |
| 438 ("env CXX='${CXX}' ${PYTHON} %s " + | 438 ("env CXX='${CXX}' ${PYTHON} %s " + |
| 439 '-m %s --build-id -static -z max-page-size=0x1000 ' + | 439 '-m %s --build-id -static -z max-page-size=0x1000 ' + |
| 440 '--defsym RESERVE_TOP=%s --script %s -o ${TARGET} ${SOURCES}') % | 440 '--defsym RESERVE_TOP=%s --script %s -o ${TARGET} ${SOURCES}') % |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 'env_cleanser', | 511 'env_cleanser', |
| 512 'nacl_perf_counter', | 512 'nacl_perf_counter', |
| 513 ]) | 513 ]) |
| 514 | 514 |
| 515 node = env.CommandTest( | 515 node = env.CommandTest( |
| 516 'format_string_test.out', | 516 'format_string_test.out', |
| 517 command=[format_string_test_exe]) | 517 command=[format_string_test_exe]) |
| 518 env.AddNodeToTestSuite(node, ['small_tests'], 'run_format_string_test') | 518 env.AddNodeToTestSuite(node, ['small_tests'], 'run_format_string_test') |
| 519 | 519 |
| 520 | 520 |
| 521 if env.Bit('target_x86_32'): | 521 if env.Bit('build_x86_32'): |
| 522 arch_testdata_dir = 'testdata/x86_32' | 522 arch_testdata_dir = 'testdata/x86_32' |
| 523 elif env.Bit('target_x86_64'): | 523 elif env.Bit('build_x86_64'): |
| 524 arch_testdata_dir = 'testdata/x86_64' | 524 arch_testdata_dir = 'testdata/x86_64' |
| 525 else: | 525 else: |
| 526 arch_testdata_dir = 'testdata/' + env['TARGET_ARCHITECTURE'] | 526 arch_testdata_dir = 'testdata/' + env['TARGET_ARCHITECTURE'] |
| 527 | 527 |
| 528 untrusted_env = env.MakeUntrustedNativeEnv() | 528 untrusted_env = env.MakeUntrustedNativeEnv() |
| 529 hello_world_nexe = untrusted_env.File('$STAGING_DIR/hello_world.nexe') | 529 hello_world_nexe = untrusted_env.File('$STAGING_DIR/hello_world.nexe') |
| 530 | 530 |
| 531 # Doesn't work on windows under coverage. | 531 # Doesn't work on windows under coverage. |
| 532 # TODO(bradnelson): fix this to work on windows under coverage. | 532 # TODO(bradnelson): fix this to work on windows under coverage. |
| 533 if ((not env.Bit('windows') or not env.Bit('coverage_enabled')) and | 533 if ((not env.Bit('windows') or not env.Bit('coverage_enabled')) and |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 622 ['nacl_resource_test.c'], | 622 ['nacl_resource_test.c'], |
| 623 EXTRA_LIBS=['sel']) | 623 EXTRA_LIBS=['sel']) |
| 624 node = env.CommandTest( | 624 node = env.CommandTest( |
| 625 'nacl_resource_test.out', | 625 'nacl_resource_test.out', |
| 626 command=[nacl_resource_test_exe]) | 626 command=[nacl_resource_test_exe]) |
| 627 env.AddNodeToTestSuite(node, ['small_tests'], 'run_nacl_resource_test') | 627 env.AddNodeToTestSuite(node, ['small_tests'], 'run_nacl_resource_test') |
| 628 | 628 |
| 629 # Test nacl_signal | 629 # Test nacl_signal |
| 630 if env.Bit('linux'): | 630 if env.Bit('linux'): |
| 631 if (not env.Bit('coverage_enabled') and | 631 if (not env.Bit('coverage_enabled') and |
| 632 not env.Bit('target_arm') and | 632 not env.Bit('build_arm') and |
| 633 not env.Bit('target_mips32') and | 633 not env.Bit('build_mips32') and |
| 634 not env.IsRunningUnderValgrind()): | 634 not env.IsRunningUnderValgrind()): |
| 635 nacl_signal_exe = env.ComponentProgram( | 635 nacl_signal_exe = env.ComponentProgram( |
| 636 'nacl_signal_unittest', 'nacl_signal_unittest.c', | 636 'nacl_signal_unittest', 'nacl_signal_unittest.c', |
| 637 EXTRA_LIBS=['sel']) | 637 EXTRA_LIBS=['sel']) |
| 638 node = env.CommandTest('nacl_signal_unittest.out', | 638 node = env.CommandTest('nacl_signal_unittest.out', |
| 639 command=[nacl_signal_exe]) | 639 command=[nacl_signal_exe]) |
| 640 | 640 |
| 641 env.AddNodeToTestSuite(node, ['small_tests'], 'run_nacl_signal_test') | 641 env.AddNodeToTestSuite(node, ['small_tests'], 'run_nacl_signal_test') |
| 642 | 642 |
| 643 test_prog = env.ComponentProgram('nacl_signal_frame_test', | 643 test_prog = env.ComponentProgram('nacl_signal_frame_test', |
| 644 'nacl_signal_frame_test.c', | 644 'nacl_signal_frame_test.c', |
| 645 EXTRA_LIBS=['sel']) | 645 EXTRA_LIBS=['sel']) |
| 646 node = env.CommandTest('nacl_signal_frame_test.out', | 646 node = env.CommandTest('nacl_signal_frame_test.out', |
| 647 command=[test_prog], | 647 command=[test_prog], |
| 648 declares_exit_status=True, | 648 declares_exit_status=True, |
| 649 using_nacl_signal_handler=True) | 649 using_nacl_signal_handler=True) |
| 650 env.AddNodeToTestSuite(node, ['small_tests'], 'run_signal_frame_test') | 650 env.AddNodeToTestSuite(node, ['small_tests'], 'run_signal_frame_test') |
| 651 | 651 |
| 652 if env.Bit('windows') and env.Bit('target_x86_64'): | 652 if env.Bit('windows') and env.Bit('build_x86_64'): |
| 653 test_prog = env.ComponentProgram('patch_ntdll_test', | 653 test_prog = env.ComponentProgram('patch_ntdll_test', |
| 654 'win/exception_patch/ntdll_test.c', | 654 'win/exception_patch/ntdll_test.c', |
| 655 EXTRA_LIBS=['sel', | 655 EXTRA_LIBS=['sel', |
| 656 'nacl_fault_inject', | 656 'nacl_fault_inject', |
| 657 'nacl_interval', | 657 'nacl_interval', |
| 658 'platform', | 658 'platform', |
| 659 ]) | 659 ]) |
| 660 node = env.CommandTest('patch_ntdll_test.out', | 660 node = env.CommandTest('patch_ntdll_test.out', |
| 661 command=[test_prog], declares_exit_status=True) | 661 command=[test_prog], declares_exit_status=True) |
| 662 env.AddNodeToTestSuite(node, ['small_tests'], 'run_patch_ntdll_test') | 662 env.AddNodeToTestSuite(node, ['small_tests'], 'run_patch_ntdll_test') |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 770 # it. | 770 # it. |
| 771 nullptr_nexe = untrusted_env.GetTranslatedNexe( | 771 nullptr_nexe = untrusted_env.GetTranslatedNexe( |
| 772 untrusted_env.File('$STAGING_DIR/nullptr$PROGSUFFIX')) | 772 untrusted_env.File('$STAGING_DIR/nullptr$PROGSUFFIX')) |
| 773 | 773 |
| 774 node = env.CommandSelLdrTestNacl( | 774 node = env.CommandSelLdrTestNacl( |
| 775 'fuzz_nullptr_test.out', | 775 'fuzz_nullptr_test.out', |
| 776 nullptr_nexe, | 776 nullptr_nexe, |
| 777 sel_ldr_flags=['-F']) | 777 sel_ldr_flags=['-F']) |
| 778 env.AddNodeToTestSuite(node, ['small_tests'], 'run_fuzz_nullptr_test') | 778 env.AddNodeToTestSuite(node, ['small_tests'], 'run_fuzz_nullptr_test') |
| 779 | 779 |
| 780 if env.Bit('target_mips32'): | 780 if env.Bit('build_mips32'): |
| 781 text_region_start = 0x00020000 | 781 text_region_start = 0x00020000 |
| 782 # Use arbitrary non-page-aligned addresses for data and rodata. | 782 # Use arbitrary non-page-aligned addresses for data and rodata. |
| 783 rodata_region_start = 0x10020094 | 783 rodata_region_start = 0x10020094 |
| 784 data_region_start = 0x10030098 | 784 data_region_start = 0x10030098 |
| 785 untrusted_env.Append(CPPFLAGS=['--pnacl-allow-native', '-arch', 'mips32']) | 785 untrusted_env.Append(CPPFLAGS=['--pnacl-allow-native', '-arch', 'mips32']) |
| 786 unaligned_data_objs = untrusted_env.ComponentObject( | 786 unaligned_data_objs = untrusted_env.ComponentObject( |
| 787 'arch/mips/unaligned_data_test.S') | 787 'arch/mips/unaligned_data_test.S') |
| 788 unaligned_data_nexe = untrusted_env.ComponentProgram( | 788 unaligned_data_nexe = untrusted_env.ComponentProgram( |
| 789 'unaligned_data.nexe', | 789 'unaligned_data.nexe', |
| 790 unaligned_data_objs, | 790 unaligned_data_objs, |
| (...skipping 27 matching lines...) Expand all Loading... |
| 818 'unaligned_data_irt.out', | 818 'unaligned_data_irt.out', |
| 819 unaligned_data_nexe, | 819 unaligned_data_nexe, |
| 820 sel_ldr_flags=['-B', unaligned_data_irt_nexe] | 820 sel_ldr_flags=['-B', unaligned_data_irt_nexe] |
| 821 ) | 821 ) |
| 822 env.AddNodeToTestSuite(node, ['small_tests'], 'run_unaligned_data_irt_test') | 822 env.AddNodeToTestSuite(node, ['small_tests'], 'run_unaligned_data_irt_test') |
| 823 | 823 |
| 824 # ---------------------------------------------------------- | 824 # ---------------------------------------------------------- |
| 825 # Small tests with canned binaries | 825 # Small tests with canned binaries |
| 826 # ---------------------------------------------------------- | 826 # ---------------------------------------------------------- |
| 827 | 827 |
| 828 if env.Bit('target_x86_64'): | 828 if env.Bit('build_x86_64'): |
| 829 node = env.CommandSelLdrTestNacl( | 829 node = env.CommandSelLdrTestNacl( |
| 830 'hello_x32.out', | 830 'hello_x32.out', |
| 831 env.File(os.path.join(arch_testdata_dir, 'hello_x32.nexe')), | 831 env.File(os.path.join(arch_testdata_dir, 'hello_x32.nexe')), |
| 832 stdout_golden=env.File(os.path.join('${MAIN_DIR}', | 832 stdout_golden=env.File(os.path.join('${MAIN_DIR}', |
| 833 'tests/hello_world', | 833 'tests/hello_world', |
| 834 'hello_world.stdout')) | 834 'hello_world.stdout')) |
| 835 ) | 835 ) |
| 836 env.AddNodeToTestSuite(node, ['small_tests'], 'run_hello_x32_test') | 836 env.AddNodeToTestSuite(node, ['small_tests'], 'run_hello_x32_test') |
| 837 | 837 |
| 838 # ---------------------------------------------------------- | 838 # ---------------------------------------------------------- |
| (...skipping 22 matching lines...) Expand all Loading... |
| 861 node = env.SelUniversalTest( | 861 node = env.SelUniversalTest( |
| 862 test + '_canned.out', | 862 test + '_canned.out', |
| 863 env.File(arch_testdata_dir + '/' + test + '.nexe'), | 863 env.File(arch_testdata_dir + '/' + test + '.nexe'), |
| 864 stdin = location + '.stdin', | 864 stdin = location + '.stdin', |
| 865 stdout_golden = location + '.stdout', | 865 stdout_golden = location + '.stdout', |
| 866 ) | 866 ) |
| 867 env.AddNodeToTestSuite(node, | 867 env.AddNodeToTestSuite(node, |
| 868 ['medium_tests'], | 868 ['medium_tests'], |
| 869 'run_%s_integration_test' % test) | 869 'run_%s_integration_test' % test) |
| 870 | 870 |
| 871 if env.Bit('target_x86') and env.Bit('nacl_static_link'): | 871 if env.Bit('build_x86') and env.Bit('nacl_static_link'): |
| 872 RE_HELLO = '^(Hello, World!)$' | 872 RE_HELLO = '^(Hello, World!)$' |
| 873 RE_IDENT = '^\[[0-9,:.]*\] (e_ident\+1 = ELF)$' | 873 RE_IDENT = '^\[[0-9,:.]*\] (e_ident\+1 = ELF)$' |
| 874 | 874 |
| 875 node = env.CommandSelLdrTestNacl( | 875 node = env.CommandSelLdrTestNacl( |
| 876 'nacl_log.out', | 876 'nacl_log.out', |
| 877 hello_world_nexe, | 877 hello_world_nexe, |
| 878 log_golden = env.File('testdata/hello_world.log'), | 878 log_golden = env.File('testdata/hello_world.log'), |
| 879 stdout_golden = env.File('testdata/hello_world.stdout'), | 879 stdout_golden = env.File('testdata/hello_world.stdout'), |
| 880 filter_regex = '"' + RE_HELLO + '|' + RE_IDENT + '"', | 880 filter_regex = '"' + RE_HELLO + '|' + RE_IDENT + '"', |
| 881 filter_group_only = 'true', | 881 filter_group_only = 'true', |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 927 test + '.out', | 927 test + '.out', |
| 928 env.File(arch_testdata_dir + '/' + test + '.nexe'), | 928 env.File(arch_testdata_dir + '/' + test + '.nexe'), |
| 929 stderr_golden = stderr_file, | 929 stderr_golden = stderr_file, |
| 930 filter_regex = ERROR_WHILE_LOADING, | 930 filter_regex = ERROR_WHILE_LOADING, |
| 931 filter_group_only = 'true', | 931 filter_group_only = 'true', |
| 932 exit_status = '1') | 932 exit_status = '1') |
| 933 env.AddNodeToTestSuite(node, ['medium_tests'], | 933 env.AddNodeToTestSuite(node, ['medium_tests'], |
| 934 'run_' + test + '_death_test') | 934 'run_' + test + '_death_test') |
| 935 | 935 |
| 936 | 936 |
| 937 if env.Bit('target_x86'): | 937 if env.Bit('build_x86'): |
| 938 if env.Bit('build_x86_32'): | 938 if env.Bit('build_x86_32'): |
| 939 skip = NOT_AVAIL_X86_32 | 939 skip = NOT_AVAIL_X86_32 |
| 940 else: | 940 else: |
| 941 skip = NOT_AVAIL_X86_64 | 941 skip = NOT_AVAIL_X86_64 |
| 942 | 942 |
| 943 for death_test in DEATH_TESTS_X86: | 943 for death_test in DEATH_TESTS_X86: |
| 944 AddDeathTest(death_test, skip) | 944 AddDeathTest(death_test, skip) |
| 945 | 945 |
| 946 # ---------------------------------------------------------- | 946 # ---------------------------------------------------------- |
| 947 # More Death Tests | 947 # More Death Tests |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1016 is_broken=is_broken) | 1016 is_broken=is_broken) |
| 1017 | 1017 |
| 1018 dyn_array_test_exe = env.ComponentProgram('dyn_array_test', | 1018 dyn_array_test_exe = env.ComponentProgram('dyn_array_test', |
| 1019 ['dyn_array_test.c'], | 1019 ['dyn_array_test.c'], |
| 1020 EXTRA_LIBS=sel_ldr_libs) | 1020 EXTRA_LIBS=sel_ldr_libs) |
| 1021 | 1021 |
| 1022 node = env.CommandTest('dyn_array_test.out', | 1022 node = env.CommandTest('dyn_array_test.out', |
| 1023 command=[dyn_array_test_exe]) | 1023 command=[dyn_array_test_exe]) |
| 1024 | 1024 |
| 1025 env.AddNodeToTestSuite(node, ['small_tests'], 'run_dyn_array_test') | 1025 env.AddNodeToTestSuite(node, ['small_tests'], 'run_dyn_array_test') |
| OLD | NEW |