Skip to content

Commit

Permalink
Don't require "OS ABI" specification in libraries
Browse files Browse the repository at this point in the history
The most important system libraries are listed like this by ldconfig:

	libc.so.6 (libc6,x86-64, OS ABI: Linux 3.0.0) => /lib64/libc.so.6

But most user-level libraries don't have the "OS ABI" and will not be
found by the regular expression.

	libz.so (libc6,x86-64) => /usr/lib64/libz.so

This makes the regular expression more permissive, so that it finds
those libraries as well.
  • Loading branch information
aaronpuchert committed Apr 16, 2016
1 parent b51da5e commit 3926f26
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/python/bcc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ def find_library(cls, name):
"ia64-64": "libc6,IA-64",
}
abi_type = mach_map.get(machine, "libc6")
expr = r"\s+lib%s\.[^\s]+\s+\(%s, [^)]+[^/]+([^\s]+)" % (name, abi_type)
expr = r"\s+lib%s\.[^\s]+\s+\(%s[^)]*[^/]+([^\s]+)" % (name, abi_type)
with os.popen("/sbin/ldconfig -p 2>/dev/null") as f:
data = f.read()
res = re.search(expr, data)
Expand Down

0 comments on commit 3926f26

Please sign in to comment.