Some more tests passing.

pull/15/head
Jussi Pakkanen 11 years ago
parent 9f05fce831
commit 62a607c057
  1. 2
      backends.py
  2. 15
      depfixer.py
  3. 5
      environment.py
  4. 4
      test cases/common/46 library chain/installed_files.txt

@ -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]

@ -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):

@ -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):

@ -0,0 +1,4 @@
bin/prog
lib/liblib1.so
lib/liblib2.so
lib/liblib3.so
Loading…
Cancel
Save