diff options
author | Michael Ellerman <michael@ellerman.id.au> | 2009-06-09 16:48:51 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-06-16 00:15:45 -0400 |
commit | ba55bd74360ea4b8b95e73ed79474d37ff482b36 (patch) | |
tree | 9474cac06ef169ec0a8f5744e2aefa61286e4410 | |
parent | eedacbf02df462d6c915d8d642b23fb450d485c7 (diff) |
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>
-rw-r--r-- | arch/powerpc/Kconfig.debug | 17 | ||||
-rw-r--r-- | arch/powerpc/kernel/Makefile | 2 | ||||
-rw-r--r-- | arch/powerpc/kvm/Makefile | 2 | ||||
-rw-r--r-- | arch/powerpc/lib/Makefile | 2 | ||||
-rw-r--r-- | arch/powerpc/mm/Makefile | 2 | ||||
-rw-r--r-- | arch/powerpc/oprofile/Makefile | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/Makefile | 2 | ||||
-rw-r--r-- | arch/powerpc/sysdev/Makefile | 2 | ||||
-rw-r--r-- | arch/powerpc/xmon/Makefile | 2 |
9 files changed, 33 insertions, 0 deletions
diff --git a/arch/powerpc/Kconfig.debug b/arch/powerpc/Kconfig.debug index d79a902d155a..3b1005185390 100644 --- a/arch/powerpc/Kconfig.debug +++ b/arch/powerpc/Kconfig.debug | |||
@@ -2,6 +2,23 @@ menu "Kernel hacking" | |||
2 | 2 | ||
3 | source "lib/Kconfig.debug" | 3 | source "lib/Kconfig.debug" |
4 | 4 | ||
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 | |||
5 | config PRINT_STACK_DEPTH | 22 | config PRINT_STACK_DEPTH |
6 | int "Stack depth to print" if DEBUG_KERNEL | 23 | int "Stack depth to print" if DEBUG_KERNEL |
7 | default 64 | 24 | default 64 |
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile index 612b0c4dc26d..6a4fb29a0618 100644 --- a/arch/powerpc/kernel/Makefile +++ b/arch/powerpc/kernel/Makefile | |||
@@ -4,6 +4,8 @@ | |||
4 | 4 | ||
5 | CFLAGS_ptrace.o += -DUTS_MACHINE='"$(UTS_MACHINE)"' | 5 | CFLAGS_ptrace.o += -DUTS_MACHINE='"$(UTS_MACHINE)"' |
6 | 6 | ||
7 | subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror | ||
8 | |||
7 | ifeq ($(CONFIG_PPC64),y) | 9 | ifeq ($(CONFIG_PPC64),y) |
8 | CFLAGS_prom_init.o += -mno-minimal-toc | 10 | CFLAGS_prom_init.o += -mno-minimal-toc |
9 | endif | 11 | endif |
diff --git a/arch/powerpc/kvm/Makefile b/arch/powerpc/kvm/Makefile index 4b2df66c79d8..459c7ee580f7 100644 --- a/arch/powerpc/kvm/Makefile +++ b/arch/powerpc/kvm/Makefile | |||
@@ -2,6 +2,8 @@ | |||
2 | # Makefile for Kernel-based Virtual Machine module | 2 | # Makefile for Kernel-based Virtual Machine module |
3 | # | 3 | # |
4 | 4 | ||
5 | subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror | ||
6 | |||
5 | EXTRA_CFLAGS += -Ivirt/kvm -Iarch/powerpc/kvm | 7 | EXTRA_CFLAGS += -Ivirt/kvm -Iarch/powerpc/kvm |
6 | 8 | ||
7 | common-objs-y = $(addprefix ../../../virt/kvm/, kvm_main.o coalesced_mmio.o) | 9 | common-objs-y = $(addprefix ../../../virt/kvm/, kvm_main.o coalesced_mmio.o) |
diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile index 29b742b90f1f..3040dac18a37 100644 --- a/arch/powerpc/lib/Makefile +++ b/arch/powerpc/lib/Makefile | |||
@@ -2,6 +2,8 @@ | |||
2 | # Makefile for ppc-specific library files.. | 2 | # Makefile for ppc-specific library files.. |
3 | # | 3 | # |
4 | 4 | ||
5 | subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror | ||
6 | |||
5 | ifeq ($(CONFIG_PPC64),y) | 7 | ifeq ($(CONFIG_PPC64),y) |
6 | EXTRA_CFLAGS += -mno-minimal-toc | 8 | EXTRA_CFLAGS += -mno-minimal-toc |
7 | endif | 9 | endif |
diff --git a/arch/powerpc/mm/Makefile b/arch/powerpc/mm/Makefile index c4bcf072cb3c..2d2192e48de7 100644 --- a/arch/powerpc/mm/Makefile +++ b/arch/powerpc/mm/Makefile | |||
@@ -2,6 +2,8 @@ | |||
2 | # Makefile for the linux ppc-specific parts of the memory manager. | 2 | # Makefile for the linux ppc-specific parts of the memory manager. |
3 | # | 3 | # |
4 | 4 | ||
5 | subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror | ||
6 | |||
5 | ifeq ($(CONFIG_PPC64),y) | 7 | ifeq ($(CONFIG_PPC64),y) |
6 | EXTRA_CFLAGS += -mno-minimal-toc | 8 | EXTRA_CFLAGS += -mno-minimal-toc |
7 | endif | 9 | endif |
diff --git a/arch/powerpc/oprofile/Makefile b/arch/powerpc/oprofile/Makefile index 2ef6b0dddd8c..73e1c2ca0552 100644 --- a/arch/powerpc/oprofile/Makefile +++ b/arch/powerpc/oprofile/Makefile | |||
@@ -1,3 +1,5 @@ | |||
1 | subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror | ||
2 | |||
1 | ifeq ($(CONFIG_PPC64),y) | 3 | ifeq ($(CONFIG_PPC64),y) |
2 | EXTRA_CFLAGS += -mno-minimal-toc | 4 | EXTRA_CFLAGS += -mno-minimal-toc |
3 | endif | 5 | endif |
diff --git a/arch/powerpc/platforms/Makefile b/arch/powerpc/platforms/Makefile index f7419198e635..a6812ee00100 100644 --- a/arch/powerpc/platforms/Makefile +++ b/arch/powerpc/platforms/Makefile | |||
@@ -1,4 +1,6 @@ | |||
1 | 1 | ||
2 | subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror | ||
3 | |||
2 | obj-$(CONFIG_FSL_ULI1575) += fsl_uli1575.o | 4 | obj-$(CONFIG_FSL_ULI1575) += fsl_uli1575.o |
3 | 5 | ||
4 | obj-$(CONFIG_PPC_PMAC) += powermac/ | 6 | obj-$(CONFIG_PPC_PMAC) += powermac/ |
diff --git a/arch/powerpc/sysdev/Makefile b/arch/powerpc/sysdev/Makefile index 2d1c87dd5d14..d073bfdd222a 100644 --- a/arch/powerpc/sysdev/Makefile +++ b/arch/powerpc/sysdev/Makefile | |||
@@ -1,3 +1,5 @@ | |||
1 | subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror | ||
2 | |||
1 | ifeq ($(CONFIG_PPC64),y) | 3 | ifeq ($(CONFIG_PPC64),y) |
2 | EXTRA_CFLAGS += -mno-minimal-toc | 4 | EXTRA_CFLAGS += -mno-minimal-toc |
3 | endif | 5 | endif |
diff --git a/arch/powerpc/xmon/Makefile b/arch/powerpc/xmon/Makefile index 9cb03b71b9d6..85ab97ab840a 100644 --- a/arch/powerpc/xmon/Makefile +++ b/arch/powerpc/xmon/Makefile | |||
@@ -1,5 +1,7 @@ | |||
1 | # Makefile for xmon | 1 | # Makefile for xmon |
2 | 2 | ||
3 | subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror | ||
4 | |||
3 | ifdef CONFIG_PPC64 | 5 | ifdef CONFIG_PPC64 |
4 | EXTRA_CFLAGS += -mno-minimal-toc | 6 | EXTRA_CFLAGS += -mno-minimal-toc |
5 | endif | 7 | endif |