Skip to content

Commit ba55bd7

Browse files
mpeozbenh
authored andcommitted
powerpc: Add configurable -Werror for arch/powerpc
Add the option to build the code under arch/powerpc with -Werror. The intention is to make it harder for people to inadvertantly introduce warnings in the arch/powerpc code. It needs to be configurable so that if a warning is introduced, people can easily work around it while it's being fixed. The option is a negative, ie. don't enable -Werror, so that it will be turned on for allyes and allmodconfig builds. The default is n, in the hope that developers will build with -Werror, that will probably lead to some build breaks, I am prepared to be flamed. It's not enabled for math-emu, which is a steaming pile of warnings. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
1 parent eedacbf commit ba55bd7

9 files changed

Lines changed: 33 additions & 0 deletions

File tree

‎arch/powerpc/Kconfig.debug‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,23 @@ menu "Kernel hacking"
22

33
source "lib/Kconfig.debug"
44

5+
config PPC_DISABLE_WERROR
6+
bool "Don't build arch/powerpc code with -Werror"
7+
default n
8+
help
9+
This option tells the compiler NOT to build the code under
10+
arch/powerpc with the -Werror flag (which means warnings
11+
are treated as errors).
12+
13+
Only enable this if you are hitting a build failure in the
14+
arch/powerpc code caused by a warning, and you don't feel
15+
inclined to fix it.
16+
17+
config PPC_WERROR
18+
bool
19+
depends on !PPC_DISABLE_WERROR
20+
default y
21+
522
config PRINT_STACK_DEPTH
623
int "Stack depth to print" if DEBUG_KERNEL
724
default 64

‎arch/powerpc/kernel/Makefile‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
CFLAGS_ptrace.o += -DUTS_MACHINE='"$(UTS_MACHINE)"'
66

7+
subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror
8+
79
ifeq ($(CONFIG_PPC64),y)
810
CFLAGS_prom_init.o += -mno-minimal-toc
911
endif

‎arch/powerpc/kvm/Makefile‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
# Makefile for Kernel-based Virtual Machine module
33
#
44

5+
subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror
6+
57
EXTRA_CFLAGS += -Ivirt/kvm -Iarch/powerpc/kvm
68

79
common-objs-y = $(addprefix ../../../virt/kvm/, kvm_main.o coalesced_mmio.o)

‎arch/powerpc/lib/Makefile‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
# Makefile for ppc-specific library files..
33
#
44

5+
subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror
6+
57
ifeq ($(CONFIG_PPC64),y)
68
EXTRA_CFLAGS += -mno-minimal-toc
79
endif

‎arch/powerpc/mm/Makefile‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
# Makefile for the linux ppc-specific parts of the memory manager.
33
#
44

5+
subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror
6+
57
ifeq ($(CONFIG_PPC64),y)
68
EXTRA_CFLAGS += -mno-minimal-toc
79
endif

‎arch/powerpc/oprofile/Makefile‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror
2+
13
ifeq ($(CONFIG_PPC64),y)
24
EXTRA_CFLAGS += -mno-minimal-toc
35
endif

‎arch/powerpc/platforms/Makefile‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11

2+
subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror
3+
24
obj-$(CONFIG_FSL_ULI1575) += fsl_uli1575.o
35

46
obj-$(CONFIG_PPC_PMAC) += powermac/

‎arch/powerpc/sysdev/Makefile‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror
2+
13
ifeq ($(CONFIG_PPC64),y)
24
EXTRA_CFLAGS += -mno-minimal-toc
35
endif

‎arch/powerpc/xmon/Makefile‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Makefile for xmon
22

3+
subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror
4+
35
ifdef CONFIG_PPC64
46
EXTRA_CFLAGS += -mno-minimal-toc
57
endif

0 commit comments

Comments
 (0)