summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorNed Ludd <solar@gentoo.org>2005-04-28 20:06:00 +0000
committerNed Ludd <solar@gentoo.org>2005-04-28 20:06:00 +0000
commitfeb2e0cd3614584738d7bff7e5a7de930c66323b (patch)
tree12b39caca7cec6f113fdbff9763393999a96f883 /eclass
parentStable on sparc (diff)
downloadgentoo-2-feb2e0cd3614584738d7bff7e5a7de930c66323b.tar.gz
gentoo-2-feb2e0cd3614584738d7bff7e5a7de930c66323b.tar.bz2
gentoo-2-feb2e0cd3614584738d7bff7e5a7de930c66323b.zip
- update has_pic to not test for pie. add has_ssp_all and comments. Kevin F. Quinn
Diffstat (limited to 'eclass')
-rw-r--r--eclass/flag-o-matic.eclass23
1 files changed, 21 insertions, 2 deletions
diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass
index 06c6728fcaa4..6147cdd054e4 100644
--- a/eclass/flag-o-matic.eclass
+++ b/eclass/flag-o-matic.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v 1.85 2005/04/06 23:29:23 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v 1.86 2005/04/28 20:06:00 solar Exp $
ECLASS=flag-o-matic
INHERITED="$INHERITED $ECLASS"
@@ -63,6 +63,18 @@ inherit eutils toolchain-funcs multilib
# notice: modern automatic specs files will also suppress -fstack-protector-all
# when only -fno-stack-protector is given
#
+#### has_pic ####
+# Returns true if the compiler by default or with current CFLAGS
+# builds position-independent code.
+#
+#### has_ssp_all ####
+# Returns true if the compiler by default or with current CFLAGS
+# generates stack smash protections for all functions
+#
+#### has_ssp ####
+# Returns true if the compiler by default or with current CFLAGS
+# generates stack smash protections for most vulnerable functions
+#
# C[XX]FLAGS that we allow in strip-flags
setup-allowed-flags() {
@@ -326,7 +338,6 @@ has_pic() {
[ "${CFLAGS/-fPIC}" != "${CFLAGS}" ] && return 0
[ "${CFLAGS/-fpic}" != "${CFLAGS}" ] && return 0
[ "$(echo | $(tc-getCC) ${CFLAGS} -E -dM - | grep __PIC__)" ] && return 0
- test_version_info pie && return 0
return 1
}
@@ -340,6 +351,14 @@ has_pie() {
return 1
}
+# indicate whether code for SSP is being generated for all functions
+has_ssp_all() {
+ # note; this matches only -fstack-protector-all
+ [ "${CFLAGS/-fstack-protector-all}" != "${CFLAGS}" ] && return 0
+ [ "$(echo | $(tc-getCC) ${CFLAGS} -E -dM - | grep __SSP_ALL__)" ] && return 0
+ return 1
+}
+
# indicate whether code for SSP is being generated
has_ssp() {
# note; this matches both -fstack-protector and -fstack-protector-all