Hi,

tried a different way with exciting success:

Attached sys-devel/binutils-2.16.1-r3.ebuild creates a wrapper script
around the real linker, which always appends to ld-commandline:
-rpath=$EPREFIX/lib:$EPREFIX/usr/lib

So I can remove setting LD_RUN_PATH and LDFLAGS completely from
sunos/profile.bashrc, going around any "whether need -Wl," and "LDFLAGS
are not passed to linker" issues.

Have remerged system+vim+svn, and all binaries really have good
DT_RUNPATH encoded now :-)

Thoughts ?

/haubi/

On Fri, 2006-11-24 at 17:25 +0100, Michael Haubenwallner wrote:
> Hi,
> 
> attached is my profiles/default-sunos/profile.bashrc with descriptions
> why things are done. Thanks for comments!
> 
> Using this one, I'm very happy to have successfully emerged system and a
> working vim now :-)
> 
> /haubi/ -> weekend
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: 
/var/cvsroot/gentoo-x86/sys-devel/binutils/binutils-2.16.1-r3.ebuild,v 1.7 
2006/09/16 21:53:51 vapier Exp $

EAPI="prefix"

PATCHVER="1.11"
UCLIBC_PATCHVER="1.1"
ELF2FLT_VER=""
inherit toolchain-binutils

KEYWORDS="~x86 ~x86-solaris"

src_unpack() {
        tc-binutils_unpack

        cd "${WORKDIR}"/patch
        # playstation2 patches are not safe for other mips targets
        mv *playstation2* skip/

        tc-binutils_apply_patches

        cd ${S}
        epatch "${FILESDIR}"/${PN}-2.16-solaris10.patch
}

src_install() {
        toolchain-binutils_src_install

        if use userland_Solaris && [[ ${CHOST} == ${CTARGET} ]]; then
                mv ${ED}${BINPATH}/ld{,.real} || die
                cat >${ED}${BINPATH}/ld <<-EOF
                        #! /bin/sh
                        exec "${EPREFIX}${BINPATH}/ld.real" "\$@" 
-rpath=${EPREFIX}/lib:${EPREFIX}/usr/lib
                EOF
                chmod +x ${ED}/${BINPATH}/ld || die
        fi
}
# for as long as our tree isn't sane yet, prevent from having files
# installed into the live filesystem for non-sandbox people
export EDEST=${D}/fix/your/EDEST

unset LD_LIBRARY_PATH LD_LIBRARY_PATH_32 LD_LIBRARY_PATH_64

# The linker in a prefixed system should look first in the prefix
# directories (search path), then the (foreign) system directories
#
# This is done by a wrapper script for GNU ld, passing -rpath always.

Reply via email to