OLD | NEW |
1 # Copyright (c) 2012 The Native Client Authors. All rights reserved. | 1 # Copyright (c) 2012 The Native Client Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """Harness for defining library dependencies for scons files.""" | 5 """Harness for defining library dependencies for scons files.""" |
6 | 6 |
7 | 7 |
8 # The following is a map from a library, to the corresponding | 8 # The following is a map from a library, to the corresponding |
9 # list of dependent libraries that must be included after that library, in | 9 # list of dependent libraries that must be included after that library, in |
10 # the list of libraries. | 10 # the list of libraries. |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 'ppapi', | 98 'ppapi', |
99 ], | 99 ], |
100 } | 100 } |
101 | 101 |
102 # Platform specific library dependencies. Mapping from a platform, | 102 # Platform specific library dependencies. Mapping from a platform, |
103 # to a map from a library, to the corresponding list of dependendent | 103 # to a map from a library, to the corresponding list of dependendent |
104 # libraries that must be included after that library, in the list | 104 # libraries that must be included after that library, in the list |
105 # of libraries. | 105 # of libraries. |
106 PLATFORM_LIBRARY_DEPENDENCIES = { | 106 PLATFORM_LIBRARY_DEPENDENCIES = { |
107 'x86-32': { | 107 'x86-32': { |
108 'nc_decoder_x86_32': [ | |
109 'ncval_base_x86_32', | |
110 'nc_opcode_modeling_x86_32', | |
111 ], | |
112 'ncdis_util_x86_32': [ | |
113 'ncval_reg_sfi_verbose_x86_32', | |
114 'ncdis_seg_sfi_verbose_x86_32', | |
115 ], | |
116 'ncdis_seg_sfi_verbose_x86_32': [ | |
117 'ncdis_seg_sfi_x86_32', | |
118 'ncval_base_verbose_x86_32', | |
119 ], | |
120 'ncvalidate_verbose_x86_32': [ | |
121 'ncvalidate_x86_32', | |
122 'ncdis_seg_sfi_verbose_x86_32', | |
123 ], | |
124 'ncvalidate_x86_32': [ | |
125 'ncval_seg_sfi_x86_32', | |
126 'cpu_features', | |
127 ], | |
128 'ncval_base_verbose_x86_32': [ | |
129 'ncval_base_x86_32', | |
130 ], | |
131 'ncval_base_x86_32': [ | |
132 'platform', | |
133 'cpu_features', | |
134 'validation_cache', | |
135 ], | |
136 'nc_opcode_modeling_verbose_x86_32': [ | |
137 'nc_opcode_modeling_x86_32', | |
138 'ncval_base_verbose_x86_32', | |
139 ], | |
140 'nc_opcode_modeling_x86_32': [ | |
141 'ncval_base_x86_32', | |
142 ], | |
143 'ncval_reg_sfi_verbose_x86_32': [ | |
144 'ncval_reg_sfi_x86_32', | |
145 'nc_opcode_modeling_verbose_x86_32', | |
146 ], | |
147 'ncval_reg_sfi_x86_32': [ | |
148 'nccopy_x86_32', | |
149 'ncval_base_x86_32', | |
150 'nc_decoder_x86_32', | |
151 ], | |
152 'ncval_seg_sfi_x86_32': [ | |
153 'nccopy_x86_32', | |
154 'ncdis_seg_sfi_x86_32', | |
155 'ncval_base_x86_32', | |
156 # When turning on the DEBUGGING flag in the x86-32 validator | |
157 # or decoder, add the following: | |
158 #'nc_opcode_modeling_verbose_x86_32', | |
159 ], | |
160 'dfa_validate_caller_x86_32': [ | 108 'dfa_validate_caller_x86_32': [ |
161 'cpu_features', | 109 'cpu_features', |
162 'validation_cache', | 110 'validation_cache', |
163 'nccopy_x86_32', | 111 'nccopy_x86_32', |
164 ], | 112 ], |
165 }, | 113 }, |
166 'x86-64': { | 114 'x86-64': { |
167 'nc_decoder_x86_64': [ | |
168 'ncval_base_x86_64', | |
169 'nc_opcode_modeling_x86_64', | |
170 # When turning on the DEBUGGING flag in the x86-64 validator | |
171 # or decoder, add the following: | |
172 #'nc_opcode_modeling_verbose_x86_64', | |
173 ], | |
174 'ncdis_util_x86_64': [ | |
175 'ncval_reg_sfi_verbose_x86_64', | |
176 'ncdis_seg_sfi_verbose_x86_64', | |
177 ], | |
178 'ncdis_seg_sfi_verbose_x86_64': [ | |
179 'ncdis_seg_sfi_x86_64', | |
180 'ncval_base_verbose_x86_64', | |
181 ], | |
182 'ncvalidate_verbose_x86_64': [ | |
183 'ncvalidate_x86_64', | |
184 'ncval_reg_sfi_verbose_x86_64', | |
185 ], | |
186 'ncvalidate_x86_64': [ | |
187 'ncval_reg_sfi_x86_64', | |
188 'cpu_features', | |
189 ], | |
190 'ncval_base_verbose_x86_64': [ | |
191 'ncval_base_x86_64', | |
192 ], | |
193 'ncval_base_x86_64': [ | |
194 'platform', | |
195 'cpu_features', | |
196 'validation_cache', | |
197 ], | |
198 'nc_opcode_modeling_verbose_x86_64': [ | |
199 'nc_opcode_modeling_x86_64', | |
200 'ncval_base_verbose_x86_64', | |
201 ], | |
202 'nc_opcode_modeling_x86_64': [ | |
203 'ncval_base_x86_64', | |
204 ], | |
205 'ncval_reg_sfi_verbose_x86_64': [ | |
206 'ncval_reg_sfi_x86_64', | |
207 'nc_opcode_modeling_verbose_x86_64', | |
208 ], | |
209 'ncval_reg_sfi_x86_64': [ | |
210 'nccopy_x86_64', | |
211 'ncval_base_x86_64', | |
212 'nc_decoder_x86_64', | |
213 'cpu_features', | |
214 ], | |
215 'ncval_seg_sfi_x86_64': [ | |
216 'nccopy_x86_64', | |
217 'ncdis_seg_sfi_x86_64', | |
218 'ncval_base_x86_64', | |
219 ], | |
220 'dfa_validate_caller_x86_64': [ | 115 'dfa_validate_caller_x86_64': [ |
221 'cpu_features', | 116 'cpu_features', |
222 'validation_cache', | 117 'validation_cache', |
223 'nccopy_x86_64', | 118 'nccopy_x86_64', |
224 ], | 119 ], |
225 }, | 120 }, |
226 'arm': { | 121 'arm': { |
227 'ncvalidate_arm_v2': [ | 122 'ncvalidate_arm_v2': [ |
228 'arm_validator_core', | 123 'arm_validator_core', |
229 'validation_cache', | 124 'validation_cache', |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 for library in reversed(libraries): | 161 for library in reversed(libraries): |
267 if library not in visited: | 162 if library not in visited: |
268 VisitLibrary(library) | 163 VisitLibrary(library) |
269 | 164 |
270 def GetLibraryDeps(library): | 165 def GetLibraryDeps(library): |
271 ret = (LIBRARY_DEPENDENCIES_DEFAULT.get(library, []) + | 166 ret = (LIBRARY_DEPENDENCIES_DEFAULT.get(library, []) + |
272 PLATFORM_LIBRARY_DEPENDENCIES.get(platform, {}).get(library, [])) | 167 PLATFORM_LIBRARY_DEPENDENCIES.get(platform, {}).get(library, [])) |
273 if env['NACL_BUILD_FAMILY'] != 'TRUSTED': | 168 if env['NACL_BUILD_FAMILY'] != 'TRUSTED': |
274 ret.extend(UNTRUSTED_LIBRARY_DEPENDENCIES.get(library, [])) | 169 ret.extend(UNTRUSTED_LIBRARY_DEPENDENCIES.get(library, [])) |
275 if library == 'validators' and env.Bit('target_x86'): | 170 if library == 'validators' and env.Bit('target_x86'): |
276 if env.Bit('validator_ragel'): | 171 ret.append(env.NaClTargetArchSuffix('dfa_validate_caller')) |
277 ret.append(env.NaClTargetArchSuffix('dfa_validate_caller')) | |
278 else: | |
279 ret.append(env.NaClTargetArchSuffix('ncvalidate')) | |
280 return ret | 172 return ret |
281 | 173 |
282 def VisitLibrary(library): | 174 def VisitLibrary(library): |
283 visited.add(library) | 175 visited.add(library) |
284 VisitList(GetLibraryDeps(library)) | 176 VisitList(GetLibraryDeps(library)) |
285 closure.append(library) | 177 closure.append(library) |
286 | 178 |
287 # Ideally we would just do "VisitList(libraries)" here, but some | 179 # Ideally we would just do "VisitList(libraries)" here, but some |
288 # PPAPI tests (specifically, tests/ppapi_gles_book) list "ppapi_cpp" | 180 # PPAPI tests (specifically, tests/ppapi_gles_book) list "ppapi_cpp" |
289 # twice in the link line, and we need to maintain these duplicates. | 181 # twice in the link line, and we need to maintain these duplicates. |
290 for library in reversed(libraries): | 182 for library in reversed(libraries): |
291 VisitLibrary(library) | 183 VisitLibrary(library) |
292 | 184 |
293 closure.reverse() | 185 closure.reverse() |
294 return closure | 186 return closure |
OLD | NEW |