diff --git a/sys/arch/amd64/conf/Makefile.amd64 b/sys/arch/amd64/conf/Makefile.amd64 index c1455c1..8717926 100644 --- a/sys/arch/amd64/conf/Makefile.amd64 +++ b/sys/arch/amd64/conf/Makefile.amd64 @@ -43,6 +43,18 @@ CFLAGS+= -msoft-float # For gcc we might need this, but other compilers barf # CFLAGS+= -mno-fp-ret-in-387 +# By default, our gcc uses -mtune=nocona for compiling the kernels +# (see share/mk/bsd.own.mk). With -mtune=nocona, gcc doesn't align +# the start address of functions, i.e., they can move easily by changes +# of leading functions, which causes performance fluctuations. +# -falign-functions=16 reduces such fluctuations by supressing +# changing of the start address of functions. +DEFCOPTS.gcc?= -falign-functions=16 +DEFCOPTS+= ${DEFCOPTS.${ACTIVE_CC}} +.if "${COPTS}" != "" +COPTS+= ${DEFCOPTS.${ACTIVE_CC}} +.endif + ## ## (3) libkern and compat ##