Commit b1de5360 authored by binji@chromium.org's avatar binji@chromium.org

[NaCl SDK] Fix create_nmf on dynamic bionic nexes

create_nmf runs objdump on its shared objects to determine what
dependencies it has. libc.so is a dependency of bionic, and it is an ELF
file. glibc has libc.so as well, but it is not an ELF file, but a linker
script.

There was a check in get_shared_deps.py that prevented running objdump on
libc.so, if "bionic" is not in the path. Since we've added a package
called "bionic_canary", "bionic" is always in the path, so objdump was
being run on glibc's "libc.so", which fails.

The (hack) fix is to check if a relative path from the root of the SDK has
"bionic". This should only be true if the path is
"toolchain/linux_arm_bionic/...".

BUG=none
R=sbc@chromium.org, noelallen@chromium.org
TEST=test_all.py

Review URL: https://codereview.chromium.org/341983002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@278133 0039d316-1c4b-4281-b951-d872f2087c98
parent c82fe578
......@@ -21,6 +21,9 @@ import subprocess
import elf
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
SDK_DIR = os.path.dirname(os.path.dirname(SCRIPT_DIR))
NeededMatcher = re.compile('^ *NEEDED *([^ ]+)\n$')
FormatMatcher = re.compile('^(.+):\\s*file format (.+)\n$')
......@@ -211,7 +214,8 @@ def _FindLibsInPath(name, lib_path):
# 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:
rel_dirname = os.path.relpath(dirname, SDK_DIR)
if name == 'libc.so' and 'bionic' not in rel_dirname:
continue
filename = os.path.join(dirname, name)
if os.path.exists(filename):
......
......@@ -13,10 +13,13 @@ import unittest
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
LIB_DIR = os.path.dirname(SCRIPT_DIR)
TOOLS_DIR = os.path.dirname(LIB_DIR)
SDK_DIR = os.path.dirname(TOOLS_DIR)
DATA_DIR = os.path.join(SCRIPT_DIR, 'data')
BUILD_TOOLS_DIR = os.path.join(SDK_DIR, 'build_tools')
sys.path.append(LIB_DIR)
sys.path.append(TOOLS_DIR)
sys.path.append(BUILD_TOOLS_DIR)
import build_paths
import get_shared_deps
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment