From e5080a8453d7eea2a91ffb53bdb652336c260834 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Fri, 28 Sep 2018 09:24:25 -0700 Subject: dependencies/llvm: Fix shared linking on osx The versions of LLVM provided by brew have the same configuration problem that dragonflyBSD and FreeBSD do, which means that they produce wrong results for shared linking. --- mesonbuild/dependencies/dev.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/mesonbuild/dependencies/dev.py b/mesonbuild/dependencies/dev.py index d8289c569..f20b9e04c 100644 --- a/mesonbuild/dependencies/dev.py +++ b/mesonbuild/dependencies/dev.py @@ -260,13 +260,15 @@ class LLVMDependency(ConfigToolDependency): def _set_new_link_args(self): """How to set linker args for LLVM versions >= 3.9""" - if ((mesonlib.is_dragonflybsd() or mesonlib.is_freebsd()) and not - self.static and version_compare(self.version, '>= 4.0')): + if (not self.static and (mesonlib.is_osx() or + ((mesonlib.is_dragonflybsd() or mesonlib.is_freebsd()) and + version_compare(self.version, '>= 4.0')))): # llvm-config on DragonFly BSD and FreeBSD 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. + # linking, even though libLLVM.so is installed, because llvm-config + # is misconfigured at build time. + # MacOS from brew has the same problem, except that it applies to + # all versions (3.9 - 7.0) self.link_args = self.get_config_value(['--ldflags'], 'link_args') self.link_args.append('-lLLVM') return -- cgit v1.2.3