From cfec255027ca7c928defcc665a12e91b439c7c3f Mon Sep 17 00:00:00 2001 From: Aditya Vidyadhar Kamath Date: Sun, 29 Oct 2023 23:02:24 -0500 Subject: [PATCH] Fix traceback on AIX in shlib archiving code A compiler may not have a linker: ``` 'NoneType' object has no attribute 'get_command_to_archive_shlib' ``` --- mesonbuild/compilers/compilers.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index fb399b114..a7bb6c417 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -962,6 +962,8 @@ class Compiler(HoldableObject, metaclass=abc.ABCMeta): return self.linker.get_archive_name(filename) def get_command_to_archive_shlib(self) -> T.List[str]: + if not self.linker: + return [] return self.linker.get_command_to_archive_shlib() def thread_flags(self, env: 'Environment') -> T.List[str]: