]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Jul 2021 16:17:30 +0000 (18:17 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Jul 2021 16:17:30 +0000 (18:17 +0200)
added patches:
tools-allow-proper-cc-cxx-...-override-with-llvm-1-in-makefile.include.patch

queue-5.10/tools-allow-proper-cc-cxx-...-override-with-llvm-1-in-makefile.include.patch [new file with mode: 0644]

diff --git a/queue-5.10/tools-allow-proper-cc-cxx-...-override-with-llvm-1-in-makefile.include.patch b/queue-5.10/tools-allow-proper-cc-cxx-...-override-with-llvm-1-in-makefile.include.patch
new file mode 100644 (file)
index 0000000..030ee3b
--- /dev/null
@@ -0,0 +1,62 @@
+From f62700ce63a315b4607cc9e97aa15ea409a677b9 Mon Sep 17 00:00:00 2001
+From: Yonghong Song <yhs@fb.com>
+Date: Tue, 13 Apr 2021 08:34:19 -0700
+Subject: tools: Allow proper CC/CXX/... override with LLVM=1 in Makefile.include
+
+From: Yonghong Song <yhs@fb.com>
+
+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 |   12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+--- a/tools/scripts/Makefile.include
++++ b/tools/scripts/Makefile.include
+@@ -39,8 +39,6 @@ EXTRA_WARNINGS += -Wundef
+ EXTRA_WARNINGS += -Wwrite-strings
+ EXTRA_WARNINGS += -Wformat
+-CC_NO_CLANG := $(shell $(CC) -dM -E -x c /dev/null | grep -Fq "__clang__"; echo $$?)
+-
+ # Makefiles suck: This macro sets a default value of $(2) for the
+ # variable named by $(1), unless the variable has been set by
+ # environment or command line. This is necessary for CC and AR
+@@ -52,12 +50,22 @@ define allow-override
+     $(eval $(1) = $(2)))
+ endef
++ifneq ($(LLVM),)
++$(call allow-override,CC,clang)
++$(call allow-override,AR,llvm-ar)
++$(call allow-override,LD,ld.lld)
++$(call allow-override,CXX,clang++)
++$(call allow-override,STRIP,llvm-strip)
++else
+ # Allow setting various cross-compile vars or setting CROSS_COMPILE as a prefix.
+ $(call allow-override,CC,$(CROSS_COMPILE)gcc)
+ $(call allow-override,AR,$(CROSS_COMPILE)ar)
+ $(call allow-override,LD,$(CROSS_COMPILE)ld)
+ $(call allow-override,CXX,$(CROSS_COMPILE)g++)
+ $(call allow-override,STRIP,$(CROSS_COMPILE)strip)
++endif
++
++CC_NO_CLANG := $(shell $(CC) -dM -E -x c /dev/null | grep -Fq "__clang__"; echo $$?)
+ ifneq ($(LLVM),)
+ HOSTAR  ?= llvm-ar