Skip to content

Commit

Permalink
Workaround for Clang linker bug where it can not find shared librarie…
Browse files Browse the repository at this point in the history
…s in rpath directories. The solution is to specify all linker targets every time.
  • Loading branch information
jpakkane committed Oct 18, 2014
1 parent 0abc1b1 commit 74d6502
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,11 @@ def build_target_link_arguments(self, compiler, deps):
if fname.endswith('dll'):
fname = fname[:-3] + 'lib'
args.append(fname)
# If you have executable e that links to shared lib s1 that links to shared library s2
# you have to specify s2 as well as s1 when linking e even if e does not directly use
# s2. Gcc handles this case fine but Clang does not for some reason. Thus we need to
# explictly specify all libraries every time.
args += self.build_target_link_arguments(compiler, d.get_dependencies())
return args

def generate_configure_files(self):
Expand Down

0 comments on commit 74d6502

Please sign in to comment.