summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2016-09-29 00:45:37 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-11-15 15:19:53 +0000
commit21a5e74eb56b23faf9b5861ff0496982ff249eb3 (patch)
treed548cfdbf81c503719eb7414fa963d26cc5d07a0 /meta
parent025f917cec255e1f65d8b8b6c37a1a315173ea8c (diff)
downloadpoky-21a5e74eb56b23faf9b5861ff0496982ff249eb3.tar.gz
chrpath: Remove standard search paths from RPATHS
(From OE-Core rev: 6b94569d5d8e8bdd575d12e260abf10d3ac11cfd) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/chrpath.bbclass13
1 files changed, 9 insertions, 4 deletions
diff --git a/meta/classes/chrpath.bbclass b/meta/classes/chrpath.bbclass
index 3b5cd37f7b..f183b4aeeb 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):
17 # Throw away everything other than the rpath list 17 # Throw away everything other than the rpath list
18 curr_rpath = out.partition("RPATH=")[2] 18 curr_rpath = out.partition("RPATH=")[2]
19 #bb.note("Current rpath for %s is %s" % (fpath, curr_rpath.strip())) 19 #bb.note("Current rpath for %s is %s" % (fpath, curr_rpath.strip()))
20 rpaths = curr_rpath.split(":") 20 rpaths = curr_rpath.strip().split(":")
21 new_rpaths = [] 21 new_rpaths = []
22 modified = False 22 modified = False
23 for rpath in rpaths: 23 for rpath in rpaths:
24 # If rpath is already dynamic copy it to new_rpath and continue 24 # If rpath is already dynamic copy it to new_rpath and continue
25 if rpath.find("$ORIGIN") != -1: 25 if rpath.find("$ORIGIN") != -1:
26 new_rpaths.append(rpath.strip()) 26 new_rpaths.append(rpath)
27 continue 27 continue
28 rpath = os.path.normpath(rpath) 28 rpath = os.path.normpath(rpath)
29 if baseprefix not in rpath and tmpdir not in rpath: 29 if baseprefix not in rpath and tmpdir not in rpath:
30 new_rpaths.append(rpath.strip()) 30 # Skip standard search paths
31 if rpath in ['/lib', '/usr/lib', '/lib64/', '/usr/lib64']:
32 bb.warn("Skipping RPATH %s as is a standard search path for %s" % (rpath, fpath))
33 modified = True
34 continue
35 new_rpaths.append(rpath)
31 continue 36 continue
32 new_rpaths.append("$ORIGIN/" + os.path.relpath(rpath.strip(), os.path.dirname(fpath.replace(rootdir, "/")))) 37 new_rpaths.append("$ORIGIN/" + os.path.relpath(rpath, os.path.dirname(fpath.replace(rootdir, "/"))))
33 modified = True 38 modified = True
34 39
35 # if we have modified some rpaths call chrpath to update the binary 40 # if we have modified some rpaths call chrpath to update the binary