Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1166)

Unified Diff: src/trusted/cpu_features/build.scons

Issue 11864002: Move CPU features into its own static library. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Address bsy's comments by not building x86 target when host isn't x86. This is how things are curre… Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/trusted/cpu_features/arch/x86/cpu_xgetbv.S ('k') | src/trusted/cpu_features/cpu_features.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/trusted/cpu_features/build.scons
diff --git a/src/trusted/cpu_features/build.scons b/src/trusted/cpu_features/build.scons
new file mode 100644
index 0000000000000000000000000000000000000000..c806a7e4287f238727548571349f6d98cc06f436
--- /dev/null
+++ b/src/trusted/cpu_features/build.scons
@@ -0,0 +1,45 @@
+# -*- python -*-
+# Copyright (c) 2013 The Native Client Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import os
+Import('env')
+
+sources = ['arch/arm/cpu_arm.c',
+ 'arch/mips/cpu_mips.c']
+
+# TODO(jfb) Temporary hack while the x86 CPU features aren't factored
+# out between host and target API functions. The eventual goal is for
+# inline asm to be in host-specific code and only built for that host,
+# and generic CPU feature emulation and querying to be built for all
+# hosts. ARM and MIPS don't ahve these problems as of today because they
+# don't actually query their CPU.
+# Do the same in the gyp build.
+if env.Bit('target_x86'):
+ sources += ['arch/x86/cpu_x86.c',
+ 'arch/x86/cpu_xgetbv.S']
+
+env.ComponentLibrary('cpu_features', sources)
+
+# TODO(jfb) Also test ARM and MIPS.
+if env.Bit('target_x86'):
+ # Create environment for command-line tools and testing, rather than
+ # part of the TCB. Then define compile-time flag that communicates
+ # that we are compiling in the test environment (rather than for the TCB).
+ test_env = env.Clone()
+ test_env.Append(CCFLAGS=['-DNACL_TRUSTED_BUT_NOT_TCB'])
+
+ cpu_x86_test = test_env.ComponentProgram(
+ 'cpu_x86_test',
+ ['arch/x86/cpu_x86_test.c'],
+ EXTRA_LIBS=[
+ test_env.NaClTargetArchSuffix('ncval_base'),
+ 'cpu_features',
+ 'platform'
+ ])
+
+ node = test_env.CommandTest(
+ 'cpu_x86_test.out',
+ [cpu_x86_test])
+ test_env.AddNodeToTestSuite(node, ['large_tests'], 'run_cpu_x86_test')
« no previous file with comments | « src/trusted/cpu_features/arch/x86/cpu_xgetbv.S ('k') | src/trusted/cpu_features/cpu_features.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698