summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin F. Quinn <kevquinn@gentoo.org>2007-03-27 17:12:15 +0000
committerKevin F. Quinn <kevquinn@gentoo.org>2007-03-27 17:12:15 +0000
commitc6215a63d9d17ebbfe4b7a9cab6cbfa6514b9136 (patch)
tree77e0dddb9caf949bee4ff0388d0db7455e68691a
parentAdded patch from vapier to get CPPFLAGS working - and use that instead of bot... (diff)
downloadkevquinn-c6215a63d9d17ebbfe4b7a9cab6cbfa6514b9136.tar.gz
kevquinn-c6215a63d9d17ebbfe4b7a9cab6cbfa6514b9136.tar.bz2
kevquinn-c6215a63d9d17ebbfe4b7a9cab6cbfa6514b9136.zip
Align eclasses to gentoo-x86 2007-03-27, also includes experimental hardened
filter override function. svn path=/; revision=198
-rw-r--r--hardened/toolchain/branches/pieworld/eclass/flag-o-matic.eclass27
-rw-r--r--hardened/toolchain/branches/pieworld/eclass/toolchain-funcs.eclass5
-rw-r--r--hardened/toolchain/branches/pieworld/eclass/toolchain.eclass7
3 files changed, 30 insertions, 9 deletions
diff --git a/hardened/toolchain/branches/pieworld/eclass/flag-o-matic.eclass b/hardened/toolchain/branches/pieworld/eclass/flag-o-matic.eclass
index 41fad08..a5f0103 100644
--- a/hardened/toolchain/branches/pieworld/eclass/flag-o-matic.eclass
+++ b/hardened/toolchain/branches/pieworld/eclass/flag-o-matic.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2007 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.117 2007/03/04 21:13:17 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v 1.118 2007/03/24 07:07:18 vapier Exp $
#
# Maintainer: toolchain@gentoo.org
@@ -122,11 +122,27 @@ setup-allowed-flags() {
return 0
}
+# Return true if the HFILTER_CONTROL permits the requested filter
+# _hfilterok <category/pf> <pie|ssp|relro|now>
+_hfilter_allowed() {
+ [[ -z ${HFILTER_CONTROL} ]] && return 0
+ [[ $(awk -v CPF="$1" -v TYPE="$2" 'BEGIN { ok=0 }
+$1=="allow" && CPF~$2 && TYPE==$3 { ok=0 }
+$1=="deny" && CPF~$2 && TYPE==$3 { ok=1 }
+END { print ok }' ${HFILTER_CONTROL}) == 0 ]]
+}
+
# Internal function for _filter-hardened
# _manage_hardened <flag being filtered> <minispec to use> <cflag to use>
_manage-hardened() {
local filter=$1 newspec=$2
[[ -z $3 ]] && die "Internal flag-o-matic error ($*) - please report"
+
+ if ! $(_hfilter_allowed ${CATEGORY}/${PF} ${newspec/no}); then
+ einfo "Hardened compiler filter $1 requested by ebuild - ignored by request in ${HFILTER_CONTROL}"
+ return 0
+ fi
+
if _gcc-specs-exists ${newspec}.specs; then
[[ -z ${GCC_SPECS} ]] || newspec=":${newspec}"
export GCC_SPECS="${GCC_SPECS}${newspec}.specs"
@@ -221,6 +237,7 @@ _filter-var() {
filter-flags() {
_filter-hardened "$@"
_filter-var CFLAGS "$@"
+ _filter-var CPPFLAGS "$@"
_filter-var CXXFLAGS "$@"
return 0
}
@@ -230,9 +247,15 @@ filter-lfs-flags() {
filter-flags -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
}
+append-cppflags() {
+ [[ -z $* ]] && return 0
+ export CPPFLAGS="${CPPFLAGS} $*"
+ return 0
+}
+
append-lfs-flags() {
[[ -n $@ ]] && die "append-lfs-flags takes no arguments"
- append-flags -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
+ append-cppflags -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
}
# Append flag if the compiler doesn't barf it
diff --git a/hardened/toolchain/branches/pieworld/eclass/toolchain-funcs.eclass b/hardened/toolchain/branches/pieworld/eclass/toolchain-funcs.eclass
index c3e8bd6..851065f 100644
--- a/hardened/toolchain/branches/pieworld/eclass/toolchain-funcs.eclass
+++ b/hardened/toolchain/branches/pieworld/eclass/toolchain-funcs.eclass
@@ -1,13 +1,14 @@
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain-funcs.eclass,v 1.68 2007/03/15 15:55:59 kevquinn Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain-funcs.eclass,v 1.69 2007/03/27 01:46:50 vapier Exp $
#
# Maintainer: Toolchain Ninjas <toolchain@gentoo.org>
#
# This eclass contains (or should) functions to get common info
# about the toolchain (libc/compiler/binutils/etc...)
-inherit multilib
+___ECLASS_RECUR_TOOLCHAIN_FUNCS="yes"
+[[ -z ${___ECLASS_RECUR_MULTILIB} ]] && inherit multilib
DESCRIPTION="Based on the ${ECLASS} eclass"
diff --git a/hardened/toolchain/branches/pieworld/eclass/toolchain.eclass b/hardened/toolchain/branches/pieworld/eclass/toolchain.eclass
index a79851f..2285241 100644
--- a/hardened/toolchain/branches/pieworld/eclass/toolchain.eclass
+++ b/hardened/toolchain/branches/pieworld/eclass/toolchain.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.331 2007/03/10 13:40:51 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.332 2007/03/24 06:46:33 vapier Exp $
#
# Maintainer: Toolchain Ninjas <toolchain@gentoo.org>
@@ -2421,10 +2421,7 @@ disgusting_gcc_multilib_HACK() {
;;
esac
else
- # Remove this hunk when amd64's 2004.3 is purged from portage.
- use amd64 || die "Your profile is no longer supported by portage."
- config="i386/t-linux64"
- libdirs="../$(get_libdir) ../$(get_multilibdir)"
+ die "Your profile is no longer supported by portage."
fi
einfo "updating multilib directories to be: ${libdirs}"