arm: enable stack-smashing protection

With current generation clang/llvm it can pass all of our tests in
libc/ssp.

While here, remove the extra MACHINE_CPUARCH check for mips. SSP is
included in BROKEN_OPTIONS for this architecture in src.opts.mk, which
is enough to ensure normal builds won't set SSP_CFLAGS.

Reviewed by:	kevans, imp, emaste
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D31400
This commit is contained in:
Mitchell Horne 2021-08-04 15:18:18 -03:00
parent bcd2f41f7d
commit 1b8db4b4e3
2 changed files with 3 additions and 5 deletions

View file

@ -239,12 +239,11 @@ CFLAGS.clang+= -Qunused-arguments
# but not yet.
CXXFLAGS.clang+= -Wno-c++11-extensions
.if ${MK_SSP} != "no" && \
${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips"
.if ${MK_SSP} != "no"
# Don't use -Wstack-protector as it breaks world with -Werror.
SSP_CFLAGS?= -fstack-protector-strong
CFLAGS+= ${SSP_CFLAGS}
.endif # SSP && !ARM && !MIPS
.endif # SSP
# Additional flags passed in CFLAGS and CXXFLAGS when MK_DEBUG_FILES is
# enabled.

View file

@ -213,8 +213,7 @@ CFLAGS+= -fwrapv
#
# GCC SSP support
#
.if ${MK_SSP} != "no" && \
${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips"
.if ${MK_SSP} != "no"
CFLAGS+= -fstack-protector
.endif