summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbinji@chromium.org <binji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-18 18:42:31 +0000
committerbinji@chromium.org <binji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-18 18:42:31 +0000
commitb1de53603e7a945b06e1bebb9eee8dc1cae70577 (patch)
treef3950b705e4d2ff3eacf4e9391b48e398c8752d2
parentc82fe578fc9d429cb2b17798be2aaf8965824364 (diff)
downloadchromium_src-b1de53603e7a945b06e1bebb9eee8dc1cae70577.zip
chromium_src-b1de53603e7a945b06e1bebb9eee8dc1cae70577.tar.gz
chromium_src-b1de53603e7a945b06e1bebb9eee8dc1cae70577.tar.bz2
[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
-rw-r--r--native_client_sdk/src/tools/lib/get_shared_deps.py6
-rwxr-xr-xnative_client_sdk/src/tools/lib/tests/get_shared_deps_test.py3
2 files changed, 8 insertions, 1 deletions
diff --git a/native_client_sdk/src/tools/lib/get_shared_deps.py b/native_client_sdk/src/tools/lib/get_shared_deps.py
index 99a5884..b7b433f 100644
--- a/native_client_sdk/src/tools/lib/get_shared_deps.py
+++ b/native_client_sdk/src/tools/lib/get_shared_deps.py
@@ -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):
diff --git a/native_client_sdk/src/tools/lib/tests/get_shared_deps_test.py b/native_client_sdk/src/tools/lib/tests/get_shared_deps_test.py
index 2f35f78..0f39c0c 100755
--- a/native_client_sdk/src/tools/lib/tests/get_shared_deps_test.py
+++ b/native_client_sdk/src/tools/lib/tests/get_shared_deps_test.py
@@ -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