aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2013-10-04 23:43:42 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2013-10-04 23:43:42 +0300
commit62a607c0571ea3e1ef58a5ab4cd834f05fa0fa51 (patch)
treed0cae8b53de250f5d122db19ce1e51cafcc47cdd
parent9f05fce831c5987346421687cc584df7c3907db6 (diff)
downloadmeson-62a607c0571ea3e1ef58a5ab4cd834f05fa0fa51.zip
meson-62a607c0571ea3e1ef58a5ab4cd834f05fa0fa51.tar.gz
meson-62a607c0571ea3e1ef58a5ab4cd834f05fa0fa51.tar.bz2
Some more tests passing.
-rw-r--r--backends.py2
-rwxr-xr-xdepfixer.py15
-rw-r--r--environment.py5
-rw-r--r--test cases/common/46 library chain/installed_files.txt4
4 files changed, 20 insertions, 6 deletions
diff --git a/backends.py b/backends.py
index ec39c0c..32bec62 100644
--- a/backends.py
+++ b/backends.py
@@ -860,7 +860,7 @@ class NinjaBackend(Backend):
commands += dep.get_link_flags()
dependencies = target.get_dependencies()
commands += self.build_target_link_arguments(linker, dependencies)
- commands += linker.build_rpath_arg(self.environment.get_build_dir(), target.get_rpaths())
+ commands += linker.build_rpath_args(self.environment.get_build_dir(), target.get_rpaths())
if self.environment.coredata.coverage:
commands += linker.get_coverage_link_flags()
dep_targets = [self.get_dependency_filename(t) for t in dependencies]
diff --git a/depfixer.py b/depfixer.py
index c93d58c..5585501 100755
--- a/depfixer.py
+++ b/depfixer.py
@@ -191,12 +191,16 @@ class Elf():
sec = self.find_section(b'.dynstr')
for i in self.dynamic:
if i.d_tag == DT_RPATH:
- rpath = i
- return sec.sh_offset + rpath.val
+ return sec.sh_offset + i.val
+ return None
def print_rpath(self):
- self.bf.seek(self.get_rpath_offset())
- print(self.read_str())
+ offset = self.get_rpath_offset()
+ if offset is None:
+ print("This file does not have an rpath.")
+ else:
+ self.bf.seek(offset)
+ print(self.read_str())
def print_deps(self):
sec = self.find_section(b'.dynstr')
@@ -230,6 +234,9 @@ class Elf():
def fix_rpath(self, new_rpath):
rp_off = self.get_rpath_offset()
+ if rp_off is None:
+ print('File does not have rpath. It should be a fully static executable.')
+ return
self.bf.seek(rp_off)
old_rpath = self.read_str()
if len(old_rpath) < len(new_rpath):
diff --git a/environment.py b/environment.py
index 50c755c..f71d82b 100644
--- a/environment.py
+++ b/environment.py
@@ -594,6 +594,9 @@ class GnuCPPCompiler(CPPCompiler):
def get_pch_suffix(self):
return 'gch'
+ def build_rpath_args(self, build_dir, rpath_paths):
+ return ['-Wl,-rpath,' + ':'.join([os.path.join(build_dir, p) for p in rpath_paths])]
+
class ClangCPPCompiler(CPPCompiler):
std_warn_flags = ['-Wall', '-Winvalid-pch']
std_opt_flags = ['-O2']
@@ -637,7 +640,7 @@ class ArLinker():
def __init__(self, exelist):
self.exelist = exelist
- def build_rpath_arg(self, build_dir, rpath_paths):
+ def build_rpath_args(self, build_dir, rpath_paths):
return []
def get_exelist(self):
diff --git a/test cases/common/46 library chain/installed_files.txt b/test cases/common/46 library chain/installed_files.txt
new file mode 100644
index 0000000..cee40b7
--- /dev/null
+++ b/test cases/common/46 library chain/installed_files.txt
@@ -0,0 +1,4 @@
+bin/prog
+lib/liblib1.so
+lib/liblib2.so
+lib/liblib3.so