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 # Use of "-nostdlib" means these tests produce statically-linked | 8 # Use of "-nostdlib" means these tests produce statically-linked |
9 # executables. This does not work with the test runner for | 9 # executables. This does not work with the test runner for |
10 # nacl-glibc, which always runs the executables via ld.so. However, | 10 # nacl-glibc, which always runs the executables via ld.so. However, |
11 # we want to keep building the tests. | 11 # we want to keep building the tests. |
12 # TODO(mseaborn): To fix this, either switch these tests to | 12 # TODO(mseaborn): To fix this, either switch these tests to |
13 # dynamically link against libc, or make use of ld.so optional. | 13 # dynamically link against libc, or make use of ld.so optional. |
14 is_glibc = env.Bit('nacl_glibc') | 14 is_glibc = env.Bit('nacl_glibc') |
15 | 15 |
16 env.Replace(LIBS=[], | 16 env.Replace(LIBS=[], |
17 EXTRA_LIBS=[], | 17 EXTRA_LIBS=[], |
18 LINKFLAGS=['-nostdlib'], | 18 LINKFLAGS=['-nostdlib'], |
19 TRANSLATEFLAGS=['-nostdlib']) | 19 TRANSLATEFLAGS=['-nostdlib']) |
20 | 20 |
21 # This setting will affect the barebones_regs.c test | 21 # This setting will affect the barebones_regs.c test |
22 if env.Bit('build_arm'): | 22 if env.Bit('build_arm'): |
23 env.Append(CPPDEFINES='SMALL_REGS_TEST') | 23 env.Append(CPPDEFINES='SMALL_REGS_TEST') |
24 | 24 |
| 25 # The barebones_reloc test need symbols preserved, since it provides |
| 26 # a stub function for something that normally comes from the system libraries. |
| 27 # TODO(jvoung): That can be fixed by removing -nostdlib from TRANSLATEFLAGS. |
| 28 # Then the translator will get the required functions from system libs. |
| 29 # However, removing -nostdlib from TRANSLATEFLAGS will break due to: |
| 30 # https://code.google.com/p/nativeclient/issues/detail?id=3069 |
| 31 if env.Bit('bitcode'): |
| 32 env.SetBits('nonstable_bitcode') |
| 33 if env.Bit('skip_nonstable_bitcode'): |
| 34 Return() |
25 | 35 |
26 # NOTE: the x86 linker wants _start() to be the very first function | 36 # NOTE: the x86 linker wants _start() to be the very first function |
27 FAKE_STARTUP = env.ComponentObject('fake_startup', 'fake_startup.c') | 37 FAKE_STARTUP = env.ComponentObject('fake_startup', 'fake_startup.c') |
28 | 38 |
29 barebones_tests = ['addr_modes', | 39 barebones_tests = ['addr_modes', |
30 'stack_alignment16', | 40 'stack_alignment16', |
31 'exit', | 41 'exit', |
32 'fib', | 42 'fib', |
33 'hello_world', | 43 'hello_world', |
34 'negindex', | 44 'negindex', |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 if native_env.Bit('bitcode'): | 83 if native_env.Bit('bitcode'): |
74 native_env.AddBiasForPNaCl() | 84 native_env.AddBiasForPNaCl() |
75 native_env.PNaClForceNative() | 85 native_env.PNaClForceNative() |
76 | 86 |
77 nexe = native_env.ComponentProgram('top_of_sandbox', ['top_of_sandbox.c']) | 87 nexe = native_env.ComponentProgram('top_of_sandbox', ['top_of_sandbox.c']) |
78 node = native_env.CommandSelLdrTestNacl('top_of_sandbox.out', nexe) | 88 node = native_env.CommandSelLdrTestNacl('top_of_sandbox.out', nexe) |
79 native_env.AddNodeToTestSuite( | 89 native_env.AddNodeToTestSuite( |
80 node, ['small_tests', 'sel_ldr_tests', 'barebones_tests'], | 90 node, ['small_tests', 'sel_ldr_tests', 'barebones_tests'], |
81 'run_top_of_sandbox_test', | 91 'run_top_of_sandbox_test', |
82 is_broken=is_glibc) | 92 is_broken=is_glibc) |
OLD | NEW |