Index: toolchain.eclass =================================================================== RCS file: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v retrieving revision 1.447 diff -u -r1.447 toolchain.eclass --- toolchain.eclass 11 Jan 2011 18:53:32 -0000 1.447 +++ toolchain.eclass 12 Jan 2011 04:01:46 -0000 @@ -1491,17 +1491,22 @@ # In addition to the target to be used, the following variables alter the # behavior of this function: # -# LDFLAGS -# Flags to pass to ld -# # STAGE1_CFLAGS -# CFLAGS to use during stage1 of a gcc bootstrap +# CFLAGS to use during stage1 of a gcc compile. # # BOOT_CFLAGS # CFLAGS to use during stages 2+3 of a gcc bootstrap. # -# Travis Tilley (04 Sep 2004) +# BOOT_LDFLAGS +# LDFLAGS to use during stages 2+3 of a gcc bootstrap. +# +# CFLAGS_FOR_TARGET +# CFLAGS used for building non-bootstrapped libs (eg. libgomp). # +# LDFLAGS_FOR_TARGET +# LDFLAGS used for building non-bootstrapped libs (eg. libgomp). +# + gcc_do_make() { # Fix for libtool-portage.patch local OLDS=${S} @@ -1532,24 +1537,24 @@ STAGE1_CFLAGS=${STAGE1_CFLAGS-"-O2"} fi - if is_crosscompile; then - # In 3.4, BOOT_CFLAGS is never used on a crosscompile... - # but I'll leave this in anyways as someone might have had - # some reason for putting it in here... --eradicator - BOOT_CFLAGS=${BOOT_CFLAGS-"-O2"} - else + if ! is_crosscompile; then # we only want to use the system's CFLAGS if not building a # cross-compiler. BOOT_CFLAGS=${BOOT_CFLAGS-"$(get_abi_CFLAGS) ${CFLAGS}"} + CFLAGS_FOR_TARGET=${CFLAGS_FOR_TARGET-"$(get_abi_CFLAGS) ${CFLAGS}"} + BOOT_LDFLAGS=${BOOT_LDFLAGS-"${LDFLAGS}"} + LDFLAGS_FOR_TARGET=${LDFLAGS_FOR_TARGET-"${LDFLAGS}"} fi pushd "${WORKDIR}"/build emake \ - LDFLAGS="${LDFLAGS}" \ - STAGE1_CFLAGS="${STAGE1_CFLAGS}" \ LIBPATH="${LIBPATH}" \ + STAGE1_CFLAGS="${STAGE1_CFLAGS}" \ BOOT_CFLAGS="${BOOT_CFLAGS}" \ + BOOT_LDFLAGS="${BOOT_LDFLAGS}" \ + CFLAGS_FOR_TARGET="${CFLAGS_FOR_TARGET}" \ + LDFLAGS_FOR_TARGET="${LDFLAGS_FOR_TARGET}" \ ${GCC_MAKE_TARGET} \ || die "emake failed with ${GCC_MAKE_TARGET}"