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

Side by Side Diff: src/untrusted/irt/nacl.scons

Issue 10826171: Incorporate shimming into the irt (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: Created 8 years, 3 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
OLDNEW
1 # -*- python -*- 1 # -*- python -*-
2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. 2 # Copyright (c) 2012 The Native Client Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import os
6 7
7 Import('env') 8 Import('env')
8 9
9 # This module shouldn't be built in an environment that uses glibc. 10 # This module shouldn't be built in an environment that uses glibc.
10 if env.Bit('nacl_glibc'): 11 if env.Bit('nacl_glibc'):
11 raise UserError('src/untrusted/irt/nacl.scons in the wrong environment?') 12 raise UserError('src/untrusted/irt/nacl.scons in the wrong environment?')
12 13
13 blob_env = env.Clone() 14 blob_env = env.Clone()
14 blob_env.Append(LINKFLAGS='-Wl,--section-start,.rodata=${IRT_BLOB_DATA_START}') 15 blob_env.Append(LINKFLAGS='-Wl,--section-start,.rodata=${IRT_BLOB_DATA_START}',
16 # This ifdef should be removed once
Mark Seaborn 2012/08/28 20:41:00 Please add a TODO(robertm) in this comment. Also,
17 # the IRT build has migrated to the Chrome tree.
18 CPPDEFINES = ['ENABLE_NACL_IRT_PPAPIHOOK_SHIMMED']
Mark Seaborn 2012/08/28 20:41:00 Nit: Python style is no spaces around '=' for keyw
19 )
Mark Seaborn 2012/08/28 20:41:00 Normal Python style is that the closing bracket ca
15 # The PNaCl linker (gold) does not implement the "-Ttext-segment" 20 # The PNaCl linker (gold) does not implement the "-Ttext-segment"
16 # option. However, with the linker for x86, the "-Ttext" option does 21 # option. However, with the linker for x86, the "-Ttext" option does
17 # not affect the executable's base address. 22 # not affect the executable's base address.
18 if blob_env.Bit('bitcode'): 23 if blob_env.Bit('bitcode'):
19 blob_env.Append(LINKFLAGS='-Wl,-Ttext=${IRT_BLOB_CODE_START}') 24 blob_env.Append(LINKFLAGS='-Wl,-Ttext=${IRT_BLOB_CODE_START}')
20 else: 25 else:
21 blob_env.Append(LINKFLAGS='-Wl,-Ttext-segment=${IRT_BLOB_CODE_START}') 26 blob_env.Append(LINKFLAGS='-Wl,-Ttext-segment=${IRT_BLOB_CODE_START}')
22 27
23 irt_support_sources = [ 28 irt_support_sources = [
24 'irt_malloc.c', 29 'irt_malloc.c',
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 'irt_manifest.c', 104 'irt_manifest.c',
100 ] 105 ]
101 106
102 irt_libs = ['srpc', 107 irt_libs = ['srpc',
103 'imc_syscalls', 108 'imc_syscalls',
104 'platform', 109 'platform',
105 'gio', 110 'gio',
106 'm', 111 'm',
107 ] 112 ]
108 113
114 # We may want to move this into ppruntime in the future to limit
115 # visibility to ppapi/generators
116 def GetPNaClShimSource(env):
117 if not env.Bit('target_x86_64'):
118 return 'shim_dummy.c'
119
120 # Generate a 'pnacl_shim.c'
121 # API code
122 api_glob = env.Glob('${SOURCE_ROOT}/ppapi/api/*.idl')
123 api_dev_glob = env.Glob('${SOURCE_ROOT}/ppapi/api/dev/*.idl')
124 all_api = [f.abspath for f in api_glob + api_dev_glob]
125 # Python code
126 generators_glob = env.Glob('${SOURCE_ROOT}/ppapi/generators/*.py')
127 return env.Command(
128 'pnacl_irt_shim.c',
129 (api_glob + api_dev_glob + generators_glob),
130 ('${PYTHON} ' +
131 '${SOURCE_ROOT}/ppapi/generators/generator.py ' +
132 '--srcroot=' + os.path.join('${SOURCE_ROOT}', 'ppapi', 'api') + ' ' +
133 '--wnone --pnacl --pnaclshim=${TARGETS} ' + ' '.join(all_api)))
134
135 irt_shim_obj = blob_env.ComponentObject(GetPNaClShimSource(blob_env))
136
137
109 def LinkIrt(output, files, libs): 138 def LinkIrt(output, files, libs):
110 return blob_env.ComponentProgram(output, 139 return blob_env.ComponentProgram(output,
111 [irt_entry_obj] + irt_support_objs + files, 140 [irt_entry_obj, irt_shim_obj] +
141 irt_support_objs + files,
112 EXTRA_LIBS=libs + irt_libs) 142 EXTRA_LIBS=libs + irt_libs)
113 143
114 irt_core_library = LinkIrt('irt_core', irt_nonbrowser, []) 144 irt_core_library = LinkIrt('irt_core', irt_nonbrowser, [])
115 irt_library = LinkIrt('irt', irt_browser, ['ppruntime']) 145 irt_library = LinkIrt('irt', irt_browser, ['ppruntime'])
116 146
117 env.SDKInstallBin('irt_core.nexe', irt_core_library) 147 env.SDKInstallBin('irt_core.nexe', irt_core_library)
118 env.SDKInstallBin('irt.nexe', irt_library) 148 env.SDKInstallBin('irt.nexe', irt_library)
119 149
120 # TODO(mcgrathr): these should be installed, but scons is a mystery 150 # TODO(mcgrathr): these should be installed, but scons is a mystery
121 #env.AddHeaderToSdk(['irt.h']) 151 #env.AddHeaderToSdk(['irt.h'])
(...skipping 24 matching lines...) Expand all
146 # Holy cow it takes over 30 seconds to disassemble 176 # Holy cow it takes over 30 seconds to disassemble
147 # the ARM irt.nexe. Set test size to 'large'. 177 # the ARM irt.nexe. Set test size to 'large'.
148 size='large') 178 size='large')
149 env.AddNodeToTestSuite(node, ['small_tests'], 'run_irt_tls_test') 179 env.AddNodeToTestSuite(node, ['small_tests'], 'run_irt_tls_test')
150 node = env.CommandTest('irt_core_tls_test.out', 180 node = env.CommandTest('irt_core_tls_test.out',
151 ['${PYTHON}', env.File('check_tls.py'), 181 ['${PYTHON}', env.File('check_tls.py'),
152 check_tls_arch, '${OBJDUMP}', irt_core_library], 182 check_tls_arch, '${OBJDUMP}', irt_core_library],
153 # don't run ${PYTHON} under the emulator. 183 # don't run ${PYTHON} under the emulator.
154 direct_emulation=False) 184 direct_emulation=False)
155 env.AddNodeToTestSuite(node, ['small_tests'], 'run_irt_core_tls_test') 185 env.AddNodeToTestSuite(node, ['small_tests'], 'run_irt_core_tls_test')
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698