Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c69c91b5 authored by Yonghong Song's avatar Yonghong Song Committed by Greg Kroah-Hartman
Browse files

selftests: Set CC to clang in lib.mk if LLVM is set



[ Upstream commit 26e6dd1072763cd5696b75994c03982dde952ad9 ]

selftests/bpf/Makefile includes lib.mk. With the following command
  make -j60 LLVM=1 LLVM_IAS=1  <=== compile kernel
  make -j60 -C tools/testing/selftests/bpf LLVM=1 LLVM_IAS=1 V=1
some files are still compiled with gcc. This patch
fixed lib.mk issue which sets CC to gcc in all cases.

Signed-off-by: default avatarYonghong Song <yhs@fb.com>
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
Acked-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20210413153413.3027426-1-yhs@fb.com


Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 874e94e2
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
# This mimics the top-level Makefile. We do it explicitly here so that this
# Makefile can operate with or without the kbuild infrastructure.
ifneq ($(LLVM),)
CC := clang
else
CC := $(CROSS_COMPILE)gcc
endif

define RUN_TESTS
	@for TEST in $(TEST_PROGS); do \