summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorTravis Tilley <lv@gentoo.org>2004-09-13 17:32:34 +0000
committerTravis Tilley <lv@gentoo.org>2004-09-13 17:32:34 +0000
commit13fbab10b6087a2d6125aa9845b2b9c51329f3f8 (patch)
tree48c7d5d919e025860b818d3e2f7bf049388df8b1 /eclass
parentfix #63888 to compile with pcap correctly (Manifest recommit) (diff)
downloadgentoo-2-13fbab10b6087a2d6125aa9845b2b9c51329f3f8.tar.gz
gentoo-2-13fbab10b6087a2d6125aa9845b2b9c51329f3f8.tar.bz2
gentoo-2-13fbab10b6087a2d6125aa9845b2b9c51329f3f8.zip
toolchain.eclass support for splitting out multiple specs files, activated by SPLIT_SPECS="true" in a gcc-compiler ETYPE ebuild
Diffstat (limited to 'eclass')
-rw-r--r--eclass/toolchain.eclass52
1 files changed, 51 insertions, 1 deletions
diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index f040c49aeb31..2ef01f8e20d7 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.14 2004/09/12 20:21:14 lv Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.15 2004/09/13 17:32:34 lv Exp $
#
# This eclass should contain general toolchain-related functions that are
# expected to not change, or change much.
@@ -438,6 +438,52 @@ make_gcc_hard() {
}
+create_vanilla_specs_file() {
+ pushd ${WORKDIR}/build/gcc > /dev/null
+ if use hardened ; then
+ # if using hardened, then we need to move xgcc out of the way
+ # and recompile it
+ sed -i -e 's#ALL_CFLAGS = -DEFAULT_PIE_SSP#ALL_CFLAGS = #' Makefile
+ mv xgcc xgcc.hard
+ rm gcc.o
+ make xgcc
+ einfo "Creating a vanilla gcc specs file"
+ ./xgcc -dumpspecs > ${WORKDIR}/build/vanilla.specs
+ mv xgcc.hard xgcc
+ else
+ einfo "Creating a vanilla gcc specs file"
+ ./xgcc -dumpspecs > ${WORKDIR}/build/vanilla.specs
+ fi
+ popd > /dev/null
+}
+
+
+create_hardened_specs_file() {
+ pushd ${WORKDIR}/build/gcc > /dev/null
+ if use !hardened ; then
+ # if not using hardened, then we need to move xgcc out of the way
+ # and recompile it
+ sed -i -e 's#ALL_CFLAGS = #ALL_CFLAGS = -DEFAULT_PIE_SSP #' Makefile
+ mv xgcc xgcc.vanilla
+ rm gcc.o
+ make xgcc
+ einfo "Creating a hardened gcc specs file"
+ ./xgcc -dumpspecs > ${WORKDIR}/build/hardened.specs
+ mv xgcc.vanilla xgcc
+ else
+ einfo "Creating a hardened gcc specs file"
+ ./xgcc -dumpspecs > ${WORKDIR}/build/hardened.specs
+ fi
+ popd > /dev/null
+}
+
+
+split_out_specs_files() {
+ create_vanilla_specs_file || die "failed to split out vanilla specs"
+ create_hardened_specs_file || die "failes to split out hardened specs"
+}
+
+
# This function allows us to gentoo-ize gcc's version number and bugzilla
# URL without needing to use patches.
#
@@ -964,6 +1010,10 @@ gcc_src_compile() {
einfo "Compiling ${PN}..."
gcc_do_make ${GCC_MAKE_TARGET}
+ if [ "${ETYPE}" == "gcc-compiler" -a "${SPLIT_SPECS}" == "true" ] ; then
+ split_out_specs_files || die "failed to split out specs"
+ fi
+
popd > /dev/null
}