1 # $FreeBSD: src/sys/conf/kern.mk,v 1.52 2007/05/24 21:53:42 obrien Exp $
4 # Warning flags for compiling the kernel and components of the kernel.
6 # For x86_64, we explicitly prohibit the use of FPU, SSE and other SIMD
7 # operations inside the kernel itself. These operations are exclusively
8 # reserved for user applications.
10 # -fno-strict-aliasing required for -O2 compilation.
12 CFLAGS+= -fno-stack-protector -fno-strict-aliasing
13 CFLAGS+= -fno-strict-overflow
14 CFLAGS+= -mcmodel=kernel -mno-red-zone -mfpmath=387
16 CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3
19 CFLAGS+= -mpreferred-stack-boundary=4
20 CFLAGS+= -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -mno-sse4 -mno-sse4a \
22 CFLAGS+= -mno-abm -mno-aes -mno-avx -mno-pclmul -mno-popcnt
24 .if ${CCVER:Mgcc4[789]} || ${CCVER:Mgcc5*}
25 CFLAGS+= -mno-avx2 -mno-fsgsbase -mno-rdrnd -mno-f16c
26 CFLAGS+= -mno-fma -mno-fma4
27 CFLAGS+= -mno-bmi -mno-bmi2
28 CFLAGS+= -mno-xop -mno-lwp -mno-lzcnt -mno-tbm
33 CFLAGS+= -fno-asynchronous-unwind-tables -fno-omit-frame-pointer