From 1467b61e8cf510c8f988dc0be878eef31c9cb60b Mon Sep 17 00:00:00 2001 From: "Kevin F. Quinn" Date: Thu, 10 May 2007 20:03:46 +0000 Subject: Align with gentoo-x86 4/5/2007 svn path=/; revision=201 --- .../branches/pieworld/eclass/flag-o-matic.eclass | 6 +++--- .../branches/pieworld/eclass/toolchain.eclass | 18 +++++++----------- hardened/toolchain/branches/pieworld/pieworld.README | 4 ++-- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/hardened/toolchain/branches/pieworld/eclass/flag-o-matic.eclass b/hardened/toolchain/branches/pieworld/eclass/flag-o-matic.eclass index a5f0103..6986692 100644 --- a/hardened/toolchain/branches/pieworld/eclass/flag-o-matic.eclass +++ b/hardened/toolchain/branches/pieworld/eclass/flag-o-matic.eclass @@ -94,15 +94,15 @@ inherit eutils toolchain-funcs multilib # C[XX]FLAGS that we allow in strip-flags # Note: shell globs and character lists are allowed setup-allowed-flags() { - if [[ -z ${ALLOWED_FLAGS} ]] ; then - export ALLOWED_FLAGS="-pipe" + #if [[ -z ${ALLOWED_FLAGS} ]] ; then + export ALLOWED_FLAGS="${ALLOWED_FLAGS} -pipe" export ALLOWED_FLAGS="${ALLOWED_FLAGS} -O -O0 -O1 -O2 -mcpu -march -mtune" export ALLOWED_FLAGS="${ALLOWED_FLAGS} -fstack-protector -fstack-protector-all" export ALLOWED_FLAGS="${ALLOWED_FLAGS} -fbounds-checking -fno-bounds-checking" export ALLOWED_FLAGS="${ALLOWED_FLAGS} -fno-PIE -fno-pie -fno-unit-at-a-time" export ALLOWED_FLAGS="${ALLOWED_FLAGS} -g -g[0-9] -ggdb -ggdb[0-9] -gstabs -gstabs+" export ALLOWED_FLAGS="${ALLOWED_FLAGS} -fno-ident" - fi + #fi # allow a bunch of flags that negate features / control ABI ALLOWED_FLAGS="${ALLOWED_FLAGS} -fno-stack-protector -fno-stack-protector-all" ALLOWED_FLAGS="${ALLOWED_FLAGS} -mregparm -mno-app-regs -mapp-regs \ diff --git a/hardened/toolchain/branches/pieworld/eclass/toolchain.eclass b/hardened/toolchain/branches/pieworld/eclass/toolchain.eclass index 2285241..75f3271 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.332 2007/03/24 06:46:33 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.333 2007/05/03 04:51:07 vapier Exp $ # # Maintainer: Toolchain Ninjas @@ -648,8 +648,10 @@ create_gcc_env_entry() { gcc_specs_file="${LIBPATH}/$1.specs" fi + # phase PATH/ROOTPATH out ... echo "PATH=\"${BINPATH}\"" > ${gcc_envd_file} echo "ROOTPATH=\"${BINPATH}\"" >> ${gcc_envd_file} + echo "GCC_PATH=\"${BINPATH}\"" >> ${gcc_envd_file} if use multilib && ! has_multilib_profile; then LDPATH="${LIBPATH}" @@ -2208,9 +2210,6 @@ do_gcc_PIE_patches() { } should_we_gcc_config() { - # we only want to switch compilers if installing to / or /tmp/stage1root - [[ ${ROOT} == "/" || ${ROOT} == "/tmp/stage1root" ]] || return 1 - # we always want to run gcc-config if we're bootstrapping, otherwise # we might get stuck with the c-only stage1 compiler use bootstrap && return 0 @@ -2219,12 +2218,12 @@ should_we_gcc_config() { # if the current config is invalid, we definitely want a new one # Note: due to bash quirkiness, the following must not be 1 line local curr_config - curr_config=$(env -i gcc-config -c ${CTARGET} 2>&1) || return 0 + curr_config=$(env -i ROOT="${ROOT}" gcc-config -c ${CTARGET} 2>&1) || return 0 # if the previously selected config has the same major.minor (branch) as # the version we are installing, then it will probably be uninstalled # for being in the same SLOT, make sure we run gcc-config. - local curr_config_ver=$(env -i gcc-config -S ${curr_config} | awk '{print $2}') + local curr_config_ver=$(env -i ROOT="${ROOT}" gcc-config -S ${curr_config} | awk '{print $2}') local curr_branch_ver=$(get_version_component_range 1-2 ${curr_config_ver}) @@ -2256,14 +2255,14 @@ should_we_gcc_config() { do_gcc_config() { if ! should_we_gcc_config ; then - env -i gcc-config --use-old --force + env -i ROOT="${ROOT}" gcc-config --use-old --force return 0 fi local current_gcc_config="" current_specs="" use_specs="" # We grep out any possible errors - current_gcc_config=$(env -i gcc-config -c ${CTARGET} | grep -v '^ ') + current_gcc_config=$(env -i ROOT="${ROOT}" gcc-config -c ${CTARGET} | grep -v '^ ') if [[ -n ${current_gcc_config} ]] ; then # figure out which specs-specific config is active current_specs=$(gcc-config -S ${current_gcc_config} | awk '{print $3}') @@ -2286,9 +2285,6 @@ do_gcc_config() { } should_we_eselect_compiler() { - # we only want to switch compilers if installing to / or /tmp/stage1root - [[ ${ROOT} == "/" || ${ROOT} == "/tmp/stage1root" ]] || return 1 - # we always want to run gcc-config if we're bootstrapping, otherwise # we might get stuck with the c-only stage1 compiler use bootstrap && return 0 diff --git a/hardened/toolchain/branches/pieworld/pieworld.README b/hardened/toolchain/branches/pieworld/pieworld.README index 30efac6..973e062 100644 --- a/hardened/toolchain/branches/pieworld/pieworld.README +++ b/hardened/toolchain/branches/pieworld/pieworld.README @@ -32,10 +32,10 @@ Upgrade path 1) emerge --oneshot =sys-devel/binutils-2.17 2) Switch to 2.17 binutils (binutils-config) 3) Switch to vanilla compiler (gcc-config) -4) USE="-hardened" emerge --oneshot =sys-libs/glibc-2.5-r1 +4) USE="-hardened" emerge --oneshot =sys-libs/glibc-2.5-r2 5) USE="-hardened" emerge --oneshot =sys-devel/gcc-4.1.2-r1 6) switch to hardened compiler -7) emerge --oneshot =sys-libs/glibc-2.5-r1 +7) emerge --oneshot =sys-libs/glibc-2.5-r2 8) emerge --oneshot =sys-devel/gcc-4.1.2-r1 9) emerge -e world :) -- cgit v1.2.3-65-gdbad