Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] Fix RPATH warning vs. weird paths
@ 2012-08-15 22:46 Andy Ross
  2012-08-15 22:46 ` [PATCH] insane.bbclass: Fix RPATH warning in the face of funny path strings Andy Ross
  0 siblings, 1 reply; 11+ messages in thread
From: Andy Ross @ 2012-08-15 22:46 UTC (permalink / raw)
  To: openembedded-core

We hit some oddball cases where libraries were being built with RPATHs
referencing host directores and causing version skew in builds.  There
is a warning case to detect that already, but it was being fooled by
".." terms in the path strings.  This just adds a normalize step to
the path comparison and unmasks the missing warnings.

Andy




^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: [PATCH 1/2] insane.bbclass: Fix RPATH warning in the face of funny path strings
@ 2012-08-17 16:20 Richard Purdie
  2012-08-20 21:05 ` [PATCH] " Andy Ross
  0 siblings, 1 reply; 11+ messages in thread
From: Richard Purdie @ 2012-08-17 16:20 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer; +Cc: openembedded-core

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))





^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2012-08-21 16:02 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
  -- strict thread matches above, loose matches on Subject: below --
2012-08-17 16:20 [PATCH 1/2] " Richard Purdie
2012-08-20 21:05 ` [PATCH] " Andy Ross
2012-08-21 15:49   ` Saul Wold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox