[oe-commits] [openembedded-core] 24/50: chrpath: Remove standard search paths from RPATHS

git at git.openembedded.org git at git.openembedded.org
Tue Nov 15 15:20:56 UTC 2016


rpurdie pushed a commit to branch master
in repository openembedded-core.

commit 6b94569d5d8e8bdd575d12e260abf10d3ac11cfd
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Thu Sep 29 00:45:37 2016 +0100

    chrpath: Remove standard search paths from RPATHS
    
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/classes/chrpath.bbclass | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/meta/classes/chrpath.bbclass b/meta/classes/chrpath.bbclass
index 3b5cd37..f183b4a 100644
--- a/meta/classes/chrpath.bbclass
+++ b/meta/classes/chrpath.bbclass
@@ -17,19 +17,24 @@ def process_file_linux(cmd, fpath, rootdir, baseprefix, tmpdir, d):
     # Throw away everything other than the rpath list
     curr_rpath = out.partition("RPATH=")[2]
     #bb.note("Current rpath for %s is %s" % (fpath, curr_rpath.strip()))
-    rpaths = curr_rpath.split(":")
+    rpaths = curr_rpath.strip().split(":")
     new_rpaths = []
     modified = False
     for rpath in rpaths:
         # If rpath is already dynamic copy it to new_rpath and continue
         if rpath.find("$ORIGIN") != -1:
-            new_rpaths.append(rpath.strip())
+            new_rpaths.append(rpath)
             continue
         rpath =  os.path.normpath(rpath)
         if baseprefix not in rpath and tmpdir not in rpath:
-            new_rpaths.append(rpath.strip())
+            # Skip standard search paths
+            if rpath in ['/lib', '/usr/lib', '/lib64/', '/usr/lib64']:
+                bb.warn("Skipping RPATH %s as is a standard search path for %s" % (rpath, fpath))
+                modified = True
+                continue
+            new_rpaths.append(rpath)
             continue
-        new_rpaths.append("$ORIGIN/" + os.path.relpath(rpath.strip(), os.path.dirname(fpath.replace(rootdir, "/"))))
+        new_rpaths.append("$ORIGIN/" + os.path.relpath(rpath, os.path.dirname(fpath.replace(rootdir, "/"))))
         modified = True
 
     # if we have modified some rpaths call chrpath to update the binary

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list