Import devel/fpc-fpmkunit version 2.6.4
[dports.git] / Mk / bsd.ssp.mk
1 # $FreeBSD$
2 # SSP Support
3
4 SSP_Include_MAINTAINER= portmgr@FreeBSD.org
5
6 # See: http://svnweb.freebsd.org/base/head/lib/libc/libc.ldscript?revision=251668&view=markup
7 .if ${OSVERSION} < 1000036 && ${ARCH} == i386
8
9 # Disabled on i386 for now on releases without the ldscript as too many ports
10 # do not respect LDFLAGS and fail to build due to not adding in -lssp_nonshared when needed
11 # despite dependencies working fine, which breaks a lot. Can enable once LDFLAGS is more
12 # supported. XXX
13 SSP_UNSAFE=             yes
14
15 # i386 needs -lssp_nonshared, see svn link above for more information
16 SSP_NEED_NONSHARED=     yes
17 .endif
18
19 .if !defined(SSP_UNSAFE) && \
20     (${ARCH} == i386 || ${ARCH} == amd64)
21 # Overridable as a user may want to use -fstack-protector-all
22 SSP_CFLAGS?=    -fstack-protector
23 CFLAGS+=        ${SSP_CFLAGS}
24 LDFLAGS+=       -fstack-protector
25 # -lssp_nonshared is needed on i386 where /usr/lib/libc.so is not an ldscript
26 # This is currently unused XXX
27 .       if defined(SSP_NEED_NONSHARED)
28 LDFLAGS+=       -lssp_nonshared
29 .       endif
30 .endif