Patchwork chrpath.bbclass: Account for case when ORIGIN is in RPATH

login
register
mail settings
Submitter Khem Raj
Date Aug. 11, 2012, 3:15 a.m.
Message ID <1344654924-655-1-git-send-email-raj.khem@gmail.com>
Download mbox | patch
Permalink /patch/34289/
State New
Headers show

Comments

Khem Raj - Aug. 11, 2012, 3:15 a.m.
This fixes a case when RPATH embedded in program have one of
its path already relative to ORIGIN. We were losing that path
if such a path existed. This patch appends it to the new edited
rpath being created when we see it.

so RPATH like below

(RPATH)              Library rpath:
[$ORIGIN/../lib/amd64/jli:$ORIGIN/../jre/lib/amd64/jli]

would end up being empty

but after this patch its kept intact

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/classes/chrpath.bbclass |    1 +
 1 file changed, 1 insertion(+)
Saul Wold - Aug. 17, 2012, 8:53 p.m.
On 08/10/2012 08:15 PM, Khem Raj wrote:
> This fixes a case when RPATH embedded in program have one of
> its path already relative to ORIGIN. We were losing that path
> if such a path existed. This patch appends it to the new edited
> rpath being created when we see it.
>
> so RPATH like below
>
> (RPATH)              Library rpath:
> [$ORIGIN/../lib/amd64/jli:$ORIGIN/../jre/lib/amd64/jli]
>
> would end up being empty
>
> but after this patch its kept intact
>
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
>   meta/classes/chrpath.bbclass |    1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/meta/classes/chrpath.bbclass b/meta/classes/chrpath.bbclass
> index 10b5ca0..e903b65 100644
> --- a/meta/classes/chrpath.bbclass
> +++ b/meta/classes/chrpath.bbclass
> @@ -49,6 +49,7 @@ def process_dir (directory, d):
>               new_rpaths = []
>               for rpath in rpaths:
>                   # If rpath is already dynamic continue
> +                new_rpaths.append("%s" % (rpath.strip()))
>                   if rpath.find("$ORIGIN") != -1:
>                       continue
>                   # If the rpath shares a root with base_prefix determine a new dynamic rpath from the
>
Merged into OE-Core

Thanks
	Sau!

Patch

diff --git a/meta/classes/chrpath.bbclass b/meta/classes/chrpath.bbclass
index 10b5ca0..e903b65 100644
--- a/meta/classes/chrpath.bbclass
+++ b/meta/classes/chrpath.bbclass
@@ -49,6 +49,7 @@  def process_dir (directory, d):
             new_rpaths = []
             for rpath in rpaths:
                 # If rpath is already dynamic continue
+                new_rpaths.append("%s" % (rpath.strip()))
                 if rpath.find("$ORIGIN") != -1:
                     continue
                 # If the rpath shares a root with base_prefix determine a new dynamic rpath from the