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

Unified Diff: tests/pnacl_dynamic_loading/nacl.scons

Issue 352213002: PNaCl dynamic loading: Extend pnacl-translate to be able to translate PSOs (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Cleanup Created 6 years, 6 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 | « site_scons/site_tools/naclsdk.py ('k') | tests/pnacl_dynamic_loading/test_pso.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/pnacl_dynamic_loading/nacl.scons
diff --git a/tests/pnacl_dynamic_loading/nacl.scons b/tests/pnacl_dynamic_loading/nacl.scons
new file mode 100644
index 0000000000000000000000000000000000000000..ab014518a60176809b4ba2351bfa949eea1d6ac9
--- /dev/null
+++ b/tests/pnacl_dynamic_loading/nacl.scons
@@ -0,0 +1,48 @@
+# -*- python -*-
+# Copyright (c) 2014 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')
+
+if not env.Bit('bitcode'):
+ Return()
+if env['TOOLCHAIN_FEATURE_VERSION'] < 6:
+ Return()
+# The x86-64 instruction sequence that PNaCl generates for function calls,
+# which hides the sandbox base address, isn't compatible with PIC code
+# generation yet.
+# TODO(mseaborn): Generate a PIC-friendly instruction sequence for calls.
+if env.Bit('target_x86_64'):
+ Return()
+# The sandboxed translator does not support translating PSOs yet.
+if env.Bit('use_sandboxed_translator'):
+ Return()
+
+
+def MakeAndTranslatePso(dest, bitcode_file):
+ # Run opt to apply PNaCl ABI simplifications to the IR and to run the
+ # PNaCl ABI checker. We are bypassing pnacl-ld for now because its
+ # invocation of Gold internalizes __pnacl_pso_root, which we want to keep
+ # externally-visible.
+ opt_result = env.Command(
+ dest + '.nonfinal.pso', [bitcode_file],
+ '${PNACLOPT} -pnacl-abi-simplify-preopt -pnacl-abi-simplify-postopt '
+ '-verify-pnaclabi-module -verify-pnaclabi-functions '
+ '-pnaclabi-allow-debug-metadata '
+ '${SOURCES} -o ${TARGET}')
+ # Finalize to strip debugging info and to emit PNaCl bitcode.
+ finalized_result = env.Command(
+ dest + '.final.pso', [opt_result],
+ '${PNACLFINALIZE} ${SOURCES} -o ${TARGET}')
+ # Translate to an ELF loadable object.
+ translated_dso = env.Command(dest + '.so', [finalized_result],
+ '${TRANSLATE} -pso ${SOURCES} -o ${TARGET}')
+ return translated_dso
+
+
+# TODO(mseaborn): Add an ELF dynamic loader for PNaCl and test that the DSO
+# we produce is loadable.
+node = MakeAndTranslatePso('test_pso', [env.ComponentObject('test_pso.c')])
+env.AddNodeToTestSuite(node, ['small_tests', 'toolchain_tests'],
+ 'run_pnacl_dynamic_loading_test')
« no previous file with comments | « site_scons/site_tools/naclsdk.py ('k') | tests/pnacl_dynamic_loading/test_pso.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698