summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/relocatable.bbclass7
1 files changed, 3 insertions, 4 deletions
diff --git a/meta/classes/relocatable.bbclass b/meta/classes/relocatable.bbclass
index 95be7b6e88..7155503c9f 100644
--- a/meta/classes/relocatable.bbclass
+++ b/meta/classes/relocatable.bbclass
@@ -6,7 +6,6 @@ def rpath_replace (path, d):
6 import subprocess as sub 6 import subprocess as sub
7 7
8 cmd = bb.data.expand('${CHRPATH_BIN}', d) 8 cmd = bb.data.expand('${CHRPATH_BIN}', d)
9 tmpdir = bb.data.expand('${base_prefix}', d)
10 9
11 for root, dirs, files in os.walk(path): 10 for root, dirs, files in os.walk(path):
12 for file in files: 11 for file in files:
@@ -22,7 +21,7 @@ def rpath_replace (path, d):
22 rpaths = curr_rpath.split(":") 21 rpaths = curr_rpath.split(":")
23 new_rpaths = [] 22 new_rpaths = []
24 for rpath in rpaths: 23 for rpath in rpaths:
25 depth = fpath.partition(tmpdir)[2].strip().count('/') 24 depth = fpath.partition(path)[2].count('/')
26 if depth == 3: 25 if depth == 3:
27 # / is two levels up 26 # / is two levels up
28 root = "$ORIGIN/../.." 27 root = "$ORIGIN/../.."
@@ -30,11 +29,11 @@ def rpath_replace (path, d):
30 root = "$ORIGIN/.." 29 root = "$ORIGIN/.."
31 30
32 # kill everything up to "/" 31 # kill everything up to "/"
33 new_rpaths.append("%s%s" % (root, rpath.partition(tmpdir)[2].strip())) 32 new_rpaths.append("%s%s" % (root, rpath.partition(path)[2].strip()))
34 args = ":".join(new_rpaths) 33 args = ":".join(new_rpaths)
35 #bb.note("Setting rpath to " + args) 34 #bb.note("Setting rpath to " + args)
36 sub.call([cmd, '-r', args, fpath]) 35 sub.call([cmd, '-r', args, fpath])
37 36
38python relocatable_binaries_preprocess() { 37python relocatable_binaries_preprocess() {
39 rpath_replace(bb.data.expand("${SYSROOT_DESTDIR}${TMPDIR}/sysroots/${TARGET_ARCH}-${TARGET_OS}", d), d) 38 rpath_replace(bb.data.getVar('base_prefix', d, True), d)
40} 39}