From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 09AA71382C5 for ; Sat, 7 Apr 2018 10:43:15 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 44217E08DF; Sat, 7 Apr 2018 10:43:14 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 0ABB0E08DF for ; Sat, 7 Apr 2018 10:43:13 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 0FA58335C59 for ; Sat, 7 Apr 2018 10:43:11 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 52A02272 for ; Sat, 7 Apr 2018 10:43:09 +0000 (UTC) From: "Sergei Trofimovich" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sergei Trofimovich" Message-ID: <1523097761.b023986de7d466d361798bae98f45f8ba7a42e8a.slyfox@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sys-devel/binutils/ X-VCS-Repository: repo/gentoo X-VCS-Files: sys-devel/binutils/binutils-2.30-r1.ebuild sys-devel/binutils/binutils-9999.ebuild X-VCS-Directories: sys-devel/binutils/ X-VCS-Committer: slyfox X-VCS-Committer-Name: Sergei Trofimovich X-VCS-Revision: b023986de7d466d361798bae98f45f8ba7a42e8a X-VCS-Branch: master Date: Sat, 7 Apr 2018 10:43:09 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 276653c9-dd0e-4b12-abbe-3d92fec9b8f1 X-Archives-Hash: dfdd841e8422eb1b614256e2ad760847 commit: b023986de7d466d361798bae98f45f8ba7a42e8a Author: Sergei Trofimovich gentoo org> AuthorDate: Sat Apr 7 10:40:14 2018 +0000 Commit: Sergei Trofimovich gentoo org> CommitDate: Sat Apr 7 10:42:41 2018 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b023986d 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 ...inutils-9999.ebuild => binutils-2.30-r1.ebuild} | 41 +++++++++++++++++++--- sys-devel/binutils/binutils-9999.ebuild | 36 +++++++++++++++++-- 2 files changed, 70 insertions(+), 7 deletions(-) diff --git a/sys-devel/binutils/binutils-9999.ebuild b/sys-devel/binutils/binutils-2.30-r1.ebuild similarity index 85% copy from sys-devel/binutils/binutils-9999.ebuild copy to sys-devel/binutils/binutils-2.30-r1.ebuild index f0c8730c819..145bbe7e290 100644 --- a/sys-devel/binutils/binutils-9999.ebuild +++ b/sys-devel/binutils/binutils-2.30-r1.ebuild @@ -19,6 +19,8 @@ IUSE="+cxx doc multitarget +nls static-libs test" # for the patchsets # Default: dilfridge :) +PATCH_VER=1 + case ${PV} in 9999) BVER="git" @@ -29,10 +31,11 @@ case ${PV} in ;; *) BVER=${PV} - SRC_URI="mirror://gnu/binutils/binutils-${BVER}.tar.xz" + SRC_URI="mirror://gnu/binutils/binutils-${BVER}.tar.xz https://sourceware.org/pub/binutils/releases/binutils-${BVER}.tar.xz" ;; esac SLOT="${BVER}" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd" # # The Gentoo patchset @@ -146,10 +149,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 +255,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 +277,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 +386,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}- +# /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} diff --git a/sys-devel/binutils/binutils-9999.ebuild b/sys-devel/binutils/binutils-9999.ebuild index f0c8730c819..1c3f3623a94 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}- +# /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}