selftests: Set CC to clang in lib.mk if LLVM is set
authorYonghong Song <yhs@fb.com>
Tue, 13 Apr 2021 15:34:13 +0000 (08:34 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 May 2021 08:29:33 +0000 (10:29 +0200)
commit93fe169efd1713cbc118d4053ddb70869d0c8da7
tree87a98a6910ad0c5c7939a79403f00b765646dafa
parenteea094b1d1d96579f9790b9d1aca33d567244d8f
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: 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>
tools/testing/selftests/lib.mk