Build debug kernels with -O2.
LLVM 11 changed the meaning of '-O' from '-O2' to '-O1', which resulted in debug kernels (with 'makeoptions DEBUG=-g') being built with inlining disabled, causing severe performance hit. The -O2 was already being used for building amd64, powerpc, and powerpcspe. Discussed with: jrtc27, arichardson, bdragon, jhibbits Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26471
This commit is contained in:
parent
2a080e3dd1
commit
00ebcd6ef5
@ -51,25 +51,14 @@ OBJCOPY?= objcopy
|
||||
SIZE?= size
|
||||
|
||||
.if defined(DEBUG)
|
||||
.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpcspe"
|
||||
# Work around clang 11 miscompile on 32 bit powerpc.
|
||||
_MINUS_O= -O2
|
||||
.else
|
||||
_MINUS_O= -O
|
||||
.endif
|
||||
CTFFLAGS+= -g
|
||||
.else
|
||||
_MINUS_O= -O2
|
||||
.endif
|
||||
.if ${MACHINE_CPUARCH} == "amd64"
|
||||
.if ${COMPILER_TYPE} == "clang"
|
||||
COPTFLAGS?=-O2 -pipe
|
||||
.if ${MACHINE_CPUARCH} == "amd64" && ${COMPILER_TYPE} != "clang"
|
||||
_COPTFLAGS_EXTRA=-frename-registers
|
||||
.else
|
||||
COPTFLAGS?=-O2 -frename-registers -pipe
|
||||
.endif
|
||||
.else
|
||||
COPTFLAGS?=${_MINUS_O} -pipe
|
||||
_COPTFLAGS_EXTRA=
|
||||
.endif
|
||||
COPTFLAGS?=-O2 -pipe ${_COPTFLAGS_EXTRA}
|
||||
.if !empty(COPTFLAGS:M-O[23s]) && empty(COPTFLAGS:M-fno-strict-aliasing)
|
||||
COPTFLAGS+= -fno-strict-aliasing
|
||||
.endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user