tools: Allow proper CC/CXX/... override with LLVM=1 in Makefile.include
authorYonghong Song <yhs@fb.com>
Tue, 13 Apr 2021 15:34:19 +0000 (08:34 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Jul 2021 06:16:10 +0000 (08:16 +0200)
commit475312897ea6b4b9a9a56c838aec6370c42f7315
tree2a1f2c322a41a2bfb644f259bf4da45e04c7c25f
parent08277b9dde633e1447e96b8cb89da2b40f96ae69
tools: Allow proper CC/CXX/... override with LLVM=1 in Makefile.include

commit f62700ce63a315b4607cc9e97aa15ea409a677b9 upstream.

selftests/bpf/Makefile includes tools/scripts/Makefile.include.
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 the case if CC/AR/LD/CXX/STRIP is allowed to be
overridden, it will be written to clang/llvm-ar/..., instead of
gcc binaries. The definition of CC_NO_CLANG is also relocated
to the place after the above CC is defined.

Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20210413153419.3028165-1-yhs@fb.com
Cc: Anders Roxell <anders.roxell@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/scripts/Makefile.include