aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHemmo Nieminen <hemmo.nieminen@iki.fi>2017-07-07 11:34:54 +0300
committerNirbheek Chauhan <nirbheek@centricular.com>2017-07-17 11:54:23 +0530
commitadd7aa841f1ad1026860c532b9ae73199746781c (patch)
tree9de81cd35c4ebfe8ebdd18d1de5d43718611aa7d
parent3e4668056386717e2fb39b6c1c79435facf84bc5 (diff)
downloadmeson-add7aa841f1ad1026860c532b9ae73199746781c.zip
meson-add7aa841f1ad1026860c532b9ae73199746781c.tar.gz
meson-add7aa841f1ad1026860c532b9ae73199746781c.tar.bz2
Fix how rpath directories are handled.
Linking a library from a directory below the executable's directory caused an invalid path to be written in the executable's RPATH.
-rw-r--r--mesonbuild/compilers.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/mesonbuild/compilers.py b/mesonbuild/compilers.py
index 925aca1..efa08f4 100644
--- a/mesonbuild/compilers.py
+++ b/mesonbuild/compilers.py
@@ -762,14 +762,11 @@ class Compiler:
# directory. This breaks reproducible builds.
rel_rpaths = []
for p in rpath_paths:
- # p can be an empty string for build_dir (relative path), but
- # os.path.relpath() below won't like that.
- if p == '':
- p = build_dir
if p == from_dir:
relative = '' # relpath errors out in this case
else:
- relative = os.path.relpath(p, from_dir)
+ relative = os.path.relpath(os.path.join(build_dir, p),
+ os.path.join(build_dir, from_dir))
rel_rpaths.append(relative)
paths = ':'.join([os.path.join('$ORIGIN', p) for p in rel_rpaths])
if len(paths) < len(install_rpath):