From 944456b5f9b4428853f231368e2baea979042c46 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Wed, 16 Apr 2025 16:50:46 -0400 Subject: [PATCH] linkers: fix regression when using lld after iOS changes ``` $ LDFLAGS="-fuse-ld=lld" meson setup builddir/ [...] linker = lld_cls( compiler, for_machine, comp_class.LINKER_PREFIX, override, system=system, version=v) TypeError: LLVMDynamicLinker.__init__() got an unexpected keyword argument 'system' ``` Fixes regression in commit cece1a7e9992a3bbcc35f90777ba22ba9d62b538. We pass system=system to the linker construction, which worked fine for Apple LLVM LD64 as that inherited `__init__` from DynamicLinker. But non-Apple LLD had an overridden `__init__` which wasn't adapted. Even if it is thrown away and never used, since LLVM isn't an Apple linker, we still need to obey the argument contract. --- mesonbuild/linkers/linkers.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mesonbuild/linkers/linkers.py b/mesonbuild/linkers/linkers.py index 617d4ad3cf87bfddc2e07a1de5e777822bf0ea7e..59f60e03a19c8e89bafbdc675f73777d2a6af5c7 100644 --- a/mesonbuild/linkers/linkers.py +++ b/mesonbuild/linkers/linkers.py @@ -945,8 +945,9 @@ class LLVMDynamicLinker(GnuLikeDynamicLinkerMixin, PosixDynamicLinkerMixin, Dyna def __init__(self, exelist: T.List[str], for_machine: mesonlib.MachineChoice, prefix_arg: T.Union[str, T.List[str]], - always_args: T.List[str], *, version: str = 'unknown version'): - super().__init__(exelist, for_machine, prefix_arg, always_args, version=version) + always_args: T.List[str], *, system: str = 'unknown system', + version: str = 'unknown version'): + super().__init__(exelist, for_machine, prefix_arg, always_args, system=system, version=version) # Some targets don't seem to support this argument (windows, wasm, ...) self.has_allow_shlib_undefined = self._supports_flag('--allow-shlib-undefined', always_args)