OLD | NEW |
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}') |
15 # The PNaCl linker (gold) does not implement the "-Ttext-segment" | 16 # The PNaCl linker (gold) does not implement the "-Ttext-segment" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 'irt_manifest.c', | 100 'irt_manifest.c', |
100 ] | 101 ] |
101 | 102 |
102 irt_libs = ['srpc', | 103 irt_libs = ['srpc', |
103 'imc_syscalls', | 104 'imc_syscalls', |
104 'platform', | 105 'platform', |
105 'gio', | 106 'gio', |
106 'm', | 107 'm', |
107 ] | 108 ] |
108 | 109 |
| 110 # We may want to move this into ppruntime in the future to limit |
| 111 # visibility to ppapi/generators |
| 112 def GetPNaClShimSource(env): |
| 113 if not env.Bit('target_x86_64'): |
| 114 return 'shim_dummy.c' |
| 115 |
| 116 # Generate a 'pnacl_shim.c' |
| 117 # API code |
| 118 api_glob = env.Glob('${SOURCE_ROOT}/ppapi/api/*.idl') |
| 119 api_dev_glob = env.Glob('${SOURCE_ROOT}/ppapi/api/dev/*.idl') |
| 120 all_api = [f.abspath for f in api_glob + api_dev_glob] |
| 121 # Python code |
| 122 generators_glob = env.Glob('${SOURCE_ROOT}/ppapi/generators/*.py') |
| 123 return env.Command( |
| 124 'pnacl_irt_shim.c', |
| 125 (api_glob + api_dev_glob + generators_glob), |
| 126 ('${PYTHON} ' + |
| 127 '${SOURCE_ROOT}/ppapi/generators/generator.py ' + |
| 128 '--srcroot=' + os.path.join('${SOURCE_ROOT}', 'ppapi', 'api') + ' ' + |
| 129 '--wnone --pnacl --pnaclshim=${TARGETS} ' + ' '.join(all_api))) |
| 130 |
| 131 irt_shim_obj = blob_env.ComponentObject(GetPNaClShimSource(blob_env)) |
| 132 |
| 133 |
109 def LinkIrt(output, files, libs): | 134 def LinkIrt(output, files, libs): |
110 return blob_env.ComponentProgram(output, | 135 return blob_env.ComponentProgram(output, |
111 [irt_entry_obj] + irt_support_objs + files, | 136 [irt_entry_obj, irt_shim_obj] + |
| 137 irt_support_objs + files, |
112 EXTRA_LIBS=libs + irt_libs) | 138 EXTRA_LIBS=libs + irt_libs) |
113 | 139 |
114 irt_core_library = LinkIrt('irt_core', irt_nonbrowser, []) | 140 irt_core_library = LinkIrt('irt_core', irt_nonbrowser, []) |
115 irt_library = LinkIrt('irt', irt_browser, ['ppruntime']) | 141 irt_library = LinkIrt('irt', irt_browser, ['ppruntime']) |
116 | 142 |
117 env.SDKInstallBin('irt_core.nexe', irt_core_library) | 143 env.SDKInstallBin('irt_core.nexe', irt_core_library) |
118 env.SDKInstallBin('irt.nexe', irt_library) | 144 env.SDKInstallBin('irt.nexe', irt_library) |
119 | 145 |
120 # TODO(mcgrathr): these should be installed, but scons is a mystery | 146 # TODO(mcgrathr): these should be installed, but scons is a mystery |
121 #env.AddHeaderToSdk(['irt.h']) | 147 #env.AddHeaderToSdk(['irt.h']) |
(...skipping 24 matching lines...) Expand all Loading... |
146 # Holy cow it takes over 30 seconds to disassemble | 172 # Holy cow it takes over 30 seconds to disassemble |
147 # the ARM irt.nexe. Set test size to 'large'. | 173 # the ARM irt.nexe. Set test size to 'large'. |
148 size='large') | 174 size='large') |
149 env.AddNodeToTestSuite(node, ['small_tests'], 'run_irt_tls_test') | 175 env.AddNodeToTestSuite(node, ['small_tests'], 'run_irt_tls_test') |
150 node = env.CommandTest('irt_core_tls_test.out', | 176 node = env.CommandTest('irt_core_tls_test.out', |
151 ['${PYTHON}', env.File('check_tls.py'), | 177 ['${PYTHON}', env.File('check_tls.py'), |
152 check_tls_arch, '${OBJDUMP}', irt_core_library], | 178 check_tls_arch, '${OBJDUMP}', irt_core_library], |
153 # don't run ${PYTHON} under the emulator. | 179 # don't run ${PYTHON} under the emulator. |
154 direct_emulation=False) | 180 direct_emulation=False) |
155 env.AddNodeToTestSuite(node, ['small_tests'], 'run_irt_core_tls_test') | 181 env.AddNodeToTestSuite(node, ['small_tests'], 'run_irt_core_tls_test') |
OLD | NEW |