OLD | NEW |
(Empty) | |
| 1 # -*- python -*- |
| 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 |
| 4 # found in the LICENSE file. |
| 5 |
| 6 import os |
| 7 Import('env') |
| 8 |
| 9 sources = ['arch/arm/cpu_arm.c', |
| 10 'arch/mips/cpu_mips.c'] |
| 11 |
| 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 |
| 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 |
| 16 # hosts. ARM and MIPS don't ahve these problems as of today because they |
| 17 # don't actually query their CPU. |
| 18 # Do the same in the gyp build. |
| 19 if env.Bit('target_x86'): |
| 20 sources += ['arch/x86/cpu_x86.c', |
| 21 'arch/x86/cpu_xgetbv.S'] |
| 22 |
| 23 env.ComponentLibrary('cpu_features', sources) |
| 24 |
| 25 # TODO(jfb) Also test ARM and MIPS. |
| 26 if env.Bit('target_x86'): |
| 27 # Create environment for command-line tools and testing, rather than |
| 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). |
| 30 test_env = env.Clone() |
| 31 test_env.Append(CCFLAGS=['-DNACL_TRUSTED_BUT_NOT_TCB']) |
| 32 |
| 33 cpu_x86_test = test_env.ComponentProgram( |
| 34 'cpu_x86_test', |
| 35 ['arch/x86/cpu_x86_test.c'], |
| 36 EXTRA_LIBS=[ |
| 37 test_env.NaClTargetArchSuffix('ncval_base'), |
| 38 'cpu_features', |
| 39 'platform' |
| 40 ]) |
| 41 |
| 42 node = test_env.CommandTest( |
| 43 'cpu_x86_test.out', |
| 44 [cpu_x86_test]) |
| 45 test_env.AddNodeToTestSuite(node, ['large_tests'], 'run_cpu_x86_test') |
OLD | NEW |