Merge "fix(build): don't rely on that gcc-ar is in the same directory as gcc" into integration
diff --git a/make_helpers/toolchain.mk b/make_helpers/toolchain.mk
index 7255509..def6653 100644
--- a/make_helpers/toolchain.mk
+++ b/make_helpers/toolchain.mk
@@ -290,7 +290,7 @@
 guess-gnu-gcc-ld = $(if $(filter 1,$(ENABLE_LTO)),$(1),$(shell $(1) --print-prog-name ld.bfd 2>$(nul)))
 guess-gnu-gcc-oc = $(shell $(1) --print-prog-name objcopy 2>$(nul))
 guess-gnu-gcc-od = $(shell $(1) --print-prog-name objdump 2>$(nul))
-guess-gnu-gcc-ar = $(patsubst %$(notdir $(1)),%$(subst gcc,gcc-ar,$(notdir $(1))),$(1))
+guess-gnu-gcc-ar = $(call which,$(patsubst %$(notdir $(1)),%$(subst gcc,gcc-ar,$(notdir $(1))),$(1)))
 
 define locate-toolchain-tool-cc
         $(eval toolchain := $(1))