From: Mike Frysinger Date: Tue, 6 Dec 2011 04:50:32 +0000 (+0000) Subject: drop {PIE,SSP}_UNSUPPORTED variable checking since no one sets these, and it relies... X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=e0a3da616a73da1229ed361054008905f913aafa;p=gentoo.git drop {PIE,SSP}_UNSUPPORTED variable checking since no one sets these, and it relies on checking $ACCEPT_KEYWORDS which portage no longer exports --- diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass index cf16ef3bcc14..6d85d9f290b9 100644 --- a/eclass/toolchain.eclass +++ b/eclass/toolchain.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.495 2011/12/06 04:15:10 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.496 2011/12/06 04:50:32 vapier Exp $ # # Maintainer: Toolchain Ninjas @@ -343,24 +343,14 @@ hardened_gcc_works() { [[ ${CTARGET} == *-freebsd* ]] && return 1 want_pie || return 1 - tc_version_is_at_least 4.3.2 && use nopie && return 1 - hardened_gcc_is_stable pie && return 0 - if has "~$(tc-arch)" ${ACCEPT_KEYWORDS} ; then - hardened_gcc_check_unsupported pie && return 1 - ewarn "Allowing pie-by-default for an unstable arch ($(tc-arch))" - return 0 - fi - return 1 + use_if_iuse nopie && return 1 + hardened_gcc_is_stable pie + return $? elif [[ $1 == "ssp" ]] ; then [[ -n ${SPECS_VER} ]] || return 1 - tc_version_is_at_least 4.3.2 && use nossp && return 1 - hardened_gcc_is_stable ssp && return 0 - if has "~$(tc-arch)" ${ACCEPT_KEYWORDS} ; then - hardened_gcc_check_unsupported ssp && return 1 - ewarn "Allowing ssp-by-default for an unstable arch ($(tc-arch))" - return 0 - fi - return 1 + use_if_iuse no$1 && return 1 + hardened_gcc_is_stable ssp + return $? else # laziness ;) hardened_gcc_works pie || return 1 @@ -394,36 +384,6 @@ hardened_gcc_is_stable() { return 1 } -hardened_gcc_check_unsupported() { - local tocheck="" - # if a variable is unset, we assume that all archs are unsupported. since - # this function is never called if hardened_gcc_is_stable returns true, - # this shouldn't cause problems... however, allowing this logic to work - # even with the variables unset will break older ebuilds that dont use them. - if [[ $1 == "pie" ]] ; then - if [[ ${CTARGET} == *-uclibc* ]] ; then - [[ -z ${PIE_UCLIBC_UNSUPPORTED} ]] && return 0 - tocheck="${tocheck} ${PIE_UCLIBC_UNSUPPORTED}" - else - [[ -z ${PIE_GLIBC_UNSUPPORTED} ]] && return 0 - tocheck="${tocheck} ${PIE_GLIBC_UNSUPPORTED}" - fi - elif [[ $1 == "ssp" ]] ; then - if [[ ${CTARGET} == *-uclibc* ]] ; then - [[ -z ${SSP_UCLIBC_UNSUPPORTED} ]] && return 0 - tocheck="${tocheck} ${SSP_UCLIBC_UNSUPPORTED}" - else - [[ -z ${SSP_UNSUPPORTED} ]] && return 0 - tocheck="${tocheck} ${SSP_UNSUPPORTED}" - fi - else - die "hardened_gcc_check_unsupported needs to be called with pie or ssp" - fi - - has $(tc-arch) ${tocheck} && return 0 - return 1 -} - _want_stuff() { local var=$1 flag=$2 [[ -z ${!var} ]] && return 1