From 49ae886620c5d140efbbe177ff0565ba100309f2 Mon Sep 17 00:00:00 2001 From: Andrei Alexeyev Date: Tue, 10 Sep 2019 17:05:35 +0300 Subject: Don't pass --allow-shlib-undefined to lld if it's not supported Fixes builds with llvm-mingw --- mesonbuild/linkers.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'mesonbuild/linkers.py') diff --git a/mesonbuild/linkers.py b/mesonbuild/linkers.py index dbd90b2..41b445e 100644 --- a/mesonbuild/linkers.py +++ b/mesonbuild/linkers.py @@ -659,7 +659,18 @@ class LLVMDynamicLinker(GnuLikeDynamicLinkerMixin, PosixDynamicLinkerMixin, Dyna This is only the posix-like linker. """ - pass + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + + # Some targets don't seem to support this argument (windows, wasm, ...) + _, _, e = mesonlib.Popen_safe(self.exelist + self._apply_prefix('--allow-shlib-undefined')) + self.has_allow_shlib_undefined = not ('unknown argument: --allow-shlib-undefined' in e) + + def get_allow_undefined_args(self) -> typing.List[str]: + if self.has_allow_shlib_undefined: + return self._apply_prefix('--allow-shlib-undefined') + return [] + class CcrxDynamicLinker(DynamicLinker): -- cgit v1.1