]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.5.7/mips-vdso-build-with-fno-strict-aliasing.patch
Linux 4.14.95
[thirdparty/kernel/stable-queue.git] / releases / 4.5.7 / mips-vdso-build-with-fno-strict-aliasing.patch
CommitLineData
0f1e1820
GKH
1From 94cc36b84acc29f543b48bc5ed786011b112a666 Mon Sep 17 00:00:00 2001
2From: "Maciej W. Rozycki" <macro@imgtec.com>
3Date: Thu, 26 May 2016 12:55:45 +0100
4Subject: MIPS: VDSO: Build with `-fno-strict-aliasing'
5
6From: Maciej W. Rozycki <macro@imgtec.com>
7
8commit 94cc36b84acc29f543b48bc5ed786011b112a666 upstream.
9
10Avoid an aliasing issue causing a build error in VDSO:
11
12In file included from include/linux/srcu.h:34:0,
13 from include/linux/notifier.h:15,
14 from ./arch/mips/include/asm/uprobes.h:9,
15 from include/linux/uprobes.h:61,
16 from include/linux/mm_types.h:13,
17 from ./arch/mips/include/asm/vdso.h:14,
18 from arch/mips/vdso/vdso.h:27,
19 from arch/mips/vdso/gettimeofday.c:11:
20include/linux/workqueue.h: In function 'work_static':
21include/linux/workqueue.h:186:2: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
22 return *work_data_bits(work) & WORK_STRUCT_STATIC;
23 ^
24cc1: all warnings being treated as errors
25make[2]: *** [arch/mips/vdso/gettimeofday.o] Error 1
26
27with a CONFIG_DEBUG_OBJECTS_WORK configuration and GCC 5.2.0. Include
28`-fno-strict-aliasing' along with compiler options used, as required for
29kernel code, fixing a problem present since the introduction of VDSO
30with commit ebb5e78cc634 ("MIPS: Initial implementation of a VDSO").
31
32Thanks to Tejun for diagnosing this properly!
33
34Signed-off-by: Maciej W. Rozycki <macro@imgtec.com>
35Reviewed-by: James Hogan <james.hogan@imgtec.com>
36Fixes: ebb5e78cc634 ("MIPS: Initial implementation of a VDSO")
37Cc: Tejun Heo <tj@kernel.org>
38Cc: linux-mips@linux-mips.org
39Patchwork: https://patchwork.linux-mips.org/patch/13357/
40Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
41Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
42
43---
44 arch/mips/vdso/Makefile | 3 ++-
45 1 file changed, 2 insertions(+), 1 deletion(-)
46
47--- a/arch/mips/vdso/Makefile
48+++ b/arch/mips/vdso/Makefile
49@@ -9,7 +9,8 @@ ccflags-vdso := \
50 $(filter -march=%,$(KBUILD_CFLAGS))
51 cflags-vdso := $(ccflags-vdso) \
52 $(filter -W%,$(filter-out -Wa$(comma)%,$(KBUILD_CFLAGS))) \
53- -O2 -g -fPIC -fno-common -fno-builtin -G 0 -DDISABLE_BRANCH_PROFILING \
54+ -O2 -g -fPIC -fno-strict-aliasing -fno-common -fno-builtin -G 0 \
55+ -DDISABLE_BRANCH_PROFILING \
56 $(call cc-option, -fno-stack-protector)
57 aflags-vdso := $(ccflags-vdso) \
58 $(filter -I%,$(KBUILD_CFLAGS)) \