Patchwork relocatable.bbclass: do not erease already existing ORIGIN paths and sanity resulting rpath

login
register
mail settings
Submitter Henning Heinold
Date March 23, 2012, 9:10 p.m.
Message ID <1332537058-13783-2-git-send-email-heinold@inf.fu-berlin.de>
Download mbox | patch
Permalink /patch/24353/
State Superseded
Headers show

Comments

Henning Heinold - March 23, 2012, 9:10 p.m.
* let already exisiting ORIGIN path stay in the binary
  otherwise binaries will not find there libs in directories
  besides the standard defined directories
* remove all whitespaces from the resulting path

Signed-off-by: Henning Heinold <heinold@inf.fu-berlin.de>
---
 meta/classes/relocatable.bbclass |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

Patch

diff --git a/meta/classes/relocatable.bbclass b/meta/classes/relocatable.bbclass
index 072f533..dff12ed 100644
--- a/meta/classes/relocatable.bbclass
+++ b/meta/classes/relocatable.bbclass
@@ -6,6 +6,7 @@  PREPROCESS_RELOCATE_DIRS ?= ""
 def process_dir (directory, d):
     import subprocess as sub
     import stat
+    import re
 
     cmd = d.expand('${CHRPATH_BIN}')
     tmpdir = d.getVar('TMPDIR')
@@ -52,6 +53,7 @@  def process_dir (directory, d):
             for rpath in rpaths:
                 # If rpath is already dynamic continue
                 if rpath.find("$ORIGIN") != -1:
+                    new_rpaths.append(rpath)
                     continue
                 # If the rpath shares a root with base_prefix determine a new dynamic rpath from the
                 # base_prefix shared root
@@ -75,6 +77,7 @@  def process_dir (directory, d):
             # if we have modified some rpaths call chrpath to update the binary
             if len(new_rpaths):
                 args = ":".join(new_rpaths)
+		args = re.sub(r'\s', '', args)
                 #bb.note("Setting rpath for %s to %s" %(fpath, args))
                 sub.call([cmd, '-r', args, fpath])