Skip to contentSkip to conversation

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

PATCH In review Khem Raj 3 participants 3 messages Aug 16, 2012 – Aug 17, 2012

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH v2 1/1 chrpath.bbclass: Account for case when ORIGIN is in RPATH

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

---
 meta/classes/chrpath.bbclass |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/classes/chrpath.bbclass +2 -1
index 10b5ca0..861d369 100644
@@ -48,8 +48,9 @@ def process_dir (directory, d):
             rpaths = curr_rpath.split(":")
             new_rpaths = []
             for rpath in rpaths:
-                # If rpath is already dynamic continue
+                # If rpath is already dynamic copy it to new_rpath and continue
                 if rpath.find("$ORIGIN") != -1:
+                    new_rpaths.append("%s" % (rpath.strip()))
                     continue
                 # If the rpath shares a root with base_prefix determine a new dynamic rpath from the
                 # base_prefix shared root
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 36 lines · Khem Raj

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

---
 meta/classes/chrpath.bbclass |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/classes/chrpath.bbclass +2 -1
index 10b5ca0..861d369 100644
@@ -48,8 +48,9 @@ def process_dir (directory, d):
             rpaths = curr_rpath.split(":")
             new_rpaths = []
             for rpath in rpaths:
-                # If rpath is already dynamic continue
+                # If rpath is already dynamic copy it to new_rpath and continue
                 if rpath.find("$ORIGIN") != -1:
+                    new_rpaths.append("%s" % (rpath.strip()))
                     continue
                 # If the rpath shares a root with base_prefix determine a new dynamic rpath from the
                 # base_prefix shared root
Signature · 1 line
1.7.9.5

Hi Khem,

just notice my solution some months ago

http://patches.openembedded.org/patch/24461/

Bye Henning

#2 lore raw
Quoted 40 lines · Henning Heinold
Quoted 36 lines · Khem Raj

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

---
 meta/classes/chrpath.bbclass |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/classes/chrpath.bbclass +2 -1
index 10b5ca0..861d369 100644
@@ -48,8 +48,9 @@ def process_dir (directory, d):
             rpaths = curr_rpath.split(":")
             new_rpaths = []
             for rpath in rpaths:
-                # If rpath is already dynamic continue
+                # If rpath is already dynamic copy it to new_rpath and continue
                 if rpath.find("$ORIGIN") != -1:
+                    new_rpaths.append("%s" % (rpath.strip()))
                     continue
                 # If the rpath shares a root with base_prefix determine a new dynamic rpath from the
                 # base_prefix shared root
Signature · 1 line
1.7.9.5

Hi Khem,

Quoted 3 lines

just notice my solution some months ago

http://patches.openembedded.org/patch/24461/

I merged a version of this which simply does:

new_rpaths.append(rpath.strip())

since that is neater than using regexps.

Cheers,

Richard