Re: Initial implementation of _FORTIFY_SOURCE

From: Alexander Leidinger <Alexander_at_Leidinger.net>
Date: Wed, 15 May 2024 12:39:44 UTC
Am 2024-05-15 01:15, schrieb Kyle Evans:

> I've confirmed that this patch fixes libfido2, will commit shortly.

I can confirm too.

If I want to test this on more ports, I have to add -D_FORTIFY_SOURCE=2 
to the CFLAGS / CSSFLAGS? Or rather do this:
---snip---
diff --git a/Mk/Features/ssp.mk b/Mk/Features/ssp.mk
index 4213e6d668a..545e74bfa05 100644
--- a/Mk/Features/ssp.mk
+++ b/Mk/Features/ssp.mk
@@ -7,8 +7,10 @@ SSP_Include_MAINTAINER=        portmgr@FreeBSD.org
  .  if !defined(SSP_UNSAFE) && \
      (! ${ARCH:Mmips*})
  # Overridable as a user may want to use -fstack-protector-all
-SSP_CFLAGS?=   -fstack-protector-strong
+SSP_CFLAGS?=   -fstack-protector-strong -D_FORTIFY_SOURCE=2
+SSP_LDFLAGS?=  -fstack-protector-strong
  CFLAGS+=       ${SSP_CFLAGS}
-LDFLAGS+=      ${SSP_CFLAGS}
+CXXFLAGS+=     ${SSP_CFLAGS}
+LDFLAGS+=      ${SSP_LDFLAGS}
  .  endif
  .endif
---snip---

Bye,
Alexander.

-- 
http://www.Leidinger.net Alexander@Leidinger.net: PGP 0x8F31830F9F2772BF
http://www.FreeBSD.org    netchild@FreeBSD.org  : PGP 0x8F31830F9F2772BF