summaryrefslogtreecommitdiff
path: root/tools/scripts
diff options
context:
space:
mode:
authorJean-Philippe Brucker <jean-philippe@linaro.org>2020-11-10 19:43:05 +0300
committerAndrii Nakryiko <andrii@kernel.org>2020-11-11 23:18:22 +0300
commitc8a950d0d3b926a02c7b2e713850d38217cec3d1 (patch)
tree92ccac74b4a9b1bd882a570f2a867908d2e66b50 /tools/scripts
parent7112d127984bd7b0c8ded7973b358829f16735f5 (diff)
downloadlinux-c8a950d0d3b926a02c7b2e713850d38217cec3d1.tar.xz
tools: Factor HOSTCC, HOSTLD, HOSTAR definitions
Several Makefiles in tools/ need to define the host toolchain variables. Move their definition to tools/scripts/Makefile.include Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Acked-by: Jiri Olsa <jolsa@redhat.com> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://lore.kernel.org/bpf/20201110164310.2600671-2-jean-philippe@linaro.org
Diffstat (limited to 'tools/scripts')
-rw-r--r--tools/scripts/Makefile.include10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/scripts/Makefile.include b/tools/scripts/Makefile.include
index a7974638561c..1358e89cdf7d 100644
--- a/tools/scripts/Makefile.include
+++ b/tools/scripts/Makefile.include
@@ -59,6 +59,16 @@ $(call allow-override,LD,$(CROSS_COMPILE)ld)
$(call allow-override,CXX,$(CROSS_COMPILE)g++)
$(call allow-override,STRIP,$(CROSS_COMPILE)strip)
+ifneq ($(LLVM),)
+HOSTAR ?= llvm-ar
+HOSTCC ?= clang
+HOSTLD ?= ld.lld
+else
+HOSTAR ?= ar
+HOSTCC ?= gcc
+HOSTLD ?= ld
+endif
+
ifeq ($(CC_NO_CLANG), 1)
EXTRA_WARNINGS += -Wstrict-aliasing=3
endif