aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers
diff options
context:
space:
mode:
authorBenjamin Redelings <benjamin.redelings@gmail.com>2017-12-23 13:22:23 -0800
committerBenjamin Redelings <benjamin.redelings@gmail.com>2017-12-23 13:22:23 -0800
commit907744d55e224f21d45d1dfac852db20de7d5532 (patch)
treee31095428e9b20e76b91bfca18a468d38efac65e /mesonbuild/compilers
parenta50106afeecaa0d6bb3effd5baf08f37a3102511 (diff)
downloadmeson-907744d55e224f21d45d1dfac852db20de7d5532.zip
meson-907744d55e224f21d45d1dfac852db20de7d5532.tar.gz
meson-907744d55e224f21d45d1dfac852db20de7d5532.tar.bz2
Fix linking with clang++ on linux if install_rpath.
Diffstat (limited to 'mesonbuild/compilers')
-rw-r--r--mesonbuild/compilers/compilers.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py
index 3d50eb0..ba76fad 100644
--- a/mesonbuild/compilers/compilers.py
+++ b/mesonbuild/compilers/compilers.py
@@ -863,7 +863,12 @@ class Compiler:
# Not needed on Windows or other platforms that don't use RPATH
# https://github.com/mesonbuild/meson/issues/1897
lpaths = ':'.join([os.path.join(build_dir, p) for p in rpath_paths])
- args += ['-Wl,-rpath-link,' + lpaths]
+
+ # clang expands '-Wl,rpath-link,' to ['-rpath-link'] instead of ['-rpath-link','']
+ # This eats the next argument, which happens to be 'ldstdc++', causing link failures.
+ # We can dodge this problem by not adding any rpath_paths if the argument is empty.
+ if lpaths.strip() != '':
+ args += ['-Wl,-rpath-link,'+lpaths]
return args