aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2017-12-21 16:30:52 -0800
committerDylan Baker <dylan@pnwbakers.com>2018-01-06 13:49:34 -0800
commita9210c57e1bbd95716a46760dad3198d067b5cb0 (patch)
tree7a0e73839644177c9cdc166e188bcd6def5a5215
parent660dee1e10b5293c38d372b7a8ddfce49cc14936 (diff)
downloadmeson-a9210c57e1bbd95716a46760dad3198d067b5cb0.zip
meson-a9210c57e1bbd95716a46760dad3198d067b5cb0.tar.gz
meson-a9210c57e1bbd95716a46760dad3198d067b5cb0.tar.bz2
LLVM: work around FreeBSD specific static linking problems
Because FreeBSD's llvm-config adds -l/usr/lib/libexecinfo.so when asked for system-libs, which is bogus. We'll remove the leading -l from any argument that also ends with .so.
-rw-r--r--mesonbuild/dependencies/dev.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/mesonbuild/dependencies/dev.py b/mesonbuild/dependencies/dev.py
index 4a163ea..25316df 100644
--- a/mesonbuild/dependencies/dev.py
+++ b/mesonbuild/dependencies/dev.py
@@ -170,6 +170,24 @@ class LLVMDependency(ConfigToolDependency):
else:
self._set_old_link_args()
self.link_args = strip_system_libdirs(environment, self.link_args)
+ self.link_args = self.__fix_bogus_link_args(self.link_args)
+
+ @staticmethod
+ def __fix_bogus_link_args(args):
+ """This function attempts to fix bogus link arguments that llvm-config
+ generates.
+
+ Currently it works around the following:
+ - FreeBSD: when statically linking -l/usr/lib/libexecinfo.so will
+ be generated, strip the -l in cases like this.
+ """
+ new_args = []
+ for arg in args:
+ if arg.startswith('-l') and arg.endswith('.so'):
+ new_args.append(arg.lstrip('-l'))
+ else:
+ new_args.append(arg)
+ return new_args
def _set_new_link_args(self):
"""How to set linker args for LLVM versions >= 3.9"""