diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py index 42524a89b..ee5b56824 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.py @@ -717,7 +717,10 @@ class Environment: check_args = prefix + ['/logo'] + prefix + ['--version'] p, o, _ = Popen_safe(compiler + check_args) if o.startswith('LLD'): - return ClangClDynamicLinker(for_machine, exelist=compiler, prefix=prefix, version=search_version(o)) + if '(compatible with GNU linkers)' in o: + return LLVMDynamicLinker(compiler, for_machine, 'lld', prefix, version=search_version(o)) + else: + return ClangClDynamicLinker(for_machine, exelist=compiler, prefix=prefix, version=search_version(o)) elif o.startswith('Microsoft'): match = re.search(r'.*(X86|X64|ARM|ARM64).*', o) if match: