? glibc-ldflags-multilib.patch Index: Manifest =================================================================== RCS file: /var/cvsroot/gentoo-x86/sys-libs/glibc/Manifest,v retrieving revision 1.1406 diff -u -b -B -r1.1406 Manifest Index: files/eblits/common.eblit =================================================================== RCS file: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/common.eblit,v retrieving revision 1.25 diff -u -b -B -r1.25 common.eblit --- files/eblits/common.eblit 22 Dec 2011 01:09:58 -0000 1.25 +++ files/eblits/common.eblit 10 Jan 2012 01:16:41 -0000 @@ -141,6 +141,7 @@ CXXFLAGS=${CXXFLAGS_BASE} ASFLAGS_BASE=${ASFLAGS_BASE-${ASFLAGS}} ASFLAGS=${ASFLAGS_BASE} + LDFLAGS=${LDFLAGS_BASE:=${LDFLAGS}} # Over-zealous CFLAGS can often cause problems. What may work for one # person may not work for another. To avoid a large influx of bugs @@ -148,7 +149,8 @@ # problems as possible. strip-flags strip-unsupported-flags - filter-flags -m32 -m64 -mabi=* + filter-flags -m32 -m64 -mx32 -mabi=* + filter-ldflags -m32 -m64 -mx32 -mabi=* unset CBUILD_OPT CTARGET_OPT if has_multilib_profile ; then @@ -267,17 +269,25 @@ CFLAGS=${!VAR-${CFLAGS}} fi + # Reverts CFLAGS and friends to their original values. setup_flags export ABI=${ABI:-${DEFAULT_ABI:-default}} local VAR=CFLAGS_${ABI} - # We need to export CFLAGS with abi information in them because glibc's - # configure script checks CFLAGS for some targets (like mips). Keep - # around the original clean value to avoid appending multiple ABIs on - # top of each other. + # We need to export CC+CFLAGS with abi information in them because glibc's + # configure script checks CC+CFLAGS for some targets (like mips). Keep + # around the original clean values to avoid appending multiple ABIs on top + # of each other (setup_flags() manages keeping the original CFLAGS/LDFLAGS + # values). : ${__GLIBC_CC:=$(tc-getCC ${CTARGET_OPT:-${CTARGET}})} - export __GLIBC_CC CC="${__GLIBC_CC} ${!VAR}" + CFLAGS="${CFLAGS} ${!VAR}" + CXXFLAGS="${CXXFLAGS} ${!VAR}" + ASFLAGS="${ASFLAGS} ${!VAR}" + # Because many _other_ packages ignore CFLAGS when linking, people have had + # to put -m32, etc. into LDFLAGS -- override here. + LDFLAGS="${LDFLAGS} ${!VAR}" + export __GLIBC_CC CC="${__GLIBC_CC} ${!VAR}" CFLAGS } just_headers() { Index: files/eblits/src_compile.eblit =================================================================== RCS file: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/src_compile.eblit,v retrieving revision 1.21 diff -u -b -B -r1.21 src_compile.eblit --- files/eblits/src_compile.eblit 12 Dec 2011 17:47:28 -0000 1.21 +++ files/eblits/src_compile.eblit 10 Jan 2012 01:16:41 -0000 @@ -105,7 +105,7 @@ toolchain-glibc_src_compile() { echo local v - for v in ABI CBUILD CHOST CTARGET CBUILD_OPT CTARGET_OPT CC CFLAGS ; do + for v in ABI CBUILD CHOST CTARGET CBUILD_OPT CTARGET_OPT CC CFLAGS CPPFLAGS LDFLAGS ; do einfo " $(printf '%15s' ${v}:) ${!v}" done export CC=$(tc-getCC ${CTARGET}) @@ -170,6 +170,7 @@ CC=gcc \ CFLAGS="-O1 -pipe" \ CPPFLAGS="-U_FORTIFY_SOURCE" \ + LDFLAGS="" \ "${S}"/configure ${myconf} || die "failed to configure glibc" }