Add INIT_ALL_ZERO and INIT_ALL_PATTERN to kern.opts.mk

These options need to be in the kern.opts.mk file to be alive for kernel
and module builds. This also reverts r367579 since that's not needed with
this fix: the host's bsd.opts.mk is irrelevant.

Reviewed by: brooks@
Differential Revision:  https://reviews.freebsd.org/D27170
This commit is contained in:
Warner Losh 2020-11-10 23:25:16 +00:00
parent 40aad3e477
commit 26676c47dc
2 changed files with 6 additions and 4 deletions

View File

@ -230,15 +230,15 @@ CFLAGS+= -mretpoline
#
# Initialize stack variables on function entry
#
.if defined(MK_INIT_ALL_ZERO) && ${MK_INIT_ALL_ZERO} == "yes"
.if defined(COMPILER_FEATURES) && ${COMPILER_FEATURES:Minit-all}
.if ${MK_INIT_ALL_ZERO} == "yes"
.if ${COMPILER_FEATURES:Minit-all}
CFLAGS+= -ftrivial-auto-var-init=zero \
-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang
.else
.warning InitAll (zeros) requested but not support by compiler
.endif
.elif defined(MK_INIT_ALL_PATTERN) && ${MK_INIT_ALL_PATTERN} == "yes"
.if defined(COMPILER_FEATURES) && ${COMPILER_FEATURES:Minit-all}
.elif ${MK_INIT_ALL_PATTERN} == "yes"
.if ${COMPILER_FEATURES:Minit-all}
CFLAGS+= -ftrivial-auto-var-init=pattern
.else
.warning InitAll (pattern) requested but not support by compiler

View File

@ -52,6 +52,8 @@ __DEFAULT_YES_OPTIONS = \
__DEFAULT_NO_OPTIONS = \
BHYVE_SNAPSHOT \
EXTRA_TCP_STACKS \
INIT_ALL_PATTERN \
INIT_ALL_ZERO \
KERNEL_RETPOLINE \
OFED \
RATELIMIT \