pkgsrc-Changes archive

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

CVS commit: pkgsrc/mk



Module Name:    pkgsrc
Committed By:   khorben
Date:           Thu May 18 01:29:56 UTC 2017

Modified Files:
        pkgsrc/mk/compiler: clang.mk
        pkgsrc/mk/platform: FreeBSD.mk

Log Message:
Register support for SSP on FreeBSD and clang (on x86 architectures)

Support for SSP (Stack-Smashing Protection) is optional so this should not
affect default builds.

Tested on FreeBSD/amd64 (10.3-RELEASE-p11)


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 pkgsrc/mk/compiler/clang.mk
cvs rdiff -u -r1.33 -r1.34 pkgsrc/mk/platform/FreeBSD.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/mk/compiler/clang.mk
diff -u pkgsrc/mk/compiler/clang.mk:1.15 pkgsrc/mk/compiler/clang.mk:1.16
--- pkgsrc/mk/compiler/clang.mk:1.15    Mon Mar  2 19:59:07 2015
+++ pkgsrc/mk/compiler/clang.mk Thu May 18 01:29:55 2017
@@ -1,4 +1,4 @@
-# $NetBSD: clang.mk,v 1.15 2015/03/02 19:59:07 joerg Exp $
+# $NetBSD: clang.mk,v 1.16 2017/05/18 01:29:55 khorben Exp $
 #
 # This is the compiler definition for the clang compiler.
 #
@@ -53,6 +53,21 @@ _COMPILER_LD_FLAG=   -Wl,
 _LINKER_RPATH_FLAG=    -R
 _COMPILER_RPATH_FLAG=  ${_COMPILER_LD_FLAG}${_LINKER_RPATH_FLAG}
 
+# The user can choose the level of stack smashing protection.
+.if ${PKGSRC_USE_SSP} == "all"
+_SSP_CFLAGS=           -fstack-protector-all
+.else
+_SSP_CFLAGS=           -fstack-protector
+.endif
+
+.if ${_PKGSRC_USE_SSP} == "yes"
+_WRAP_EXTRA_ARGS.CC+=  ${_SSP_CFLAGS}
+_WRAP_EXTRA_ARGS.CXX+= ${_SSP_CFLAGS}
+CWRAPPERS_APPEND.cc+=  ${_SSP_CFLAGS}
+CWRAPPERS_APPEND.cxx+= ${_SSP_CFLAGS}
+CWRAPPERS_APPEND.f77+= ${_SSP_CFLAGS}
+.endif
+
 # _LANGUAGES.<compiler> is ${LANGUAGES.<compiler>} restricted to the
 # ones requested by the package in USE_LANGUAGES.
 #

Index: pkgsrc/mk/platform/FreeBSD.mk
diff -u pkgsrc/mk/platform/FreeBSD.mk:1.33 pkgsrc/mk/platform/FreeBSD.mk:1.34
--- pkgsrc/mk/platform/FreeBSD.mk:1.33  Sun Dec  4 15:37:41 2016
+++ pkgsrc/mk/platform/FreeBSD.mk       Thu May 18 01:29:56 2017
@@ -1,4 +1,4 @@
-# $NetBSD: FreeBSD.mk,v 1.33 2016/12/04 15:37:41 bsiegert Exp $
+# $NetBSD: FreeBSD.mk,v 1.34 2017/05/18 01:29:56 khorben Exp $
 #
 # Variable definitions for the FreeBSD operating system.
 
@@ -63,6 +63,12 @@ SERIAL_DEVICES?=     /dev/cuaa0
 PKG_HAVE_KQUEUE=       # defined
 .endif
 
+# Register support for SSP on x86 architectures
+.if (${MACHINE_ARCH} == "i386") || \
+    (${MACHINE_ARCH} == "x86_64")
+_OPSYS_SUPPORTS_SSP=   yes
+.endif
+
 _OPSYS_SUPPORTS_CWRAPPERS=     yes
 _OPSYS_CAN_CHECK_SHLIBS=       yes # use readelf in check/bsd.check-vars.mk
 



Home | Main Index | Thread Index | Old Index