summaryrefslogtreecommitdiff
path: root/core/host/toolchain.mk
diff options
context:
space:
mode:
Diffstat (limited to 'core/host/toolchain.mk')
-rw-r--r--core/host/toolchain.mk4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/host/toolchain.mk b/core/host/toolchain.mk
index 168d0e24c2..c0e4d90d43 100644
--- a/core/host/toolchain.mk
+++ b/core/host/toolchain.mk
@@ -2,7 +2,9 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-CROSS_COMPILE_HOST_DEFAULT:=x86_64-pc-linux-gnu-
+CROSS_COMPILE_HOST_DEFAULT:=$(if \
+ $(shell which x86_64-pc-linux-gnu-$(cc-name) 2>/dev/null), \
+ x86_64-pc-linux-gnu-,)
$(call set-option,CROSS_COMPILE,\
$(CROSS_COMPILE_host),\