Skip to content

Commit 18f7958

Browse files
eli-schwartzfreakboy3742
authored andcommitted
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 cece1a7. 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.
1 parent ff91d5c commit 18f7958

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mesonbuild/linkers/linkers.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -897,8 +897,9 @@ class LLVMDynamicLinker(GnuLikeDynamicLinkerMixin, PosixDynamicLinkerMixin, Dyna
897897

898898
def __init__(self, exelist: T.List[str],
899899
for_machine: mesonlib.MachineChoice, prefix_arg: T.Union[str, T.List[str]],
900-
always_args: T.List[str], *, version: str = 'unknown version'):
901-
super().__init__(exelist, for_machine, prefix_arg, always_args, version=version)
900+
always_args: T.List[str], *, system: str = 'unknown system',
901+
version: str = 'unknown version'):
902+
super().__init__(exelist, for_machine, prefix_arg, always_args, system=system, version=version)
902903

903904
# Some targets don't seem to support this argument (windows, wasm, ...)
904905
self.has_allow_shlib_undefined = self._supports_flag('--allow-shlib-undefined', always_args)

0 commit comments

Comments
 (0)