From 04f38d64d1e20488d42d575e7fd3cd7b1ae15404 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 6 Dec 2011 20:11:50 +0000 Subject: [PATCH] fix multilib assumptions when setting up LDPATH (that there is only "32" and "64" subdirs), and make it work regardless of active profile --- eclass/toolchain.eclass | 49 ++++++++++++++--------------------------- 1 file changed, 16 insertions(+), 33 deletions(-) diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass index 9e885b4b0646..218024b82995 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.502 2011/12/06 05:22:24 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.503 2011/12/06 20:11:50 vapier Exp $ # # Maintainer: Toolchain Ninjas @@ -468,39 +468,21 @@ create_gcc_env_entry() { echo "ROOTPATH=\"${BINPATH}\"" >> ${gcc_envd_file} echo "GCC_PATH=\"${BINPATH}\"" >> ${gcc_envd_file} - if is_multilib ; then - LDPATH="${LIBPATH}" - for path in 32 64 ; do - [[ -d ${D}${LIBPATH}/${path} ]] && LDPATH="${LDPATH}:${LIBPATH}/${path}" - done - else - local MULTIDIR - LDPATH="${LIBPATH}" - - # We want to list the default ABI's LIBPATH first so libtool - # searches that directory first. This is a temporary - # workaround for libtool being stupid and using .la's from - # conflicting ABIs by using the first one in the search path - - local abi=${DEFAULT_ABI} - local MULTIDIR=$($(XGCC) $(get_abi_CFLAGS ${abi}) --print-multi-directory) - if [[ ${MULTIDIR} == "." ]] ; then - LDPATH=${LIBPATH} - else - LDPATH=${LIBPATH}/${MULTIDIR} - fi - - for abi in $(get_all_abis) ; do - [[ ${abi} == ${DEFAULT_ABI} ]] && continue + # We want to list the default ABI's LIBPATH first so libtool + # searches that directory first. This is a temporary + # workaround for libtool being stupid and using .la's from + # conflicting ABIs by using the first one in the search path + local abi=${DEFAULT_ABI} + local MULTIDIR=$($(XGCC) $(get_abi_CFLAGS ${abi}) --print-multi-directory) + local LDPATH=${LIBPATH} + [[ ${MULTIDIR} != "." ]] && LDPATH+=/${MULTIDIR} + for abi in $(get_all_abis) ; do + [[ ${abi} == ${DEFAULT_ABI} ]] && continue - MULTIDIR=$($(XGCC) $(get_abi_CFLAGS ${abi}) --print-multi-directory) - if [[ ${MULTIDIR} == "." ]] ; then - LDPATH=${LDPATH}:${LIBPATH} - else - LDPATH=${LDPATH}:${LIBPATH}/${MULTIDIR} - fi - done - fi + MULTIDIR=$($(XGCC) $(get_abi_CFLAGS ${abi}) --print-multi-directory) + LDPATH+=:${LIBPATH} + [[ ${MULTIDIR} != "." ]] && LDPATH+=/${MULTIDIR} + done echo "LDPATH=\"${LDPATH}\"" >> ${gcc_envd_file} echo "MANPATH=\"${DATAPATH}/man\"" >> ${gcc_envd_file} @@ -1381,6 +1363,7 @@ gcc_do_filter_flags() { } toolchain_src_compile() { + multilib_env ${CTARGET} gcc_do_filter_flags einfo "CFLAGS=\"${CFLAGS}\"" einfo "CXXFLAGS=\"${CXXFLAGS}\"" -- 2.26.2