aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/environment.py
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild/environment.py')
-rw-r--r--mesonbuild/environment.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py
index f287cb0..4bf77ac 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: