tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: -fstack-check vs -fstack-clash-protection



Hi!

Here's the patch I'm currently testing in my (limited) bulk build and
which I'll commit if it's looking good.

Cheers,
 Thomas
Index: bsd.prefs.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/bsd.prefs.mk,v
retrieving revision 1.424
diff -u -r1.424 bsd.prefs.mk
--- bsd.prefs.mk	22 Jul 2022 09:27:01 -0000	1.424
+++ bsd.prefs.mk	31 Jul 2022 12:43:08 -0000
@@ -855,7 +855,11 @@
 .if ${PKGSRC_USE_STACK_CHECK:tl} != "no" && \
     ${STACK_CHECK_SUPPORTED:Uyes:tl} == "yes" && \
     ${_OPSYS_SUPPORTS_STACK_CHECK:Uno} == "yes"
+.  if ${PKGSRC_USE_STACK_CHECK:tl} == "stack-clash"
+_PKGSRC_USE_STACK_CHECK=stack-clash
+.  else
 _PKGSRC_USE_STACK_CHECK=yes
+.  endif
 .endif
 
 # Enable CTF conversion if the user requested it, the OPSYS supports it, there
Index: compiler/gcc.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/compiler/gcc.mk,v
retrieving revision 1.245
diff -u -r1.245 gcc.mk
--- compiler/gcc.mk	7 Jul 2022 16:23:39 -0000	1.245
+++ compiler/gcc.mk	31 Jul 2022 12:43:08 -0000
@@ -443,9 +443,11 @@
 _RELRO_LDFLAGS+=	-Wl,-z,common-page-size=0x10000
 .endif
 
-_STACK_CHECK_CFLAGS=	-fstack-check
-
 .if ${_PKGSRC_USE_STACK_CHECK} == "yes"
+_STACK_CHECK_CFLAGS=	-fstack-check
+_GCC_CFLAGS+=		${_STACK_CHECK_CFLAGS}
+.elif ${_PKGSRC_USE_STACK_CHECK} == "stack-clash"
+_STACK_CHECK_CFLAGS=	-fstack-clash-protection
 _GCC_CFLAGS+=		${_STACK_CHECK_CFLAGS}
 .endif
 
Index: defaults/mk.conf
===================================================================
RCS file: /cvsroot/pkgsrc/mk/defaults/mk.conf,v
retrieving revision 1.334
diff -u -r1.334 mk.conf
--- defaults/mk.conf	7 Jun 2022 10:04:25 -0000	1.334
+++ defaults/mk.conf	31 Jul 2022 12:43:08 -0000
@@ -305,8 +305,9 @@
 PKGSRC_USE_STACK_CHECK?= no
 # Configure this to enable stack boundary verification (on supported platforms).
 # Possible values:
-#	no:	Do not pass any stack protection flags
-#	yes:	Pass -fstack-check
+#	no:	          Do not pass any stack protection flags
+#	yes:	          Pass -fstack-check
+#	clash-protection: Pass -fstack-clash-protection
 # Default: no
 
 # The default PREFER_PKGSRC should be empty, but due to historical reasons we have the list below.


Home | Main Index | Thread Index | Old Index