
From: Jean-Philippe Brucker <jean-philippe@linaro.org> mainline inclusion from mainline-5.11-rc1 commit c8a950d0d3b926a02c7b2e713850d38217cec3d1 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I5EUVD CVE: NA Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?i... ------------------------------------------------- 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.or... (cherry picked from commit c8a950d0d3b926a02c7b2e713850d38217cec3d1) Signed-off-by: Wang Yufen <wangyufen@huawei.com> --- tools/scripts/Makefile.include | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tools/scripts/Makefile.include b/tools/scripts/Makefile.include index a3f99ef6b11b..865e21d4cc12 100644 --- a/tools/scripts/Makefile.include +++ b/tools/scripts/Makefile.include @@ -77,6 +77,16 @@ HOSTCC ?= gcc HOSTLD ?= ld endif +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 -- 2.20.1