Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Andy Ross <andy.ross@windriver.com>
To: openembedded-core@openembedded.org,
	Richard Purdie <richard.purdie@linuxfoundation.org>
Subject: [PATCH] insane.bbclass: Fix RPATH warning in the face of funny path strings
Date: Mon, 20 Aug 2012 14:05:58 -0700	[thread overview]
Message-ID: <1345496758-29154-1-git-send-email-andy.ross@windriver.com> (raw)
In-Reply-To: <1345220434.27428.15.camel@ted>

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.

Signed-off-by: Andy Ross <andy.ross@windriver.com>
---
 meta/classes/insane.bbclass | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index 556a176..9d085a4 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -166,6 +166,9 @@ def package_qa_check_useless_rpaths(file, name, d, elf, messages):
     """
     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
 
@@ -181,7 +184,7 @@ def package_qa_check_useless_rpaths(file, name, d, elf, messages):
     	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))
-- 
1.7.11.2




  reply	other threads:[~2012-08-20 21:18 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-17 15:53 [PATCH 0/2] RPATH host pollution fixes Andy Ross
2012-08-17 15:53 ` [PATCH 1/2] insane.bbclass: Fix RPATH warning in the face of funny path strings Andy Ross
2012-08-17 15:53   ` [PATCH 2/2] libtool: normalize link paths before considering for RPATH Andy Ross
2012-08-19 10:06     ` Richard Purdie
2012-08-20 16:59       ` Andy Ross
2012-08-20 21:55         ` Richard Purdie
2012-08-17 16:20   ` [PATCH 1/2] insane.bbclass: Fix RPATH warning in the face of funny path strings Richard Purdie
2012-08-20 21:05     ` Andy Ross [this message]
2012-08-21 15:49       ` [PATCH] " Saul Wold
  -- strict thread matches above, loose matches on Subject: below --
2012-08-15 22:46 [PATCH] Fix RPATH warning vs. weird paths Andy Ross
2012-08-15 22:46 ` [PATCH] insane.bbclass: Fix RPATH warning in the face of funny path strings Andy Ross
2012-08-16  0:14   ` Chris Larson
2012-08-16 16:10     ` Andy Ross
2012-08-16 16:10       ` Andy Ross
2012-08-16  8:39   ` Phil Blundell
2012-08-16 17:43     ` Andy Ross
2012-08-17 10:28       ` Richard Purdie
2012-08-17 15:02         ` Andy Ross

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1345496758-29154-1-git-send-email-andy.ross@windriver.com \
    --to=andy.ross@windriver.com \
    --cc=openembedded-core@openembedded.org \
    --cc=richard.purdie@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox