From 8165fa6ad0ffee11d0342b724331ace0a6f49773 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Wed, 9 Jan 2019 15:54:07 -0500 Subject: [PATCH] Fix finding the static linker for native compiler in cross build Native ar and cross ar are not the same! --- mesonbuild/environment.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py index f287cb0df..4bf77acb5 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.py @@ -1023,7 +1023,8 @@ class Environment: return comp, cross_comp def detect_static_linker(self, compiler): - linker = self.binaries.host.lookup_entry('ar') + for_machine = MachineChoice.HOST if compiler.is_cross else MachineChoice.BUILD + linker = self.binaries[for_machine].lookup_entry('ar') if linker is not None: linkers = [linker] else: