Bug 223391

Summary: Mk/bsd.ssp.mk should add SSP_LDFLAGS?=
Product: Ports & Packages Reporter: dewayne
Component: Ports FrameworkAssignee: Port Management Team <portmgr>
Status: Closed Overcome By Events    
Severity: Affects Some People CC: ports-bugs
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   

Description dewayne 2017-11-03 03:06:06 UTC
Unfortunately for internet facing applications we use -fstack-protector-strong, so I modified my bsd.port.mk to accommodate.  Perhaps you would consider the same.

My change is basically, add one line & change one line:

--- /usr/ports/Mk/bsd.ssp.mk    (revision 453385)
+++ /usr/ports/Mk/bsd.ssp.mk    (working copy)
@@ -7,8 +7,9 @@
     (${ARCH} == i386 || ${ARCH} == amd64)
 # Overridable as a user may want to use -fstack-protector-all
 SSP_CFLAGS?=   -fstack-protector
+SSP_LDFLAGS?=  -fstack-protector
 CFLAGS+=       ${SSP_CFLAGS}
-LDFLAGS+=      -fstack-protector
+LDFLAGS+=      ${SSP_LDFLAGS}
 # -lssp_nonshared is needed on i386 where /usr/lib/libc.so is not an ldscript
 # This is currently unused XXX
 .      if defined(SSP_NEED_NONSHARED)

And air gap machines
SSP_CFLAGS= -fno-stack-protector
SSP_LDFLAGS= -fno-stack-protector
Comment 1 dewayne 2017-11-03 03:09:13 UTC
(In reply to dewayne from comment #0)
Apologies I was working on a few different things as I wrote the original PR, I modified bsd.ssp.mk not bsd.port.mk for the additional SSP_LDFLAGS statement.
Comment 2 Baptiste Daroussin freebsd_committer freebsd_triage 2019-09-06 08:51:20 UTC
see https://svnweb.freebsd.org/ports?view=revision&revision=499897