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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # -*- python -*-
2 # Copyright (c) 2014 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('env')
7
8 if not env.Bit('bitcode'):
9 Return()
10 if env['TOOLCHAIN_FEATURE_VERSION'] < 6:
11 Return()
12 # The x86-64 instruction sequence that PNaCl generates for function calls,
13 # which hides the sandbox base address, isn't compatible with PIC code
14 # generation yet.
15 # TODO(mseaborn): Generate a PIC-friendly instruction sequence for calls.
16 if env.Bit('target_x86_64'):
17 Return()
18 # The sandboxed translator does not support translating PSOs yet.
19 if env.Bit('use_sandboxed_translator'):
20 Return()
21
22
23 def MakeAndTranslatePso(dest, bitcode_file):
24 # Run opt to apply PNaCl ABI simplifications to the IR and to run the
25 # PNaCl ABI checker. We are bypassing pnacl-ld for now because its
26 # invocation of Gold internalizes __pnacl_pso_root, which we want to keep
27 # externally-visible.
28 opt_result = env.Command(
29 dest + '.nonfinal.pso', [bitcode_file],
30 '${PNACLOPT} -pnacl-abi-simplify-preopt -pnacl-abi-simplify-postopt '
31 '-verify-pnaclabi-module -verify-pnaclabi-functions '
32 '-pnaclabi-allow-debug-metadata '
33 '${SOURCES} -o ${TARGET}')
34 # Finalize to strip debugging info and to emit PNaCl bitcode.
35 finalized_result = env.Command(
36 dest + '.final.pso', [opt_result],
37 '${PNACLFINALIZE} ${SOURCES} -o ${TARGET}')
38 # Translate to an ELF loadable object.
39 translated_dso = env.Command(dest + '.so', [finalized_result],
40 '${TRANSLATE} -pso ${SOURCES} -o ${TARGET}')
41 return translated_dso
42
43
44 # TODO(mseaborn): Add an ELF dynamic loader for PNaCl and test that the DSO
45 # we produce is loadable.
46 node = MakeAndTranslatePso('test_pso', [env.ComponentObject('test_pso.c')])
47 env.AddNodeToTestSuite(node, ['small_tests', 'toolchain_tests'],
48 'run_pnacl_dynamic_loading_test')
OLDNEW
« 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