4 # Warning flags for compiling the kernel and components of the kernel.
6 # Note that the newly added -Wcast-qual is responsible for generating
7 # most of the remaining warnings. Warnings introduced with -Wall will
8 # also pop up, but are easier to fix.
10 # XXX FIXME - revert to -fformat-extensions when we've re-added it
11 CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \
12 -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual \
15 # The following flags are next up for working on:
18 # When working on removing warnings from code, the `-Werror' flag should be
19 # of material assistance.
23 # On the i386, do not align the stack to 16-byte boundaries. Otherwise GCC
24 # 2.95 adds code to the entry and exit point of every function to align the
25 # stack to 16-byte boundaries -- thus wasting approximately 12 bytes of stack
26 # per function call. While the 16-byte alignment may benefit micro benchmarks,
27 # it is probably an overall loss as it makes the code bigger (less efficient
28 # use of code cache tag lines) and uses more stack (less efficient use of data
31 .if ${MACHINE_ARCH} == "i386"
32 CFLAGS+= -mpreferred-stack-boundary=2
36 # On the alpha, make sure that we don't use floating-point registers and
37 # allow the use of EV56 instructions (only needed for low-level i/o).
38 # Also, reserve register t7 to point at per-cpu global variables.
40 .if ${MACHINE_ARCH} == "alpha"
41 CFLAGS+= -mno-fp-regs -ffixed-8 -Wa,-mev56
45 # For IA-64, we use r13 for the kernel globals pointer and we only use
46 # a very small subset of float registers for integer divides.
48 .if ${MACHINE_ARCH} == "ia64"
49 CFLAGS+= -ffixed-r13 -mfixed-range=f32-f127
53 # GCC 3.0 and above like to do certain optimizations based on the
54 # assumption that the program is linked against libc. Stop this.
56 CFLAGS+= -ffreestanding