]>
Commit | Line | Data |
---|---|---|
0f1e1820 GKH |
1 | From 94cc36b84acc29f543b48bc5ed786011b112a666 Mon Sep 17 00:00:00 2001 |
2 | From: "Maciej W. Rozycki" <macro@imgtec.com> | |
3 | Date: Thu, 26 May 2016 12:55:45 +0100 | |
4 | Subject: MIPS: VDSO: Build with `-fno-strict-aliasing' | |
5 | ||
6 | From: Maciej W. Rozycki <macro@imgtec.com> | |
7 | ||
8 | commit 94cc36b84acc29f543b48bc5ed786011b112a666 upstream. | |
9 | ||
10 | Avoid an aliasing issue causing a build error in VDSO: | |
11 | ||
12 | In 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: | |
20 | include/linux/workqueue.h: In function 'work_static': | |
21 | include/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 | ^ | |
24 | cc1: all warnings being treated as errors | |
25 | make[2]: *** [arch/mips/vdso/gettimeofday.o] Error 1 | |
26 | ||
27 | with a CONFIG_DEBUG_OBJECTS_WORK configuration and GCC 5.2.0. Include | |
28 | `-fno-strict-aliasing' along with compiler options used, as required for | |
29 | kernel code, fixing a problem present since the introduction of VDSO | |
30 | with commit ebb5e78cc634 ("MIPS: Initial implementation of a VDSO"). | |
31 | ||
32 | Thanks to Tejun for diagnosing this properly! | |
33 | ||
34 | Signed-off-by: Maciej W. Rozycki <macro@imgtec.com> | |
35 | Reviewed-by: James Hogan <james.hogan@imgtec.com> | |
36 | Fixes: ebb5e78cc634 ("MIPS: Initial implementation of a VDSO") | |
37 | Cc: Tejun Heo <tj@kernel.org> | |
38 | Cc: linux-mips@linux-mips.org | |
39 | Patchwork: https://patchwork.linux-mips.org/patch/13357/ | |
40 | Signed-off-by: Ralf Baechle <ralf@linux-mips.org> | |
41 | Signed-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)) \ |