OLD | NEW |
1 # -*- python -*- | 1 # -*- python -*- |
2 # Copyright (c) 2013 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2013 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 os | 6 import os |
7 Import('env') | 7 Import('env') |
8 | 8 |
9 sources = ['arch/arm/cpu_arm.c', | 9 sources = ['arch/arm/cpu_arm.c', |
10 'arch/mips/cpu_mips.c'] | 10 'arch/mips/cpu_mips.c'] |
11 | 11 |
12 # TODO(jfb) Temporary hack while the x86 CPU features aren't factored | 12 # TODO(jfb) Temporary hack while the x86 CPU features aren't factored |
13 # out between host and target API functions. The eventual goal is for | 13 # out between host and target API functions. The eventual goal is for |
14 # inline asm to be in host-specific code and only built for that host, | 14 # inline asm to be in host-specific code and only built for that host, |
15 # and generic CPU feature emulation and querying to be built for all | 15 # and generic CPU feature emulation and querying to be built for all |
16 # hosts. ARM and MIPS don't ahve these problems as of today because they | 16 # hosts. ARM and MIPS don't ahve these problems as of today because they |
17 # don't actually query their CPU. | 17 # don't actually query their CPU. |
18 # Do the same in the gyp build. | 18 # Do the same in the gyp build. |
19 if env.Bit('target_x86'): | 19 if env.Bit('build_x86'): |
20 sources += ['arch/x86/cpu_x86.c', | 20 sources += ['arch/x86/cpu_x86.c', |
21 'arch/x86/cpu_xgetbv.S'] | 21 'arch/x86/cpu_xgetbv.S'] |
22 | 22 |
23 env.ComponentLibrary('cpu_features', sources) | 23 env.ComponentLibrary('cpu_features', sources) |
24 | 24 |
25 # TODO(jfb) Also test ARM and MIPS. | 25 # TODO(jfb) Also test ARM and MIPS. |
26 if env.Bit('target_x86'): | 26 if env.Bit('build_x86'): |
27 # Create environment for command-line tools and testing, rather than | 27 # Create environment for command-line tools and testing, rather than |
28 # part of the TCB. Then define compile-time flag that communicates | 28 # part of the TCB. Then define compile-time flag that communicates |
29 # that we are compiling in the test environment (rather than for the TCB). | 29 # that we are compiling in the test environment (rather than for the TCB). |
30 test_env = env.Clone() | 30 test_env = env.Clone() |
31 test_env.Append(CCFLAGS=['-DNACL_TRUSTED_BUT_NOT_TCB']) | 31 test_env.Append(CCFLAGS=['-DNACL_TRUSTED_BUT_NOT_TCB']) |
32 | 32 |
33 cpu_x86_test = test_env.ComponentProgram( | 33 cpu_x86_test = test_env.ComponentProgram( |
34 'cpu_x86_test', | 34 'cpu_x86_test', |
35 ['arch/x86/cpu_x86_test.c'], | 35 ['arch/x86/cpu_x86_test.c'], |
36 EXTRA_LIBS=[ | 36 EXTRA_LIBS=[ |
37 'cpu_features', | 37 'cpu_features', |
38 'platform' | 38 'platform' |
39 ]) | 39 ]) |
40 | 40 |
41 node = test_env.CommandTest( | 41 node = test_env.CommandTest( |
42 'cpu_x86_test.out', | 42 'cpu_x86_test.out', |
43 [cpu_x86_test]) | 43 [cpu_x86_test]) |
44 test_env.AddNodeToTestSuite(node, ['small_tests'], 'run_cpu_x86_test') | 44 test_env.AddNodeToTestSuite(node, ['small_tests'], 'run_cpu_x86_test') |
OLD | NEW |