diff options
author | Ned Ludd <solar@gentoo.org> | 2005-04-28 20:06:00 +0000 |
---|---|---|
committer | Ned Ludd <solar@gentoo.org> | 2005-04-28 20:06:00 +0000 |
commit | 26d1c5e4f2c293c0659998e8e2972a5ef542df68 (patch) | |
tree | 9fa59fac390baa312b750cf283f55137b03350ff /eclass/flag-o-matic.eclass | |
parent | Stable on sparc (diff) | |
download | historical-26d1c5e4f2c293c0659998e8e2972a5ef542df68.tar.gz historical-26d1c5e4f2c293c0659998e8e2972a5ef542df68.tar.bz2 historical-26d1c5e4f2c293c0659998e8e2972a5ef542df68.zip |
- update has_pic to not test for pie. add has_ssp_all and comments. Kevin F. Quinn
Diffstat (limited to 'eclass/flag-o-matic.eclass')
-rw-r--r-- | eclass/flag-o-matic.eclass | 23 |
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 |