git: 706df48aeda9 - stable/13 - arm: enable stack-smashing protection

Mitchell Horne mhorne at FreeBSD.org
Mon Aug 30 16:00:54 UTC 2021


The branch stable/13 has been updated by mhorne:

URL: https://cgit.FreeBSD.org/src/commit/?id=706df48aeda9a0fe2cbad3b5488b067fda3d586d

commit 706df48aeda9a0fe2cbad3b5488b067fda3d586d
Author:     Mitchell Horne <mhorne at FreeBSD.org>
AuthorDate: 2021-08-04 18:18:18 +0000
Commit:     Mitchell Horne <mhorne at FreeBSD.org>
CommitDate: 2021-08-30 15:53:59 +0000

    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
    
    (cherry picked from commit 1b8db4b4e3614ef6334ce776dcdd46fe7f2c5a78)
---
 share/mk/bsd.sys.mk | 5 ++---
 sys/conf/kern.mk    | 3 +--
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk
index 6341800d5c70..031d49bbaca2 100644
--- a/share/mk/bsd.sys.mk
+++ b/share/mk/bsd.sys.mk
@@ -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.
diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk
index f8ea372b1d93..56bddb35398b 100644
--- a/sys/conf/kern.mk
+++ b/sys/conf/kern.mk
@@ -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
 


More information about the dev-commits-src-branches mailing list