Skip to content

Commit

Permalink
powerpc: Add configurable -Werror for arch/powerpc
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Michael Ellerman authored and Benjamin Herrenschmidt committed Jun 16, 2009
1 parent eedacbf commit ba55bd7
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 0 deletions.
17 changes: 17 additions & 0 deletions arch/powerpc/Kconfig.debug
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@ menu "Kernel hacking"

source "lib/Kconfig.debug"

config PPC_DISABLE_WERROR
bool "Don't build arch/powerpc code with -Werror"
default n
help
This option tells the compiler NOT to build the code under
arch/powerpc with the -Werror flag (which means warnings
are treated as errors).

Only enable this if you are hitting a build failure in the
arch/powerpc code caused by a warning, and you don't feel
inclined to fix it.

config PPC_WERROR
bool
depends on !PPC_DISABLE_WERROR
default y

config PRINT_STACK_DEPTH
int "Stack depth to print" if DEBUG_KERNEL
default 64
Expand Down
2 changes: 2 additions & 0 deletions arch/powerpc/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

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

subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror

ifeq ($(CONFIG_PPC64),y)
CFLAGS_prom_init.o += -mno-minimal-toc
endif
Expand Down
2 changes: 2 additions & 0 deletions arch/powerpc/kvm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# Makefile for Kernel-based Virtual Machine module
#

subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror

EXTRA_CFLAGS += -Ivirt/kvm -Iarch/powerpc/kvm

common-objs-y = $(addprefix ../../../virt/kvm/, kvm_main.o coalesced_mmio.o)
Expand Down
2 changes: 2 additions & 0 deletions arch/powerpc/lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# Makefile for ppc-specific library files..
#

subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror

ifeq ($(CONFIG_PPC64),y)
EXTRA_CFLAGS += -mno-minimal-toc
endif
Expand Down
2 changes: 2 additions & 0 deletions arch/powerpc/mm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# Makefile for the linux ppc-specific parts of the memory manager.
#

subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror

ifeq ($(CONFIG_PPC64),y)
EXTRA_CFLAGS += -mno-minimal-toc
endif
Expand Down
2 changes: 2 additions & 0 deletions arch/powerpc/oprofile/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror

ifeq ($(CONFIG_PPC64),y)
EXTRA_CFLAGS += -mno-minimal-toc
endif
Expand Down
2 changes: 2 additions & 0 deletions arch/powerpc/platforms/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror

obj-$(CONFIG_FSL_ULI1575) += fsl_uli1575.o

obj-$(CONFIG_PPC_PMAC) += powermac/
Expand Down
2 changes: 2 additions & 0 deletions arch/powerpc/sysdev/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror

ifeq ($(CONFIG_PPC64),y)
EXTRA_CFLAGS += -mno-minimal-toc
endif
Expand Down
2 changes: 2 additions & 0 deletions arch/powerpc/xmon/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Makefile for xmon

subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror

ifdef CONFIG_PPC64
EXTRA_CFLAGS += -mno-minimal-toc
endif
Expand Down

0 comments on commit ba55bd7

Please sign in to comment.