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

Side by Side Diff: native_client_sdk/src/tools/lib/get_shared_deps.py

Issue 1493443002: Revert of [NaCl SDK] Remove support for bionic toolchain (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
« no previous file with comments | « native_client_sdk/src/tools/create_nmf.py ('k') | native_client_sdk/src/tools/nacl_gcc.mk » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium 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 """Helper script to close over all transitive dependencies of a given .nexe 5 """Helper script to close over all transitive dependencies of a given .nexe
6 executable. 6 executable.
7 7
8 e.g. Given 8 e.g. Given
9 A -> B 9 A -> B
10 B -> C 10 B -> C
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 203
204 Args: 204 Args:
205 name: name of library to find 205 name: name of library to find
206 lib_path: A list of paths to search for shared libraries. 206 lib_path: A list of paths to search for shared libraries.
207 207
208 Returns: 208 Returns:
209 A list of system paths that match the given name within the lib_path''' 209 A list of system paths that match the given name within the lib_path'''
210 files = [] 210 files = []
211 for dirname in lib_path: 211 for dirname in lib_path:
212 # The libc.so files in the the glibc toolchain is actually a linker 212 # The libc.so files in the the glibc toolchain is actually a linker
213 # script which references libc.so.<SHA1>. This means the libc.so itself 213 # script which references libc.so.<SHA1>. This means the lib.so itself
214 # does not end up in the NEEDED section for glibc. 214 # does not end up in the NEEDED section for glibc. However with bionic
215 if name == 'libc.so': 215 # the SONAME is actually libc.so. If we pass glibc's libc.so to objdump
216 # if fails to parse it, os this filters out libc.so expept for within
217 # the bionic toolchain.
218 # TODO(bradnelson): Remove this once the SONAME in bionic is made to be
219 # unique in the same it is under glibc:
220 # https://code.google.com/p/nativeclient/issues/detail?id=3833
221 rel_dirname = os.path.relpath(dirname, SDK_DIR)
222 if name == 'libc.so' and 'bionic' not in rel_dirname:
216 continue 223 continue
217 filename = os.path.join(dirname, name) 224 filename = os.path.join(dirname, name)
218 if os.path.exists(filename): 225 if os.path.exists(filename):
219 files.append(filename) 226 files.append(filename)
220 if not files: 227 if not files:
221 raise Error('cannot find library %s' % name) 228 raise Error('cannot find library %s' % name)
222 return files 229 return files
223 230
224 231
225 def _GetNeededStatic(main_files): 232 def _GetNeededStatic(main_files):
226 needed = {} 233 needed = {}
227 for filename in main_files: 234 for filename in main_files:
228 arch = elf.ParseElfHeader(filename)[0] 235 arch = elf.ParseElfHeader(filename)[0]
229 needed[filename] = arch 236 needed[filename] = arch
230 return needed 237 return needed
OLDNEW
« no previous file with comments | « native_client_sdk/src/tools/create_nmf.py ('k') | native_client_sdk/src/tools/nacl_gcc.mk » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698