1da673940SJordan Gordeev# 2da673940SJordan Gordeev# Prohibit the use of FP registers in the kernel. The user FP state is 3da673940SJordan Gordeev# only saved and restored under strictly managed conditions and mainline 4da673940SJordan Gordeev# kernel code cannot safely use the FP system. 5da673940SJordan Gordeev# 652cb92acSJohn Marino.if ${CCVER:Mgcc*} 7da673940SJordan GordeevCFLAGS+= -mpreferred-stack-boundary=4 8*d4e0b0cdSMatthew Dillon 9*d4e0b0cdSMatthew Dillon# Retpoline spectre protection 10*d4e0b0cdSMatthew Dillon# 11*d4e0b0cdSMatthew Dillon.if ${CCVER:Mgcc8*} 12*d4e0b0cdSMatthew DillonCFLAGS+= -mindirect-branch=thunk-inline 1352cb92acSJohn Marino.endif 14*d4e0b0cdSMatthew Dillon 15*d4e0b0cdSMatthew Dillon.endif 16*d4e0b0cdSMatthew Dillon 17dfad150fSMatthew DillonCFLAGS+= -fno-stack-protector -fno-strict-aliasing 18dfad150fSMatthew DillonCFLAGS+= -fno-strict-overflow 19da673940SJordan GordeevCFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 20da673940SJordan GordeevCFLAGS+= -D_KERNEL_VIRTUAL 21da673940SJordan GordeevCFLAGS+= -fno-omit-frame-pointer 22da673940SJordan Gordeev 23da673940SJordan Gordeev# Remove the dynamic library hack for now 24da673940SJordan Gordeev# 25da673940SJordan GordeevSYSTEM_OBJS:= ${SYSTEM_OBJS:Nhack.So} 26da673940SJordan Gordeev 27da673940SJordan GordeevINLINE_LIMIT= 8000 28