]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Jan 2019 18:38:36 +0000 (19:38 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Jan 2019 18:38:36 +0000 (19:38 +0100)
added patches:
kbuild-add-no-integrated-as-clang-option-unconditionally.patch
kbuild-consolidate-clang-compiler-flags.patch
makefile-export-clang-toolchain-variables.patch
powerpc-avoid-mno-sched-epilog-on-gcc-4.9-and-newer.patch
powerpc-boot-set-target-when-cross-compiling-for-clang.patch
powerpc-consolidate-mno-sched-epilog-into-ftrace-flags.patch
powerpc-disable-wbuiltin-requires-header-when-setjmp-is-used.patch
powerpc-remove-old-gcc-version-checks.patch
raid6-ppc-fix-build-for-clang.patch

queue-4.19/kbuild-add-no-integrated-as-clang-option-unconditionally.patch [new file with mode: 0644]
queue-4.19/kbuild-consolidate-clang-compiler-flags.patch [new file with mode: 0644]
queue-4.19/makefile-export-clang-toolchain-variables.patch [new file with mode: 0644]
queue-4.19/powerpc-avoid-mno-sched-epilog-on-gcc-4.9-and-newer.patch [new file with mode: 0644]
queue-4.19/powerpc-boot-set-target-when-cross-compiling-for-clang.patch [new file with mode: 0644]
queue-4.19/powerpc-consolidate-mno-sched-epilog-into-ftrace-flags.patch [new file with mode: 0644]
queue-4.19/powerpc-disable-wbuiltin-requires-header-when-setjmp-is-used.patch [new file with mode: 0644]
queue-4.19/powerpc-remove-old-gcc-version-checks.patch [new file with mode: 0644]
queue-4.19/raid6-ppc-fix-build-for-clang.patch [new file with mode: 0644]
queue-4.19/series

diff --git a/queue-4.19/kbuild-add-no-integrated-as-clang-option-unconditionally.patch b/queue-4.19/kbuild-add-no-integrated-as-clang-option-unconditionally.patch
new file mode 100644 (file)
index 0000000..f716049
--- /dev/null
@@ -0,0 +1,37 @@
+From foo@baz Thu Jan 10 19:31:24 CET 2019
+From: Masahiro Yamada <yamada.masahiro@socionext.com>
+Date: Tue, 6 Nov 2018 12:04:54 +0900
+Subject: kbuild: add -no-integrated-as Clang option unconditionally
+
+From: Masahiro Yamada <yamada.masahiro@socionext.com>
+
+commit dbe27a002ef8573168cb64e181458ea23a74e2b6 upstream.
+
+We are still a way off the Clang's integrated assembler support for
+the kernel. Hence, -no-integrated-as is mandatory to build the kernel
+with Clang. If you had an ancient version of Clang that does not
+recognize this option, you would not be able to compile the kernel
+anyway.
+
+Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
+Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
+Tested-by: Nick Desaulniers <ndesaulniers@google.com>
+Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ Makefile |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/Makefile
++++ b/Makefile
+@@ -492,8 +492,8 @@ CLANG_GCC_TC       := --gcc-toolchain=$(GCC_TO
+ endif
+ KBUILD_CFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) $(CLANG_PREFIX)
+ KBUILD_AFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) $(CLANG_PREFIX)
+-KBUILD_CFLAGS += $(call cc-option, -no-integrated-as)
+-KBUILD_AFLAGS += $(call cc-option, -no-integrated-as)
++KBUILD_CFLAGS += -no-integrated-as
++KBUILD_AFLAGS += -no-integrated-as
+ endif
+ RETPOLINE_CFLAGS_GCC := -mindirect-branch=thunk-extern -mindirect-branch-register
diff --git a/queue-4.19/kbuild-consolidate-clang-compiler-flags.patch b/queue-4.19/kbuild-consolidate-clang-compiler-flags.patch
new file mode 100644 (file)
index 0000000..59ff2dd
--- /dev/null
@@ -0,0 +1,50 @@
+From foo@baz Thu Jan 10 19:31:24 CET 2019
+From: Masahiro Yamada <yamada.masahiro@socionext.com>
+Date: Tue, 6 Nov 2018 12:04:55 +0900
+Subject: kbuild: consolidate Clang compiler flags
+
+From: Masahiro Yamada <yamada.masahiro@socionext.com>
+
+commit 238bcbc4e07fad2fff99c5b157d0c37ccd4d093c upstream.
+
+Collect basic Clang options such as --target, --prefix, --gcc-toolchain,
+-no-integrated-as into a single variable CLANG_FLAGS so that it can be
+easily reused in other parts of Makefile.
+
+Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
+Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
+Tested-by: Nick Desaulniers <ndesaulniers@google.com>
+Acked-by: Greg Hackmann <ghackmann@google.com>
+Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ Makefile |   13 ++++++-------
+ 1 file changed, 6 insertions(+), 7 deletions(-)
+
+--- a/Makefile
++++ b/Makefile
+@@ -482,18 +482,17 @@ endif
+ ifeq ($(cc-name),clang)
+ ifneq ($(CROSS_COMPILE),)
+-CLANG_TARGET  := --target=$(notdir $(CROSS_COMPILE:%-=%))
++CLANG_FLAGS   := --target=$(notdir $(CROSS_COMPILE:%-=%))
+ GCC_TOOLCHAIN_DIR := $(dir $(shell which $(LD)))
+-CLANG_PREFIX  := --prefix=$(GCC_TOOLCHAIN_DIR)
++CLANG_FLAGS   += --prefix=$(GCC_TOOLCHAIN_DIR)
+ GCC_TOOLCHAIN := $(realpath $(GCC_TOOLCHAIN_DIR)/..)
+ endif
+ ifneq ($(GCC_TOOLCHAIN),)
+-CLANG_GCC_TC  := --gcc-toolchain=$(GCC_TOOLCHAIN)
++CLANG_FLAGS   += --gcc-toolchain=$(GCC_TOOLCHAIN)
+ endif
+-KBUILD_CFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) $(CLANG_PREFIX)
+-KBUILD_AFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) $(CLANG_PREFIX)
+-KBUILD_CFLAGS += -no-integrated-as
+-KBUILD_AFLAGS += -no-integrated-as
++CLANG_FLAGS   += -no-integrated-as
++KBUILD_CFLAGS += $(CLANG_FLAGS)
++KBUILD_AFLAGS += $(CLANG_FLAGS)
+ endif
+ RETPOLINE_CFLAGS_GCC := -mindirect-branch=thunk-extern -mindirect-branch-register
diff --git a/queue-4.19/makefile-export-clang-toolchain-variables.patch b/queue-4.19/makefile-export-clang-toolchain-variables.patch
new file mode 100644 (file)
index 0000000..e39b729
--- /dev/null
@@ -0,0 +1,29 @@
+From foo@baz Thu Jan 10 19:31:24 CET 2019
+From: Joel Stanley <joel@jms.id.au>
+Date: Mon, 12 Nov 2018 14:51:15 +1030
+Subject: Makefile: Export clang toolchain variables
+
+From: Joel Stanley <joel@jms.id.au>
+
+commit 3bd9805090af843b25f97ffe5049f20ade1d86d6 upstream.
+
+The powerpc makefile will use these in it's boot wrapper.
+
+Signed-off-by: Joel Stanley <joel@jms.id.au>
+Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
+Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ Makefile |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/Makefile
++++ b/Makefile
+@@ -493,6 +493,7 @@ endif
+ CLANG_FLAGS   += -no-integrated-as
+ KBUILD_CFLAGS += $(CLANG_FLAGS)
+ KBUILD_AFLAGS += $(CLANG_FLAGS)
++export CLANG_FLAGS
+ endif
+ RETPOLINE_CFLAGS_GCC := -mindirect-branch=thunk-extern -mindirect-branch-register
diff --git a/queue-4.19/powerpc-avoid-mno-sched-epilog-on-gcc-4.9-and-newer.patch b/queue-4.19/powerpc-avoid-mno-sched-epilog-on-gcc-4.9-and-newer.patch
new file mode 100644 (file)
index 0000000..6ccdb55
--- /dev/null
@@ -0,0 +1,35 @@
+From foo@baz Thu Jan 10 19:31:24 CET 2019
+From: Nicholas Piggin <npiggin@gmail.com>
+Date: Fri, 14 Sep 2018 15:08:54 +1000
+Subject: powerpc: avoid -mno-sched-epilog on GCC 4.9 and newer
+
+From: Nicholas Piggin <npiggin@gmail.com>
+
+commit 6977f95e63b9b3fb4a5973481a800dd9f48a1338 upstream.
+
+Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
+Reviewed-by: Joel Stanley <joel@jms.id.au>
+Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
+Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/powerpc/Makefile |    8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+--- a/arch/powerpc/Makefile
++++ b/arch/powerpc/Makefile
+@@ -165,8 +165,12 @@ CC_FLAGS_FTRACE := -pg
+ ifdef CONFIG_MPROFILE_KERNEL
+ CC_FLAGS_FTRACE += -mprofile-kernel
+ endif
+-# Work around a gcc code-gen bug with -fno-omit-frame-pointer.
+-CC_FLAGS_FTRACE       += -mno-sched-epilog
++# Work around gcc code-gen bugs with -pg / -fno-omit-frame-pointer in gcc <= 4.8
++# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44199
++# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52828
++ifneq ($(cc-name),clang)
++CC_FLAGS_FTRACE       += $(call cc-ifversion, -lt, 0409, -mno-sched-epilog)
++endif
+ endif
+ CFLAGS-$(CONFIG_TARGET_CPU_BOOL) += $(call cc-option,-mcpu=$(CONFIG_TARGET_CPU))
diff --git a/queue-4.19/powerpc-boot-set-target-when-cross-compiling-for-clang.patch b/queue-4.19/powerpc-boot-set-target-when-cross-compiling-for-clang.patch
new file mode 100644 (file)
index 0000000..04c114f
--- /dev/null
@@ -0,0 +1,38 @@
+From foo@baz Thu Jan 10 19:31:24 CET 2019
+From: Joel Stanley <joel@jms.id.au>
+Date: Mon, 12 Nov 2018 14:51:16 +1030
+Subject: powerpc/boot: Set target when cross-compiling for clang
+
+From: Joel Stanley <joel@jms.id.au>
+
+commit 813af51f5d30a2da6a2523c08465f9726e51772e upstream.
+
+Clang needs to be told which target it is building for when cross
+compiling.
+
+Link: https://github.com/ClangBuiltLinux/linux/issues/259
+Signed-off-by: Joel Stanley <joel@jms.id.au>
+Tested-by: Daniel Axtens <dja@axtens.net> # powerpc 64-bit BE
+Acked-by: Michael Ellerman <mpe@ellerman.id.au>
+Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
+Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
+Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/powerpc/boot/Makefile |    5 +++++
+ 1 file changed, 5 insertions(+)
+
+--- a/arch/powerpc/boot/Makefile
++++ b/arch/powerpc/boot/Makefile
+@@ -55,6 +55,11 @@ BOOTAFLAGS  := -D__ASSEMBLY__ $(BOOTCFLAG
+ BOOTARFLAGS   := -cr$(KBUILD_ARFLAGS)
++ifdef CONFIG_CC_IS_CLANG
++BOOTCFLAGS += $(CLANG_FLAGS)
++BOOTAFLAGS += $(CLANG_FLAGS)
++endif
++
+ ifdef CONFIG_DEBUG_INFO
+ BOOTCFLAGS    += -g
+ endif
diff --git a/queue-4.19/powerpc-consolidate-mno-sched-epilog-into-ftrace-flags.patch b/queue-4.19/powerpc-consolidate-mno-sched-epilog-into-ftrace-flags.patch
new file mode 100644 (file)
index 0000000..f7e82bf
--- /dev/null
@@ -0,0 +1,101 @@
+From foo@baz Thu Jan 10 19:31:24 CET 2019
+From: Nicholas Piggin <npiggin@gmail.com>
+Date: Fri, 14 Sep 2018 15:08:53 +1000
+Subject: powerpc: consolidate -mno-sched-epilog into FTRACE flags
+
+From: Nicholas Piggin <npiggin@gmail.com>
+
+commit 2a056f58fd33ccc6a0261b552b0f17e7fa4a12f3 upstream.
+
+Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
+Reviewed-by: Joel Stanley <joel@jms.id.au>
+Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
+Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/powerpc/Makefile                    |   12 ++++++------
+ arch/powerpc/kernel/Makefile             |    8 ++++----
+ arch/powerpc/kernel/trace/Makefile       |    2 +-
+ arch/powerpc/platforms/powermac/Makefile |    2 +-
+ arch/powerpc/xmon/Makefile               |    2 +-
+ 5 files changed, 13 insertions(+), 13 deletions(-)
+
+--- a/arch/powerpc/Makefile
++++ b/arch/powerpc/Makefile
+@@ -160,8 +160,13 @@ else
+ CFLAGS-$(CONFIG_GENERIC_CPU) += -mcpu=powerpc64
+ endif
++ifdef CONFIG_FUNCTION_TRACER
++CC_FLAGS_FTRACE := -pg
+ ifdef CONFIG_MPROFILE_KERNEL
+-      CC_FLAGS_FTRACE := -pg -mprofile-kernel
++CC_FLAGS_FTRACE += -mprofile-kernel
++endif
++# Work around a gcc code-gen bug with -fno-omit-frame-pointer.
++CC_FLAGS_FTRACE       += -mno-sched-epilog
+ endif
+ CFLAGS-$(CONFIG_TARGET_CPU_BOOL) += $(call cc-option,-mcpu=$(CONFIG_TARGET_CPU))
+@@ -229,11 +234,6 @@ ifdef CONFIG_6xx
+ KBUILD_CFLAGS         += -mcpu=powerpc
+ endif
+-# Work around a gcc code-gen bug with -fno-omit-frame-pointer.
+-ifdef CONFIG_FUNCTION_TRACER
+-KBUILD_CFLAGS         += -mno-sched-epilog
+-endif
+-
+ cpu-as-$(CONFIG_4xx)          += -Wa,-m405
+ cpu-as-$(CONFIG_ALTIVEC)      += $(call as-option,-Wa$(comma)-maltivec)
+ cpu-as-$(CONFIG_E200)         += -Wa,-me200
+--- a/arch/powerpc/kernel/Makefile
++++ b/arch/powerpc/kernel/Makefile
+@@ -22,10 +22,10 @@ CFLAGS_prom.o += $(DISABLE_LATENT_ENTROP
+ ifdef CONFIG_FUNCTION_TRACER
+ # Do not trace early boot code
+-CFLAGS_REMOVE_cputable.o = -mno-sched-epilog $(CC_FLAGS_FTRACE)
+-CFLAGS_REMOVE_prom_init.o = -mno-sched-epilog $(CC_FLAGS_FTRACE)
+-CFLAGS_REMOVE_btext.o = -mno-sched-epilog $(CC_FLAGS_FTRACE)
+-CFLAGS_REMOVE_prom.o = -mno-sched-epilog $(CC_FLAGS_FTRACE)
++CFLAGS_REMOVE_cputable.o = $(CC_FLAGS_FTRACE)
++CFLAGS_REMOVE_prom_init.o = $(CC_FLAGS_FTRACE)
++CFLAGS_REMOVE_btext.o = $(CC_FLAGS_FTRACE)
++CFLAGS_REMOVE_prom.o = $(CC_FLAGS_FTRACE)
+ endif
+ obj-y                         := cputable.o ptrace.o syscalls.o \
+--- a/arch/powerpc/kernel/trace/Makefile
++++ b/arch/powerpc/kernel/trace/Makefile
+@@ -7,7 +7,7 @@ subdir-ccflags-$(CONFIG_PPC_WERROR)    := -
+ ifdef CONFIG_FUNCTION_TRACER
+ # do not trace tracer code
+-CFLAGS_REMOVE_ftrace.o = -mno-sched-epilog $(CC_FLAGS_FTRACE)
++CFLAGS_REMOVE_ftrace.o = $(CC_FLAGS_FTRACE)
+ endif
+ obj32-$(CONFIG_FUNCTION_TRACER)               += ftrace_32.o
+--- a/arch/powerpc/platforms/powermac/Makefile
++++ b/arch/powerpc/platforms/powermac/Makefile
+@@ -3,7 +3,7 @@ CFLAGS_bootx_init.o            += -fPIC
+ ifdef CONFIG_FUNCTION_TRACER
+ # Do not trace early boot code
+-CFLAGS_REMOVE_bootx_init.o = -mno-sched-epilog $(CC_FLAGS_FTRACE)
++CFLAGS_REMOVE_bootx_init.o = $(CC_FLAGS_FTRACE)
+ endif
+ obj-y                         += pic.o setup.o time.o feature.o pci.o \
+--- a/arch/powerpc/xmon/Makefile
++++ b/arch/powerpc/xmon/Makefile
+@@ -8,7 +8,7 @@ UBSAN_SANITIZE := n
+ # Disable ftrace for the entire directory
+ ORIG_CFLAGS := $(KBUILD_CFLAGS)
+-KBUILD_CFLAGS = $(subst -mno-sched-epilog,,$(subst $(CC_FLAGS_FTRACE),,$(ORIG_CFLAGS)))
++KBUILD_CFLAGS = $(subst $(CC_FLAGS_FTRACE),,$(ORIG_CFLAGS))
+ ccflags-$(CONFIG_PPC64) := $(NO_MINIMAL_TOC)
diff --git a/queue-4.19/powerpc-disable-wbuiltin-requires-header-when-setjmp-is-used.patch b/queue-4.19/powerpc-disable-wbuiltin-requires-header-when-setjmp-is-used.patch
new file mode 100644 (file)
index 0000000..3a8bb0f
--- /dev/null
@@ -0,0 +1,65 @@
+From foo@baz Thu Jan 10 19:31:24 CET 2019
+From: Joel Stanley <joel@jms.id.au>
+Date: Mon, 17 Sep 2018 17:16:21 +0930
+Subject: powerpc: Disable -Wbuiltin-requires-header when setjmp is used
+
+From: Joel Stanley <joel@jms.id.au>
+
+commit aea447141c7e7824b81b49acd1bc785506fba46e upstream.
+
+The powerpc kernel uses setjmp which causes a warning when building
+with clang:
+
+  In file included from arch/powerpc/xmon/xmon.c:51:
+  ./arch/powerpc/include/asm/setjmp.h:15:13: error: declaration of
+  built-in function 'setjmp' requires inclusion of the header <setjmp.h>
+        [-Werror,-Wbuiltin-requires-header]
+  extern long setjmp(long *);
+              ^
+  ./arch/powerpc/include/asm/setjmp.h:16:13: error: declaration of
+  built-in function 'longjmp' requires inclusion of the header <setjmp.h>
+        [-Werror,-Wbuiltin-requires-header]
+  extern void longjmp(long *, long);
+              ^
+
+This *is* the header and we're not using the built-in setjump but
+rather the one in arch/powerpc/kernel/misc.S. As the compiler warning
+does not make sense, it for the files where setjmp is used.
+
+Signed-off-by: Joel Stanley <joel@jms.id.au>
+Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
+[mpe: Move subdir-ccflags in xmon/Makefile to not clobber -Werror]
+Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
+Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/powerpc/kernel/Makefile |    3 +++
+ arch/powerpc/xmon/Makefile   |    5 ++++-
+ 2 files changed, 7 insertions(+), 1 deletion(-)
+
+--- a/arch/powerpc/kernel/Makefile
++++ b/arch/powerpc/kernel/Makefile
+@@ -5,6 +5,9 @@
+ CFLAGS_ptrace.o               += -DUTS_MACHINE='"$(UTS_MACHINE)"'
++# Disable clang warning for using setjmp without setjmp.h header
++CFLAGS_crash.o                += $(call cc-disable-warning, builtin-requires-header)
++
+ subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror
+ ifdef CONFIG_PPC64
+--- a/arch/powerpc/xmon/Makefile
++++ b/arch/powerpc/xmon/Makefile
+@@ -1,7 +1,10 @@
+ # SPDX-License-Identifier: GPL-2.0
+ # Makefile for xmon
+-subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror
++# Disable clang warning for using setjmp without setjmp.h header
++subdir-ccflags-y := $(call cc-disable-warning, builtin-requires-header)
++
++subdir-ccflags-$(CONFIG_PPC_WERROR) += -Werror
+ GCOV_PROFILE := n
+ UBSAN_SANITIZE := n
diff --git a/queue-4.19/powerpc-remove-old-gcc-version-checks.patch b/queue-4.19/powerpc-remove-old-gcc-version-checks.patch
new file mode 100644 (file)
index 0000000..9cb539f
--- /dev/null
@@ -0,0 +1,62 @@
+From foo@baz Thu Jan 10 19:31:24 CET 2019
+From: Nicholas Piggin <npiggin@gmail.com>
+Date: Fri, 14 Sep 2018 15:08:52 +1000
+Subject: powerpc: remove old GCC version checks
+
+From: Nicholas Piggin <npiggin@gmail.com>
+
+commit f2910f0e6835339e6ce82cef22fa15718b7e3bfa upstream.
+
+GCC 4.6 is the minimum supported now.
+
+Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
+Reviewed-by: Joel Stanley <joel@jms.id.au>
+Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
+[nc: Applied to minimize unnecessary conflicts]
+Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/powerpc/Makefile |   31 ++-----------------------------
+ 1 file changed, 2 insertions(+), 29 deletions(-)
+
+--- a/arch/powerpc/Makefile
++++ b/arch/powerpc/Makefile
+@@ -408,36 +408,9 @@ archprepare: checkbin
+ # to stdout and these checks are run even on install targets.
+ TOUT  := .tmp_gas_check
+-# Check gcc and binutils versions:
+-# - gcc-3.4 and binutils-2.14 are a fatal combination
+-# - Require gcc 4.0 or above on 64-bit
+-# - gcc-4.2.0 has issues compiling modules on 64-bit
++# Check toolchain versions:
++# - gcc-4.6 is the minimum kernel-wide version so nothing required.
+ checkbin:
+-      @if test "$(cc-name)" != "clang" \
+-          && test "$(cc-version)" = "0304" ; then \
+-              if ! /bin/echo mftb 5 | $(AS) -v -mppc -many -o $(TOUT) >/dev/null 2>&1 ; then \
+-                      echo -n '*** ${VERSION}.${PATCHLEVEL} kernels no longer build '; \
+-                      echo 'correctly with gcc-3.4 and your version of binutils.'; \
+-                      echo '*** Please upgrade your binutils or downgrade your gcc'; \
+-                      false; \
+-              fi ; \
+-      fi
+-      @if test "$(cc-name)" != "clang" \
+-          && test "$(cc-version)" -lt "0400" \
+-          && test "x${CONFIG_PPC64}" = "xy" ; then \
+-                echo -n "Sorry, GCC v4.0 or above is required to build " ; \
+-                echo "the 64-bit powerpc kernel." ; \
+-                false ; \
+-        fi
+-      @if test "$(cc-name)" != "clang" \
+-          && test "$(cc-fullversion)" = "040200" \
+-          && test "x${CONFIG_MODULES}${CONFIG_PPC64}" = "xyy" ; then \
+-              echo -n '*** GCC-4.2.0 cannot compile the 64-bit powerpc ' ; \
+-              echo 'kernel with modules enabled.' ; \
+-              echo -n '*** Please use a different GCC version or ' ; \
+-              echo 'disable kernel modules' ; \
+-              false ; \
+-      fi
+       @if test "x${CONFIG_CPU_LITTLE_ENDIAN}" = "xy" \
+           && $(LD) --version | head -1 | grep ' 2\.24$$' >/dev/null ; then \
+               echo -n '*** binutils 2.24 miscompiles weak symbols ' ; \
diff --git a/queue-4.19/raid6-ppc-fix-build-for-clang.patch b/queue-4.19/raid6-ppc-fix-build-for-clang.patch
new file mode 100644 (file)
index 0000000..d647cde
--- /dev/null
@@ -0,0 +1,59 @@
+From foo@baz Thu Jan 10 19:31:24 CET 2019
+From: Joel Stanley <joel@jms.id.au>
+Date: Fri, 2 Nov 2018 11:14:55 +1030
+Subject: raid6/ppc: Fix build for clang
+
+From: Joel Stanley <joel@jms.id.au>
+
+commit e213574a449f7a57d4202c1869bbc7680b6b5521 upstream.
+
+We cannot build these files with clang as it does not allow altivec
+instructions in assembly when -msoft-float is passed.
+
+Jinsong Ji <jji@us.ibm.com> wrote:
+> We currently disable Altivec/VSX support when enabling soft-float.  So
+> any usage of vector builtins will break.
+>
+> Enable Altivec/VSX with soft-float may need quite some clean up work, so
+> I guess this is currently a limitation.
+>
+> Removing -msoft-float will make it work (and we are lucky that no
+> floating point instructions will be generated as well).
+
+This is a workaround until the issue is resolved in clang.
+
+Link: https://bugs.llvm.org/show_bug.cgi?id=31177
+Link: https://github.com/ClangBuiltLinux/linux/issues/239
+Signed-off-by: Joel Stanley <joel@jms.id.au>
+Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
+Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
+Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ lib/raid6/Makefile |   15 +++++++++++++++
+ 1 file changed, 15 insertions(+)
+
+--- a/lib/raid6/Makefile
++++ b/lib/raid6/Makefile
+@@ -18,6 +18,21 @@ quiet_cmd_unroll = UNROLL  $@
+ ifeq ($(CONFIG_ALTIVEC),y)
+ altivec_flags := -maltivec $(call cc-option,-mabi=altivec)
++
++ifdef CONFIG_CC_IS_CLANG
++# clang ppc port does not yet support -maltivec when -msoft-float is
++# enabled. A future release of clang will resolve this
++# https://bugs.llvm.org/show_bug.cgi?id=31177
++CFLAGS_REMOVE_altivec1.o  += -msoft-float
++CFLAGS_REMOVE_altivec2.o  += -msoft-float
++CFLAGS_REMOVE_altivec4.o  += -msoft-float
++CFLAGS_REMOVE_altivec8.o  += -msoft-float
++CFLAGS_REMOVE_altivec8.o  += -msoft-float
++CFLAGS_REMOVE_vpermxor1.o += -msoft-float
++CFLAGS_REMOVE_vpermxor2.o += -msoft-float
++CFLAGS_REMOVE_vpermxor4.o += -msoft-float
++CFLAGS_REMOVE_vpermxor8.o += -msoft-float
++endif
+ endif
+ # The GCC option -ffreestanding is required in order to compile code containing
index 14bfe4965dde53c428c6c3f3669d2a8c217b6817..8a1c3afad3bad93c30d22bbd51020dce293f0a04 100644 (file)
@@ -89,3 +89,12 @@ mm-swap-fix-swapoff-with-ksm-pages.patch
 memcg-oom-notify-on-oom-killer-invocation-from-the-charge-path.patch
 sunrpc-fix-cache_head-leak-due-to-queued-request.patch
 sunrpc-use-svc_net-in-svcauth_gss_-functions.patch
+powerpc-remove-old-gcc-version-checks.patch
+powerpc-consolidate-mno-sched-epilog-into-ftrace-flags.patch
+powerpc-avoid-mno-sched-epilog-on-gcc-4.9-and-newer.patch
+powerpc-disable-wbuiltin-requires-header-when-setjmp-is-used.patch
+kbuild-add-no-integrated-as-clang-option-unconditionally.patch
+kbuild-consolidate-clang-compiler-flags.patch
+makefile-export-clang-toolchain-variables.patch
+powerpc-boot-set-target-when-cross-compiling-for-clang.patch
+raid6-ppc-fix-build-for-clang.patch