diff options
| author | Sam James <sam@gentoo.org> | 2025-11-10 18:55:37 +0000 |
|---|---|---|
| committer | Eli Schwartz <eschwartz93@gmail.com> | 2025-11-11 21:09:55 -0500 |
| commit | 1401b1d2bfe090750b52137dc57ca59ad00ca69b (patch) | |
| tree | 85600c8a10e05dca940faa1a0658569de7ec4c95 | |
| parent | 683e07f65cd9ecc5009ad0b405816f7ceb98c4bb (diff) | |
| download | meson-1401b1d2bfe090750b52137dc57ca59ad00ca69b.tar.gz | |
compilers: clang: allow ThinLTO with bfd
bfd supports the 'gold' plugin API too, just the LLVM plugin is called
'LLVMgold'.
Closes: https://github.com/mesonbuild/meson/issues/10798
| -rw-r--r-- | mesonbuild/compilers/mixins/clang.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/mesonbuild/compilers/mixins/clang.py b/mesonbuild/compilers/mixins/clang.py index 8351672a1..cb7d66107 100644 --- a/mesonbuild/compilers/mixins/clang.py +++ b/mesonbuild/compilers/mixins/clang.py @@ -11,8 +11,8 @@ import typing as T from ... import mesonlib from ... import options -from ...linkers.linkers import AppleDynamicLinker, ClangClDynamicLinker, LLVMDynamicLinker, GnuGoldDynamicLinker, \ - MoldDynamicLinker, VisualStudioLikeLinkerMixin +from ...linkers.linkers import AppleDynamicLinker, ClangClDynamicLinker, LLVMDynamicLinker, \ + GnuBFDDynamicLinker, GnuGoldDynamicLinker, MoldDynamicLinker, VisualStudioLikeLinkerMixin from ...options import OptionKey from ..compilers import CompileCheckMode from .gnu import GnuLikeCompiler @@ -219,8 +219,8 @@ class ClangCompiler(GnuLikeCompiler): # https://github.com/rui314/mold/commit/46995bcfc3e3113133620bf16445c5f13cd76a18 if not mesonlib.version_compare(self.linker.version, '>=1.1'): raise mesonlib.MesonException("LLVM's ThinLTO requires mold 1.1+") - elif not isinstance(self.linker, (AppleDynamicLinker, ClangClDynamicLinker, LLVMDynamicLinker, GnuGoldDynamicLinker)): - raise mesonlib.MesonException(f"LLVM's ThinLTO only works with gold, lld, lld-link, ld64 or mold, not {self.linker.id}") + elif not isinstance(self.linker, (AppleDynamicLinker, ClangClDynamicLinker, LLVMDynamicLinker, GnuBFDDynamicLinker, GnuGoldDynamicLinker)): + raise mesonlib.MesonException(f"LLVM's ThinLTO only works with bfd, gold, lld, lld-link, ld64, or mold, not {self.linker.id}") args.append(f'-flto={mode}') else: assert mode == 'default', 'someone forgot to wire something up' |
