In toolchain edge cases it's possible for the RPATH of a library to be
set to something like "/usr/lib/../lib". This should be detected as
"/usr/lib" and generate a warning.
(From OE-Core rev:
72a924d0686389d648338efd3f675fc85ee2d181)
Signed-off-by: Andy Ross <andy.ross@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
"""
Check for RPATHs that are useless but not dangerous
"""
+ def rpath_eq(a, b):
+ return os.path.normpath(a) == os.path.normpath(b)
+
if not elf:
return
m = rpath_re.match(line)
if m:
rpath = m.group(1)
- if rpath == libdir or rpath == base_libdir:
+ if rpath_eq(rpath, libdir) or rpath_eq(rpath, base_libdir):
# The dynamic linker searches both these places anyway. There is no point in
# looking there again.
messages.append("%s: %s contains probably-redundant RPATH %s" % (name, package_qa_clean_path(file, d), rpath))