summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2018-04-07 11:40:14 +0100
committerSergei Trofimovich <slyfox@gentoo.org>2018-04-07 11:42:41 +0100
commitb023986de7d466d361798bae98f45f8ba7a42e8a (patch)
treee1bffa55ae2ba9a1eb0f1c662e51dce7a16a48bb /sys-devel/binutils/binutils-9999.ebuild
parentmedia-libs/libvorbis: stable 1.3.6 for sparc (diff)
downloadgentoo-b023986de7d466d361798bae98f45f8ba7a42e8a.tar.gz
gentoo-b023986de7d466d361798bae98f45f8ba7a42e8a.tar.bz2
gentoo-b023986de7d466d361798bae98f45f8ba7a42e8a.zip
sys-devel/binutils: fix ldscrips ${CTARGET} search path, bug #147155
This change fixes long-standing search path issue in Gentoo's binutils: Before the change search path was the following: /usr/${CTARGET}/lib/ldscripts Note: it points to $SYSROOT, not to native cross-tools. After the change search path is the following: /usr/${CHOST}/${CTARGET}/lib/ldscripts Added two notes to the ebuild on how things are supposed to work: - Note [slotting support] - Note [tooldir hack for ldscripts] Applied change to 2.30-r1 and live ebuilds. Reported-by: Heiko Rosemann Closes: https://bugs.gentoo.org/147155 Package-Manager: Portage-2.3.28, Repoman-2.3.9
Diffstat (limited to 'sys-devel/binutils/binutils-9999.ebuild')
-rw-r--r--sys-devel/binutils/binutils-9999.ebuild36
1 files changed, 33 insertions, 3 deletions
diff --git a/sys-devel/binutils/binutils-9999.ebuild b/sys-devel/binutils/binutils-9999.ebuild
index f0c8730c8197..1c3f3623a947 100644
--- a/sys-devel/binutils/binutils-9999.ebuild
+++ b/sys-devel/binutils/binutils-9999.ebuild
@@ -146,10 +146,11 @@ src_configure() {
INCPATH=${LIBPATH}/include
DATAPATH=/usr/share/binutils-data/${CTARGET}/${BVER}
if is_cross ; then
- BINPATH=/usr/${CHOST}/${CTARGET}/binutils-bin/${BVER}
+ TOOLPATH=/usr/${CHOST}/${CTARGET}
else
- BINPATH=/usr/${CTARGET}/binutils-bin/${BVER}
+ TOOLPATH=/usr/${CTARGET}
fi
+ BINPATH=${TOOLPATH}/binutils-bin/${BVER}
# Make sure we filter $LINGUAS so that only ones that
# actually work make it through #42033
@@ -251,7 +252,8 @@ src_configure() {
src_compile() {
cd "${MY_BUILDDIR}"
- emake all
+ # see Note [tooldir hack for ldscripts]
+ emake tooldir="${EPREFIX}${TOOLPATH}" all
# only build info pages if the user wants them
if use doc ; then
@@ -272,6 +274,7 @@ src_install() {
local x d
cd "${MY_BUILDDIR}"
+ # see Note [tooldir hack for ldscripts]
emake DESTDIR="${D}" tooldir="${EPREFIX}${LIBPATH}" install
rm -rf "${ED}"/${LIBPATH}/bin
use static-libs || find "${ED}" -name '*.la' -delete
@@ -380,3 +383,30 @@ pkg_postrm() {
binutils-config ${CTARGET}-${BVER}
fi
}
+
+# Note [slotting support]
+# -----------------------
+# Gentoo's layout for binutils files is non-standard as Gentoo
+# supports slotted installation for binutils. But many tools
+# still expect binutils to reside in known locations.
+# binutils-config package restores symlinks into known locations,
+# like:
+# /usr/bin/${CTARGET}-<tool>
+# /usr/bin/${CHOST}/${CTARGET}/lib/ldscrips
+# /usr/include/
+#
+# Note [tooldir hack for ldscripts]
+# ---------------------------------
+# Build system does not ./configure to tweak evey location we need
+# for slotting binutils. This note is about SCRIPTDIR define.
+#
+# SCRIPDIR defines 'ldscripts/' directory location. SCRIPDIR value
+# is set at build-time in ld/Makefile.am as: 'scriptdir = $(tooldir)/lib'
+# and hardcoded as -DSCRIPTDIR='"$(scriptdir)"' at compile time.
+# Thus we can't just move files around after compilation finished.
+#
+# Our goal is the following:
+# - at build-time set scriptdir to point to symlinked location:
+# ${TOOLPATH}: /usr/${CHOST} (or /usr/${CHOST}/${CTARGET} for cross-case)
+# - at install-time set scriptdir to point to slotted location:
+# ${LIBPATH}: /usr/$(get_libdir)/binutils/${CTARGET}/${BVER}