Be more tolerant of share/mk and kern.mk mismatch
When building out-of-tree modules, it appears that the system share/mk is used, but sys/conf/kern.mk is used. That results in MK_INIT_ALL_ZERO being undefined. In the interest of maximum compatability, check that MK_INIT_ALL_* and COMPILER_FEATURES are defined before comparing their values. Reported by: mmacy Sponsored by: DARPA
This commit is contained in:
parent
b3ceca0c80
commit
d8033dc3d3
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=367579
@ -230,15 +230,15 @@ CFLAGS+= -mretpoline
|
|||||||
#
|
#
|
||||||
# Initialize stack variables on function entry
|
# Initialize stack variables on function entry
|
||||||
#
|
#
|
||||||
.if ${MK_INIT_ALL_ZERO} == "yes"
|
.if defined(MK_INIT_ALL_ZERO) && ${MK_INIT_ALL_ZERO} == "yes"
|
||||||
.if ${COMPILER_FEATURES:Minit-all}
|
.if defined(COMPILER_FEATURES) && ${COMPILER_FEATURES:Minit-all}
|
||||||
CFLAGS+= -ftrivial-auto-var-init=zero \
|
CFLAGS+= -ftrivial-auto-var-init=zero \
|
||||||
-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang
|
-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang
|
||||||
.else
|
.else
|
||||||
.warning InitAll (zeros) requested but not support by compiler
|
.warning InitAll (zeros) requested but not support by compiler
|
||||||
.endif
|
.endif
|
||||||
.elif ${MK_INIT_ALL_PATTERN} == "yes"
|
.elif defined(MK_INIT_ALL_PATTERN) && ${MK_INIT_ALL_PATTERN} == "yes"
|
||||||
.if ${COMPILER_FEATURES:Minit-all}
|
.if defined(COMPILER_FEATURES) && ${COMPILER_FEATURES:Minit-all}
|
||||||
CFLAGS+= -ftrivial-auto-var-init=pattern
|
CFLAGS+= -ftrivial-auto-var-init=pattern
|
||||||
.else
|
.else
|
||||||
.warning InitAll (pattern) requested but not support by compiler
|
.warning InitAll (pattern) requested but not support by compiler
|
||||||
|
Loading…
Reference in New Issue
Block a user