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 atexit | 6 import atexit |
7 import json | 7 import json |
8 import os | 8 import os |
9 import platform | 9 import platform |
10 import re | 10 import re |
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
677 'run_nanosleep_test', | 677 'run_nanosleep_test', |
678 'run_prctl_test', | 678 'run_prctl_test', |
679 'run_printf_test', | 679 'run_printf_test', |
680 'run_pwrite_test', | 680 'run_pwrite_test', |
681 'run_sigaction_test', | 681 'run_sigaction_test', |
682 'run_signal_test', | 682 'run_signal_test', |
683 'run_socket_test', | 683 'run_socket_test', |
684 'run_stack_alignment_test', | 684 'run_stack_alignment_test', |
685 'run_syscall_test', | 685 'run_syscall_test', |
686 'run_thread_test', | 686 'run_thread_test', |
687 | |
688 # TODO(uekawa): Enable exception test when implementation is ready. | |
689 # 'run_exception_test', | |
687 ]) | 690 ]) |
688 | 691 |
689 | 692 |
690 # If a test is not in one of these suites, it will probally not be run on a | 693 # If a test is not in one of these suites, it will probally not be run on a |
691 # regular basis. These are the suites that will be run by the try bot or that | 694 # regular basis. These are the suites that will be run by the try bot or that |
692 # a large number of users may run by hand. | 695 # a large number of users may run by hand. |
693 MAJOR_TEST_SUITES = set([ | 696 MAJOR_TEST_SUITES = set([ |
694 'small_tests', | 697 'small_tests', |
695 'medium_tests', | 698 'medium_tests', |
696 'large_tests', | 699 'large_tests', |
(...skipping 2300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2997 | 3000 |
2998 nacl_env.AddMethod(AllowNonStableBitcode) | 3001 nacl_env.AddMethod(AllowNonStableBitcode) |
2999 | 3002 |
3000 | 3003 |
3001 def AllowInlineAssembly(env): | 3004 def AllowInlineAssembly(env): |
3002 """ This modifies the environment to allow inline assembly in | 3005 """ This modifies the environment to allow inline assembly in |
3003 untrusted code. If the environment cannot be modified to allow | 3006 untrusted code. If the environment cannot be modified to allow |
3004 inline assembly, it returns False. Otherwise, on success, it | 3007 inline assembly, it returns False. Otherwise, on success, it |
3005 returns True. | 3008 returns True. |
3006 """ | 3009 """ |
3010 if env.Bit('nonsfi_nacl'): | |
3011 if not AllowNonStableBitcode(env): | |
3012 return False | |
3013 # Specifying the target arch is necessary for using inline | |
3014 # assembly in pNaCl. | |
3015 if env.Bit('target_x86_32'): | |
3016 env.AppendUnique(CCFLAGS=['--target=i686-unknown-nacl', | |
3017 '--pnacl-allow-translate']) | |
3018 elif env.Bit('target_arm'): | |
3019 env.AppendUnique(CCFLAGS=['--target=arm-unknown-nacl', | |
3020 '-mfloat-abi=hard', | |
3021 '--pnacl-allow-translate']) | |
3022 else: | |
3023 return False | |
3024 env.AppendUnique(LINKFLAGS=['--pnacl-disable-abi-check',]) | |
3025 return True; | |
3026 | |
3007 if env.Bit('bitcode'): | 3027 if env.Bit('bitcode'): |
Junichi Uekawa
2014/09/09 12:23:58
I am a little bit confused by how this part is con
| |
3008 # For each architecture, we only attempt to make our inline | 3028 # For each architecture, we only attempt to make our inline |
3009 # assembly code work with one untrusted-code toolchain. For x86, | 3029 # assembly code work with one untrusted-code toolchain. For x86, |
3010 # we target GCC, but not PNaCl/Clang, because the latter's | 3030 # we target GCC, but not PNaCl/Clang, because the latter's |
3011 # assembly support has various quirks that we don't want to have | 3031 # assembly support has various quirks that we don't want to have |
3012 # to debug. For ARM, we target PNaCl/Clang, because that is the | 3032 # to debug. For ARM, we target PNaCl/Clang, because that is the |
3013 # only current ARM toolchain. One day, we will have an ARM GCC | 3033 # only current ARM toolchain. One day, we will have an ARM GCC |
3014 # toolchain, and we will no longer need to use inline assembly | 3034 # toolchain, and we will no longer need to use inline assembly |
3015 # with PNaCl/Clang at all. | 3035 # with PNaCl/Clang at all. |
3016 if not (env.Bit('target_arm') or env.Bit('target_mips32')): | 3036 if not (env.Bit('target_arm') or env.Bit('target_mips32')): |
3017 return False | 3037 return False |
(...skipping 982 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4000 nacl_env.ValidateSdk() | 4020 nacl_env.ValidateSdk() |
4001 | 4021 |
4002 if BROKEN_TEST_COUNT > 0: | 4022 if BROKEN_TEST_COUNT > 0: |
4003 msg = "There are %d broken tests." % BROKEN_TEST_COUNT | 4023 msg = "There are %d broken tests." % BROKEN_TEST_COUNT |
4004 if GetOption('brief_comstr'): | 4024 if GetOption('brief_comstr'): |
4005 msg += " Add --verbose to the command line for more information." | 4025 msg += " Add --verbose to the command line for more information." |
4006 print msg | 4026 print msg |
4007 | 4027 |
4008 # separate warnings from actual build output | 4028 # separate warnings from actual build output |
4009 Banner('B U I L D - O U T P U T:') | 4029 Banner('B U I L D - O U T P U T:') |
OLD | NEW |