Chromium Code Reviews| 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('env') | 6 Import('env') |
| 7 | 7 |
| 8 # All tests below involve native assembler | 8 # All tests below involve native assembler |
| 9 | 9 |
| 10 HALT_SLED_SIZE=32 | 10 HALT_SLED_SIZE=32 |
| 11 | 11 |
| 12 # Valgrind gets confused by these tests | 12 # Valgrind gets confused by these tests |
| 13 | 13 |
| 14 if env.IsRunningUnderValgrind(): | 14 if env.IsRunningUnderValgrind(): |
| 15 Return() | 15 Return() |
| 16 | 16 |
| 17 # glibc linker script enforces gap; test needs to be updated to use | 17 # glibc linker script enforces gap; test needs to be updated to use |
| 18 # custom linker script in this case. | 18 # custom linker script in this case. |
| 19 if env.Bit('nacl_glibc'): | 19 if env.Bit('nacl_glibc'): |
| 20 Return() | 20 Return() |
| 21 | 21 |
| 22 # TODO(dschuff): either re-enable this test after we have fully transitioned | 22 # TODO(dschuff): either re-enable this test after we have fully transitioned |
|
jvoung (off chromium)
2014/06/12 22:45:58
Should this not be a TODO() then?
Mark Seaborn
2014/06/13 00:06:44
I left it as a TODO because one of the options was
jvoung (off chromium)
2014/06/13 01:01:51
Okay I see -- this is fine.
Usually, the linker w
| |
| 23 # to new-style layout and ironed out any potential gold issues, or remove | 23 # to new-style layout and ironed out any potential gold issues, or remove |
| 24 # all pnacl-specific stuff below and in the asm files. | 24 # all pnacl-specific stuff below and in the asm files. |
| 25 # | |
| 26 # It is unlikely that we will re-enable these tests under the PNaCl | |
| 27 # toolchain, because they depend on invoking "ld" directly, which is not | |
| 28 # really a supported use of the PNaCl toolchain. These tests are too | |
| 29 # dependent on the layout that the linker happens to produce, so the tests | |
| 30 # are likely to break or become ineffective if the linker is changed. | |
| 25 if env.Bit('bitcode'): | 31 if env.Bit('bitcode'): |
| 26 Return() | 32 Return() |
| 27 | 33 |
| 28 # ---------------------------------------------------------- | 34 # ---------------------------------------------------------- |
| 29 # Tests that require a NaCl module | 35 # Tests that require a NaCl module |
| 30 # ---------------------------------------------------------- | 36 # ---------------------------------------------------------- |
| 31 | 37 |
| 32 if env.Bit('target_x86_32'): | 38 if env.Bit('target_x86_32'): |
| 33 nacl_text_pad_asm = 'arch/x86_32/nacl_text_pad_test.S' | 39 nacl_text_pad_asm = 'arch/x86_32/nacl_text_pad_test.S' |
| 34 elif env.Bit('target_x86_64'): | 40 elif env.Bit('target_x86_64'): |
| 35 nacl_text_pad_asm = 'arch/x86_64/nacl_text_pad_test.S' | 41 nacl_text_pad_asm = 'arch/x86_64/nacl_text_pad_test.S' |
| 36 elif env.Bit('target_arm'): | 42 elif env.Bit('target_arm'): |
| 37 nacl_text_pad_asm = 'arch/arm/nacl_text_pad_test.S' | 43 nacl_text_pad_asm = 'arch/arm/nacl_text_pad_test.S' |
| 38 elif env.Bit('target_mips32'): | 44 elif env.Bit('target_mips32'): |
| 39 nacl_text_pad_asm = 'arch/mips/nacl_text_pad_test.S' | 45 nacl_text_pad_asm = 'arch/mips/nacl_text_pad_test.S' |
|
jvoung (off chromium)
2014/06/12 22:45:58
mips might end up being untested then (if the only
Mark Seaborn
2014/06/13 00:06:44
Yes, arch/mips/nacl_text_pad_test.S is definitely
jvoung (off chromium)
2014/06/13 01:01:51
Okay, I guess there is already the early Return()
| |
| 40 else: | 46 else: |
| 41 raise Exception('unknown architecture') | 47 raise Exception('unknown architecture') |
| 42 | 48 |
| 43 def NewAsmEnv(env, defines, rodata_address, rwdata_address): | 49 def NewAsmEnv(env, defines, rodata_address, rwdata_address): |
| 44 | |
| 45 asm_env = env.Clone() | 50 asm_env = env.Clone() |
| 46 # NOTE(robertm): convert this to pure C code so that most of this | 51 # NOTE(robertm): convert this to pure C code so that most of this |
| 47 # special handling can be eliminated | 52 # special handling can be eliminated |
| 48 if asm_env.Bit('bitcode'): | |
| 49 asm_env.PNaClForceNative() | |
| 50 asm_env.Append(ASPPFLAGS=['-DPNACL_AS=1']) | |
| 51 # On Windows, assembly pre-preprocessing uses $CCCOM instead of $ASPPCOM, | |
| 52 # so we need to set PNACL_AS=1 in CCFLAGS as well. | |
| 53 asm_env.Append(CCFLAGS=['-DPNACL_AS=1']) | |
| 54 | |
| 55 link_cmd = ('${LD} -static -e _start ${TEXT_START} ${RO_START} ${RW_START}' + | 53 link_cmd = ('${LD} -static -e _start ${TEXT_START} ${RO_START} ${RW_START}' + |
| 56 ' -o ${TARGET} ${SOURCES}') | 54 ' -o ${TARGET} ${SOURCES}') |
| 57 | 55 |
| 58 if env.Bit('target_x86_32'): | 56 if env.Bit('target_x86_32'): |
| 59 link_cmd += ' -melf_i386_nacl' | 57 link_cmd += ' -melf_i386_nacl' |
| 60 elif env.Bit('target_x86_64'): | 58 elif env.Bit('target_x86_64'): |
| 61 link_cmd += ' -melf_x86_64_nacl' | 59 link_cmd += ' -melf_x86_64_nacl' |
| 62 elif env.Bit('target_arm'): | 60 elif env.Bit('target_arm'): |
| 63 link_cmd += ' -marmelf_nacl' | 61 link_cmd += ' -marmelf_nacl' |
| 64 elif env.Bit('target_mips32'): | 62 elif env.Bit('target_mips32'): |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 184 expected_exit_status = 'naclabort_coverage' | 182 expected_exit_status = 'naclabort_coverage' |
| 185 else: | 183 else: |
| 186 expected_exit_status = 'trusted_sigabrt' | 184 expected_exit_status = 'trusted_sigabrt' |
| 187 else: | 185 else: |
| 188 expected_exit_status = 0 | 186 expected_exit_status = 0 |
| 189 | 187 |
| 190 node = env.CommandSelLdrTestNacl(base_name + '.out', nexe, | 188 node = env.CommandSelLdrTestNacl(base_name + '.out', nexe, |
| 191 exit_status=expected_exit_status) | 189 exit_status=expected_exit_status) |
| 192 | 190 |
| 193 env.AddNodeToTestSuite(node, | 191 env.AddNodeToTestSuite(node, |
| 194 ['small_tests', 'sel_ldr_sled_tests', | 192 ['small_tests', 'sel_ldr_sled_tests'], |
| 195 'nonpexe_tests'], | |
| 196 'run_' + base_name) | 193 'run_' + base_name) |
| OLD | NEW |