From 448ba5b6f300dcaae018e7bb03017f488a0a92a3 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Thu, 21 Dec 2017 09:40:49 -0800 Subject: [PATCH] LLVM: work around bug in dragonfly bsd llvm-config for shared libs Of course there are OS specific bugs for llvm-config as well, so work around those too. --- mesonbuild/dependencies/dev.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mesonbuild/dependencies/dev.py b/mesonbuild/dependencies/dev.py index e039bd670..2be9be4bf 100644 --- a/mesonbuild/dependencies/dev.py +++ b/mesonbuild/dependencies/dev.py @@ -173,6 +173,16 @@ class LLVMDependency(ConfigToolDependency): def _set_new_link_args(self): """How to set linker args for LLVM versions >= 3.9""" + if (mesonlib.is_dragonflybsd() and not self.static and + version_compare(self.version, '>= 4.0')): + # llvm-config on DragonFly BSD for versions 4.0, 5.0, and 6.0 have + # an error when generating arguments for shared mode linking, even + # though libLLVM.so is installed, because for some reason the tool + # expects to find a .so for each static library. This works around + # that. + self.link_args = self.get_config_value(['--ldflags'], 'link_args') + self.link_args.append('-lLLVM') + return link_args = ['--link-static', '--system-libs'] if self.static else ['--link-shared'] self.link_args = self.get_config_value( ['--libs', '--ldflags'] + link_args + list(self.required_modules),