[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ]

FreeBSD/Linux Kernel Cross Reference
sys/conf/kern.mk

Version: -  FREEBSD  -  FREEBSD7  -  FREEBSD70  -  FREEBSD6  -  FREEBSD63  -  FREEBSD62  -  FREEBSD61  -  FREEBSD60  -  FREEBSD5  -  FREEBSD55  -  FREEBSD54  -  FREEBSD53  -  FREEBSD52  -  FREEBSD51  -  FREEBSD50  -  FREEBSD4  -  FREEBSD3  -  FREEBSD22  -  linux-2.6  -  linux-2.4.22  -  MK83  -  MK84  -  PLAN9  -  DFBSD  -  NETBSD  -  NETBSD4  -  NETBSD3  -  NETBSD20  -  OPENBSD  -  xnu-517  -  xnu-792  -  xnu-792.6.70  -  xnu-1228  -  OPENSOLARIS  -  minix-3-1-1  -  TRUSTEDBSD-SEBSD  -  FREEBSD-LIBC  -  FREEBSD7-LIBC  -  FREEBSD6-LIBC  -  GLIBC27 
SearchContext: -  none  -  excerpts  -  bigexcerpts 

  1 # $FreeBSD: src/sys/conf/kern.mk,v 1.57 2008/07/23 06:16:34 imp Exp $
  2 
  3 #
  4 # Warning flags for compiling the kernel and components of the kernel.
  5 #
  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.
  9 .if ${CC} == "icc"
 10 #CWARNFLAGS=    -w2     # use this if you are terribly bored
 11 CWARNFLAGS=
 12 .else
 13 CWARNFLAGS?=    -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \
 14                 -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual \
 15                 ${_wundef} ${_Wno_pointer_sign} -fformat-extensions
 16 .if !defined(WITH_GCC3)
 17 _Wno_pointer_sign=-Wno-pointer-sign
 18 .endif
 19 .if !defined(NO_UNDEF)
 20 _wundef=        -Wundef
 21 .endif
 22 .endif
 23 #
 24 # The following flags are next up for working on:
 25 #       -W
 26 
 27 #
 28 # On the i386, do not align the stack to 16-byte boundaries.  Otherwise GCC
 29 # 2.95 adds code to the entry and exit point of every function to align the
 30 # stack to 16-byte boundaries -- thus wasting approximately 12 bytes of stack
 31 # per function call.  While the 16-byte alignment may benefit micro benchmarks, 
 32 # it is probably an overall loss as it makes the code bigger (less efficient
 33 # use of code cache tag lines) and uses more stack (less efficient use of data
 34 # cache tag lines).  Explicitly prohibit the use of SSE and other SIMD
 35 # operations inside the kernel itself.  These operations are exclusively
 36 # reserved for user applications.
 37 #
 38 .if ${MACHINE_ARCH} == "i386" && ${CC} != "icc"
 39 CFLAGS+=        -mno-align-long-strings -mpreferred-stack-boundary=2 \
 40                 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3
 41 INLINE_LIMIT?=  8000
 42 .endif
 43 
 44 .if ${MACHINE_ARCH} == "arm"
 45 INLINE_LIMIT?=  8000
 46 .endif
 47 #
 48 # For IA-64, we use r13 for the kernel globals pointer and we only use
 49 # a very small subset of float registers for integer divides.
 50 #
 51 .if ${MACHINE_ARCH} == "ia64"
 52 CFLAGS+=        -ffixed-r13 -mfixed-range=f32-f127 -fpic #-mno-sdata
 53 INLINE_LIMIT?=  15000
 54 .endif
 55 
 56 #
 57 # For sparc64 we want medlow code model, and we tell gcc to use floating
 58 # point emulation.  This avoids using floating point registers for integer
 59 # operations which it has a tendency to do.
 60 #
 61 .if ${MACHINE_ARCH} == "sparc64"
 62 CFLAGS+=        -mcmodel=medany -msoft-float
 63 INLINE_LIMIT?=  15000
 64 .endif
 65 
 66 #
 67 # For AMD64, we explicitly prohibit the use of FPU, SSE and other SIMD
 68 # operations inside the kernel itself.  These operations are exclusively
 69 # reserved for user applications.
 70 #
 71 .if ${MACHINE_ARCH} == "amd64"
 72 CFLAGS+=        -mcmodel=kernel -mno-red-zone \
 73                 -mfpmath=387 -mno-sse -mno-sse2 -mno-sse3 -mno-mmx -mno-3dnow \
 74                 -msoft-float -fno-asynchronous-unwind-tables
 75 INLINE_LIMIT?=  8000
 76 .endif
 77 
 78 #
 79 # For PowerPC we tell gcc to use floating point emulation.  This avoids using
 80 # floating point registers for integer operations which it has a tendency to do.
 81 #
 82 .if ${MACHINE_ARCH} == "powerpc"
 83 CFLAGS+=        -msoft-float
 84 INLINE_LIMIT?=  15000
 85 .endif
 86 
 87 #
 88 # For MIPS we also tell gcc to use floating point emulation and 
 89 # disable MIPS DSP ASE Instruction set.
 90 #
 91 .if ${MACHINE_ARCH} == "mips"
 92 CFLAGS+=        -msoft-float -mno-dsp
 93 INLINE_LIMIT?=  15000
 94 .endif
 95 
 96 #
 97 # GCC 3.0 and above like to do certain optimizations based on the
 98 # assumption that the program is linked against libc.  Stop this.
 99 #
100 .if ${CC} == "icc"
101 CFLAGS+=        -nolib_inline
102 .else
103 CFLAGS+=        -ffreestanding
104 .endif
105 
106 .if ${CC} == "icc"
107 CFLAGS+=        -restrict
108 .endif
109 
110 #
111 # GCC SSP support.
112 #
113 .if ${MK_SSP} != "no" && ${CC} != "icc" && ${MACHINE_ARCH} != "ia64" && \
114         ${MACHINE_ARCH} != "arm" && ${MACHINE_ARCH} != "mips"
115 CFLAGS+=        -fstack-protector
116 .endif

[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.