summaryrefslogtreecommitdiff
path: root/mk/platform
diff options
context:
space:
mode:
authorkhorben <khorben@pkgsrc.org>2016-03-11 23:54:08 +0000
committerkhorben <khorben@pkgsrc.org>2016-03-11 23:54:08 +0000
commit0374e6e8bba80a646f5946ecd633b0a0cf71a014 (patch)
tree93eeec2ad959273da46850805db37d2aa30f3a0d /mk/platform
parent35e1364464de032ec92a94132037a96e202159d4 (diff)
downloadpkgsrc-0374e6e8bba80a646f5946ecd633b0a0cf71a014.tar.gz
Re-arrange support for FORTIFY/MKPIE/RELRO/SSP
- No _GCC_* anything in mk/bsd.prefs.mk; - No compiler flags in platform files. Tested again on NetBSD/amd64, with and without cwrappers, with the same outcome. With feedback from jperkin@
Diffstat (limited to 'mk/platform')
-rw-r--r--mk/platform/NetBSD.mk12
-rw-r--r--mk/platform/SunOS.mk4
2 files changed, 3 insertions, 13 deletions
diff --git a/mk/platform/NetBSD.mk b/mk/platform/NetBSD.mk
index d5270fedc05..7acb95e138d 100644
--- a/mk/platform/NetBSD.mk
+++ b/mk/platform/NetBSD.mk
@@ -1,4 +1,4 @@
-# $NetBSD: NetBSD.mk,v 1.47 2016/03/11 23:03:31 khorben Exp $
+# $NetBSD: NetBSD.mk,v 1.48 2016/03/11 23:54:09 khorben Exp $
#
# Variable definitions for the NetBSD operating system.
@@ -123,26 +123,19 @@ FFLAGS+= -mieee
PKG_HAVE_KQUEUE= # defined
.endif
-# Register support for FORTIFY where supported (with GCC)
+# Register support for FORTIFY (with GCC)
_OPSYS_SUPPORTS_FORTIFY=yes
-_FORTIFY_CFLAGS.gcc= -D_FORTIFY_SOURCE=2
# Register support for PIE on supported architectures (with GCC)
.if (${MACHINE_ARCH} == "i386") || \
(${MACHINE_ARCH} == "x86_64")
_OPSYS_SUPPORTS_MKPIE= yes
-_MKPIE_CFLAGS.gcc= -fPIC
-# XXX for executables it should be:
-#_MKPIE_CFLAGS.gcc= -fPIE
-# XXX for libraries a sink wrapper around gcc is required and used instead
-#_MKPIE_LDFLAGS.gcc= -pie
.endif
# Register support for RELRO on supported architectures (with GCC)
.if (${MACHINE_ARCH} == "i386") || \
(${MACHINE_ARCH} == "x86_64")
_OPSYS_SUPPORTS_RELRO= yes
-_RELRO_LDFLAGS.gcc= -Wl,-z,relro -Wl,-z,now
.endif
# Register support for SSP on most architectures (with GCC)
@@ -151,7 +144,6 @@ _RELRO_LDFLAGS.gcc= -Wl,-z,relro -Wl,-z,now
(${MACHINE_ARCH} != "ia64") && \
(${MACHINE_ARCH} != "mips")
_OPSYS_SUPPORTS_SSP= yes
-_SSP_CFLAGS.gcc= -fstack-protector-all
.endif
_OPSYS_CAN_CHECK_SHLIBS= yes # use readelf in check/bsd.check-vars.mk
diff --git a/mk/platform/SunOS.mk b/mk/platform/SunOS.mk
index 6c6d1ffe0fe..01ab39f2507 100644
--- a/mk/platform/SunOS.mk
+++ b/mk/platform/SunOS.mk
@@ -1,4 +1,4 @@
-# $NetBSD: SunOS.mk,v 1.70 2016/03/11 23:03:31 khorben Exp $
+# $NetBSD: SunOS.mk,v 1.71 2016/03/11 23:54:09 khorben Exp $
#
# Variable definitions for the SunOS/Solaris operating system.
@@ -113,11 +113,9 @@ _OPSYS_INCLUDE_DIRS?= /usr/include
# support FORTIFY (with GCC)
_OPSYS_SUPPORTS_FORTIFY=yes
-_FORTIFY_CFLAGS.gcc= -D_FORTIFY_SOURCE=2
# support stack protection (with GCC)
_OPSYS_SUPPORTS_SSP= yes
-_SSP_CFLAGS.gcc= -fstack-protector
_OPSYS_CAN_CHECK_SHLIBS= yes # requires readelf