aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers.py
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild/compilers.py')
-rw-r--r--mesonbuild/compilers.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/mesonbuild/compilers.py b/mesonbuild/compilers.py
index 06b0a59..595be60 100644
--- a/mesonbuild/compilers.py
+++ b/mesonbuild/compilers.py
@@ -337,7 +337,12 @@ def build_unix_rpath_args(build_dir, from_dir, rpath_paths, install_rpath):
paths = padding
else:
paths = paths + ':' + padding
- return ['-Wl,-rpath,' + paths]
+ # Rpaths to use while linking must be absolute. These are not used
+ # while running and are not written to the binary.
+ # https://github.com/mesonbuild/meson/issues/1897
+ # https://sourceware.org/bugzilla/show_bug.cgi?id=16936
+ linkpaths = ':'.join([os.path.join(build_dir, p) for p in rpath_paths])
+ return ['-Wl,-rpath,' + paths, '-Wl,-rpath-link,' + linkpaths]
class CrossNoRunException(MesonException):
pass