Index: tests/stacked_irt/nacl.scons |
diff --git a/tests/stacked_irt/nacl.scons b/tests/stacked_irt/nacl.scons |
new file mode 100644 |
index 0000000000000000000000000000000000000000..806505a4677ac820ff92018826bd7eb474dcc376 |
--- /dev/null |
+++ b/tests/stacked_irt/nacl.scons |
@@ -0,0 +1,63 @@ |
+# -*- 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('env') |
+ |
+# Stacked IRT test |
+ |
+# This test uses a nexe built by another test. Nexes do not get |
+# staged in pexe mode, so only run this test in nonpexe mode. |
+if env.Bit('pnacl_generate_pexe'): |
+ Return() |
+ |
+irt_env = env.Clone( |
+#irt_env = env['NACL_IRT_ENV'].Clone( |
+ BUILD_TYPE = 'stacked_irt', |
+ BUILD_TYPE_DESCRIPTION = 'Stacked IRT build', |
+ NACL_BUILD_FAMILY = 'UNTRUSTED_IRT', |
+) |
+ |
+irt_env.ClearBits('nacl_glibc') |
+#irt_env.ClearBits('pnacl_shared_newlib') |
+# We build the IRT using the nnacl TC even when the pnacl TC is used otherwise. |
+if irt_env.Bit('target_mips32'): |
+ irt_env.ClearBits('bitcode') |
+irt_env.ClearBits('pnacl_generate_pexe') |
+irt_env.ClearBits('use_sandboxed_translator') |
+irt_env.Tool('naclsdk') |
+# These are unfortunately clobbered by running Tool, which |
+# we needed to do to get the destination directory reset. |
+# We want all the same values from nacl_env. |
+irt_env.Replace(EXTRA_CFLAGS=env['EXTRA_CFLAGS'], |
+ EXTRA_CXXFLAGS=env['EXTRA_CXXFLAGS'], |
+ CCFLAGS=env['CCFLAGS'], |
+ CFLAGS=env['CFLAGS'], |
+ CXXFLAGS=env['CXXFLAGS']) |
+# Make it find the libraries it builds, rather than the SDK ones. |
+irt_env.Replace(LIBPATH='${LIB_DIR}') |
+ |
+# Unlike NaCl IRT, stacked IRT should be position independent |
+irt_env.SetBits('nacl_pic') |
+ |
+stacked_irt_test = env.ComponentProgram( |
+ 'stacked_irt_test', ['irt_hello_world.c', |
+ 'irt_test3.c', |
+ 'irt_test2.c', |
+ 'irt_test1.c', |
+ 'irt_trace.c' |
+ ], |
+ EXTRA_LIBS=['${PTHREAD_LIBS}', |
+ '${NONIRT_LIBS}']) |
+ #EXTRA_LIBS=['irt_support_private']) |
+ |
+# Don't provide IRT, we provide it ourselves via -B. |
+#env.ClearBits('tests_use_irt') |
+ |
+node = env.CommandSelLdrTestNacl( |
+ 'stacked_irt_test.out', |
+ stacked_irt_test, |
+ stdout_golden=env.File('irt_hello_world.stdout')) |
+ |
+env.AddNodeToTestSuite(node, ['small_tests'], 'run_stacked_irt_test') |