Skip to content

Commit 06b0037

Browse files
yonghong-songgregkh
authored andcommitted
selftests: Set CC to clang in lib.mk if LLVM is set
[ Upstream commit 26e6dd1 ] 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: Yonghong Song <yhs@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20210413153413.3027426-1-yhs@fb.com Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent f9bc5e3 commit 06b0037

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎tools/testing/selftests/lib.mk‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# This mimics the top-level Makefile. We do it explicitly here so that this
22
# Makefile can operate with or without the kbuild infrastructure.
3+
ifneq ($(LLVM),)
4+
CC := clang
5+
else
36
CC := $(CROSS_COMPILE)gcc
7+
endif
48

59
ifeq (0,$(MAKELEVEL))
610
ifeq ($(OUTPUT),)

0 commit comments

Comments
 (0)