Skip to content

Commit

Permalink
Fix to 'NoneType' object has no attribute 'get_command_to_archive_shlib'
Browse files Browse the repository at this point in the history
  • Loading branch information
KamathForAIX committed Oct 30, 2023
1 parent 2bac266 commit 1563bac
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
18 changes: 9 additions & 9 deletions mesonbuild/backend/ninjabackend.py
Original file line number Diff line number Diff line change
Expand Up @@ -2382,13 +2382,13 @@ def generate_dynamic_link_rules(self):

options = self._rsp_options(compiler)
self.add_rule(NinjaRule(rule, command, args, description, **options, extra=pool))
if self.environment.machines[for_machine].is_aix():
rule = 'AIX_LINKER{}'.format(self.get_rule_suffix(for_machine))
description = 'Archiving AIX shared library'
cmdlist = compiler.get_command_to_archive_shlib()
args = []
options = {}
self.add_rule(NinjaRule(rule, cmdlist, args, description, **options, extra=None))
if self.environment.machines[for_machine].is_aix():
rule = 'AIX_LINKER{}'.format(self.get_rule_suffix(for_machine))
description = 'Archiving AIX shared library'
cmdlist = compiler.get_command_to_archive_shlib()
args = []
options = {}
self.add_rule(NinjaRule(rule, cmdlist, args, description, **options, extra=None))

args = self.environment.get_build_command() + \
['--internal',
Expand Down Expand Up @@ -3695,8 +3695,8 @@ def generate_ending(self) -> None:
# Add the first output of each target to the 'all' target so that
# they are all built
#Add archive file if shared library in AIX for build all.
if self.environment.machines[t.for_machine].is_aix():
if isinstance(t, build.SharedLibrary) and t.aix_so_archive:
if isinstance(t, build.SharedLibrary) and t.aix_so_archive:
if self.environment.machines[t.for_machine].is_aix():
linker, stdlib_args = self.determine_linker_and_stdlib_args(t)
t.get_outputs()[0] = linker.get_archive_name(t.get_outputs()[0])
targetlist.append(os.path.join(self.get_target_dir(t), t.get_outputs()[0]))
Expand Down
2 changes: 2 additions & 0 deletions mesonbuild/compilers/compilers.py
Original file line number Diff line number Diff line change
Expand Up @@ -960,6 +960,8 @@ def get_archive_name(self, filename: str) -> str:
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]:
Expand Down

0 comments on commit 1563bac

Please sign in to comment.