Commit 9078d1ee authored by Thomas Heller's avatar Thomas Heller

ctypes.util.find_library uses dump(1) instead of objdump(1) on Solaris.

Fixes issue #1777530; backported from trunk.
parent 4f2b926a
...@@ -66,15 +66,27 @@ elif os.name == "posix": ...@@ -66,15 +66,27 @@ elif os.name == "posix":
return None return None
return res.group(0) return res.group(0)
def _get_soname(f):
# assuming GNU binutils / ELF if sys.platform == "sunos5":
if not f: # use /usr/ccs/bin/dump on solaris
return None def _get_soname(f):
cmd = "objdump -p -j .dynamic 2>/dev/null " + f if not f:
res = re.search(r'\sSONAME\s+([^\s]+)', os.popen(cmd).read()) return None
if not res: cmd = "/usr/ccs/bin/dump -Lpv 2>/dev/null " + f
return None res = re.search(r'\[.*\]\sSONAME\s+([^\s]+)', os.popen(cmd).read())
return res.group(1) if not res:
return None
return res.group(1)
else:
def _get_soname(f):
# assuming GNU binutils / ELF
if not f:
return None
cmd = "objdump -p -j .dynamic 2>/dev/null " + f
res = re.search(r'\sSONAME\s+([^\s]+)', os.popen(cmd).read())
if not res:
return None
return res.group(1)
if (sys.platform.startswith("freebsd") if (sys.platform.startswith("freebsd")
or sys.platform.startswith("openbsd") or sys.platform.startswith("openbsd")
......
...@@ -32,6 +32,9 @@ Core and builtins ...@@ -32,6 +32,9 @@ Core and builtins
Library Library
------- -------
- Bug #1777530: ctypes.util.find_library uses dump(1) instead of
objdump(1) on Solaris.
- Bug #1153: repr.repr() now doesn't require set and dictionary items - Bug #1153: repr.repr() now doesn't require set and dictionary items
to be orderable to properly represent them. to be orderable to properly represent them.
......
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