[NaCl SDK] Teach create_nmf about ARM shared libraries.
This change is needed to support he bionic toolchain which can produce shared libraries for ARM. Review URL: https://codereview.chromium.org/227813003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@262300 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
native_client_sdk/src/tools
@@ -528,6 +528,14 @@ def GetDefaultLibPath(config):
|
||||
'ports/lib/glibc_x86_32/%s' % config,
|
||||
'ports/lib/glibc_x86_64/%s' % config,
|
||||
]
|
||||
|
||||
bionic_dir = 'toolchain/%s_arm_bionic' % osname
|
||||
if os.path.isdir(os.path.join(sdk_root, bionic_dir)):
|
||||
libpath += [
|
||||
'%s/arm-nacl/lib' % bionic_dir,
|
||||
'%s/arm-nacl/usr/lib' % bionic_dir,
|
||||
'lib/bionic_arm/%s' % config,
|
||||
]
|
||||
libpath = [os.path.normpath(p) for p in libpath]
|
||||
libpath = [os.path.join(sdk_root, p) for p in libpath]
|
||||
return libpath
|
||||
@@ -633,6 +641,8 @@ def main(argv):
|
||||
# Add default libraries paths to the end of the search path.
|
||||
config = options.debug_libs and 'Debug' or 'Release'
|
||||
options.lib_path += GetDefaultLibPath(config)
|
||||
for path in options.lib_path:
|
||||
Trace('libpath: %s' % path)
|
||||
|
||||
pnacl_optlevel = None
|
||||
if options.pnacl_optlevel is not None:
|
||||
|
@@ -39,6 +39,7 @@ OBJDUMP_ARCH_MAP = {
|
||||
'elf64-x86-64-nacl': 'x86-64',
|
||||
'elf32-x86-64-nacl': 'x86-64',
|
||||
'elf32-i386-nacl': 'x86-32',
|
||||
'elf32-littlearm-nacl': 'arm',
|
||||
}
|
||||
|
||||
# The proper name of the dynamic linker, as kept in the IRT. This is
|
||||
@@ -201,6 +202,17 @@ def _FindLibsInPath(name, lib_path):
|
||||
A list of system paths that match the given name within the lib_path'''
|
||||
files = []
|
||||
for dirname in lib_path:
|
||||
# The libc.so files in the the glibc toolchain is actually a linker
|
||||
# script which references libc.so.<SHA1>. This means the lib.so itself
|
||||
# does not end up in the NEEDED section for glibc. However with bionic
|
||||
# the SONAME is actually libc.so. If we pass glibc's libc.so to objdump
|
||||
# if fails to parse it, os this filters out libc.so expept for within
|
||||
# the bionic toolchain.
|
||||
# TODO(noelallen): Remove this once the SONAME in bionic is made to be
|
||||
# unique in the same it is under glibc:
|
||||
# https://code.google.com/p/nativeclient/issues/detail?id=3833
|
||||
if name == 'libc.so' and 'bionic' not in dirname:
|
||||
continue
|
||||
filename = os.path.join(dirname, name)
|
||||
if os.path.exists(filename):
|
||||
files.append(filename)
|
||||
|
Reference in New Issue
Block a user