aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/compilers.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2017-12-26 13:13:02 +0200
committerGitHub <noreply@github.com>2017-12-26 13:13:02 +0200
commitd0d07a6fa94d9df4666027c07abdf6a431de2cb8 (patch)
tree1a4128c5c3707739cbe3bb9c2ffbbea8b79af0b0 /mesonbuild/compilers/compilers.py
parent84e47ab654a7b8b360b502fde1f6e289ff6ddd42 (diff)
parent55abe16d5a580d949fdd55d366409f6e4aef97a3 (diff)
downloadmeson-d0d07a6fa94d9df4666027c07abdf6a431de2cb8.zip
meson-d0d07a6fa94d9df4666027c07abdf6a431de2cb8.tar.gz
meson-d0d07a6fa94d9df4666027c07abdf6a431de2cb8.tar.bz2
Merge pull request #2826 from bredelings/fix-clang-on-linux
Fix linking with clang++ on linux if install_rpath.
Diffstat (limited to 'mesonbuild/compilers/compilers.py')
-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..24ae3c9 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