From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Patches and discussions about the oe-core layer
<openembedded-core@lists.openembedded.org>
Cc: openembedded-core@openembedded.org
Subject: Re: [PATCH 1/2] insane.bbclass: Fix RPATH warning in the face of funny path strings
Date: Fri, 17 Aug 2012 17:20:34 +0100 [thread overview]
Message-ID: <1345220434.27428.15.camel@ted> (raw)
In-Reply-To: <1345218791-28891-2-git-send-email-andy.ross@windriver.com>
On Fri, 2012-08-17 at 08:53 -0700, Andy Ross wrote:
> 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 | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
> index 556a176..b84a89f 100644
> --- a/meta/classes/insane.bbclass
> +++ b/meta/classes/insane.bbclass
> @@ -161,6 +161,10 @@ def package_qa_check_rpath(file,name, d, elf, messages):
> if dir in line:
> messages.append("package %s contains bad RPATH %s in file %s" % (name, line, file))
>
> +def rpath_eq(a, b):
> + import os.path
You don't need that import, os is always assumed to be present for our
code since it gets used so often. I'd suggest defining this within the
package_qa_check_useless_rpaths() function too since its slightly less
effort for the parser.
Cheers,
Richard
> + return os.path.normpath(a) == os.path.normpath(b)
> +
> QAPATHTEST[useless-rpaths] = "package_qa_check_useless_rpaths"
> def package_qa_check_useless_rpaths(file, name, d, elf, messages):
> """
> @@ -181,7 +185,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))
next prev parent reply other threads:[~2012-08-17 16:32 UTC|newest]
Thread overview: 9+ 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 ` Richard Purdie [this message]
2012-08-20 21:05 ` [PATCH] insane.bbclass: Fix RPATH warning in the face of funny path strings Andy Ross
2012-08-21 15:49 ` Saul Wold
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=1345220434.27428.15.camel@ted \
--to=richard.purdie@linuxfoundation.org \
--cc=openembedded-core@lists.openembedded.org \
--cc=openembedded-core@openembedded.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