summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2017-11-25 19:33:29 +0100
committerFabian Groffen <grobian@gentoo.org>2017-11-25 19:33:29 +0100
commita4196f18f658bc8e244b906344e0fdcdb5160277 (patch)
tree6f1099146fcda50792fd7af3fb381dad9a219eb4 /sys-devel/binutils-config
parentsys-devel/binutils-config: don't add runpaths for builddir searchpaths (diff)
downloadprefix-a4196f18f658bc8e244b906344e0fdcdb5160277.tar.gz
prefix-a4196f18f658bc8e244b906344e0fdcdb5160277.tar.bz2
prefix-a4196f18f658bc8e244b906344e0fdcdb5160277.zip
sys-devel/binutils-config: sync
Package-Manager: Portage-2.3.13-prefix, Repoman-2.3.4
Diffstat (limited to 'sys-devel/binutils-config')
-rw-r--r--sys-devel/binutils-config/binutils-config-5-r3.ebuild (renamed from sys-devel/binutils-config/binutils-config-5-r02.1.ebuild)17
-rwxr-xr-xsys-devel/binutils-config/files/binutils-config-541
-rw-r--r--sys-devel/binutils-config/files/binutils-config.814
-rw-r--r--sys-devel/binutils-config/files/ldwrapper.c6
4 files changed, 31 insertions, 47 deletions
diff --git a/sys-devel/binutils-config/binutils-config-5-r02.1.ebuild b/sys-devel/binutils-config/binutils-config-5-r3.ebuild
index 07c6b494dc..5d03556928 100644
--- a/sys-devel/binutils-config/binutils-config-5-r02.1.ebuild
+++ b/sys-devel/binutils-config/binutils-config-5-r3.ebuild
@@ -1,16 +1,18 @@
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-EAPI=5
+EAPI="5"
inherit eutils prefix
DESCRIPTION="Utility to change the binutils version being used"
HOMEPAGE="https://www.gentoo.org/"
+SRC_URI=""
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE=""
# We also RDEPEND on sys-apps/findutils which is in base @system
RDEPEND="sys-apps/gentoo-functions
@@ -43,6 +45,7 @@ src_compile() {
-DEPREFIX=\"${EPREFIX}\"
-DCHOST=\"${CHOST}\"
$([[ ${CHOST} == *-darwin* ]] && echo -DTARGET_DARWIN)
+ $([[ ${CHOST} == *-aix* ]] && echo -DTARGET_AIX)
${LDFLAGS}
)
echo ${args[*]}
@@ -50,7 +53,9 @@ src_compile() {
}
src_install() {
- newbin "${S}"/${PN} ${PN}
+ newbin "${FILESDIR}"/${PN}-${PV} ${PN}
+ use prefix && eprefixify "${ED}"/usr/bin/${PN}
+ sed -i "s:@PV@:${PVR}:g" "${ED}"/usr/bin/${PN} || die
doman "${FILESDIR}"/${PN}.8
dodir /usr/$(get_libdir)/misc/binutils-config
@@ -71,11 +76,3 @@ pkg_preinst() {
fi
fi
}
-
-pkg_postinst() {
- # refresh all links and the wrapper
- if [[ ${ROOT%/} == "" ]] ; then
- [[ -f ${EROOT}/etc/env.d/binutils/config-${CHOST} ]] \
- && binutils-config $(binutils-config --get-current-profile)
- fi
-}
diff --git a/sys-devel/binutils-config/files/binutils-config-5 b/sys-devel/binutils-config/files/binutils-config-5
index 3052a8593d..e6c5fac002 100755
--- a/sys-devel/binutils-config/files/binutils-config-5
+++ b/sys-devel/binutils-config/files/binutils-config-5
@@ -1,15 +1,15 @@
#!/bin/bash
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Id$
# Format of /etc/env.d/binutils/:
# config-TARGET: CURRENT=version for TARGET
# TARGET-VER: has a TARGET and VER variable
-: ${EPREFIX:="@GENTOO_PORTAGE_EPREFIX@"}
-[[ ${EPREFIX} = */ ]] && EPREFIX="${EPREFIX%/}"
-[[ -n ${EPREFIX} && ${EPREFIX} != /* ]] && EPREFIX="${PWD%/}/${EPREFIX}"
+EPREFIX="@GENTOO_PORTAGE_EPREFIX@"
+if [[ ${EPREFIX} == "@"GENTOO_PORTAGE_EPREFIX"@" ]] ; then
+ EPREFIX=""
+fi
: ${ROOT:=/}
[[ ${ROOT} != */ ]] && ROOT="${ROOT}/"
@@ -22,7 +22,7 @@ cd "${EPREFIX}/"
trap ":" INT QUIT TSTP
argv0=${0##*/}
-FUNCTIONS_SH="@GENTOO_PORTAGE_EPREFIX@/lib/gentoo/functions.sh"
+FUNCTIONS_SH="${EPREFIX}/lib/gentoo/functions.sh"
source ${FUNCTIONS_SH} || {
echo "${argv0}: Could not source ${FUNCTIONS_SH}!" 1>&2
exit 1
@@ -103,7 +103,7 @@ setup_env() {
# Newer paths: /usr/${HOST}/${TARGET}/...
# Older paths: /usr/${TARGET}/...
#
- if [[ -d ${ROOT}${EPREFIX}/usr/${HOST}/${TARGET}/binutils-bin/${VER} ]] ; then
+ if [[ -d "${EROOT}"/usr/${HOST}/${TARGET}/binutils-bin/${VER} ]] ; then
BINPATH="${EPREFIX}"/usr/${HOST}/${TARGET}/binutils-bin/${VER}
BINPATH_LINKS="${EPREFIX}"/usr/libexec/gcc/${TARGET}
fi
@@ -145,26 +145,21 @@ switch_profile() {
cd "${ROOT}/${LIBPATH}" || exit 1
if [[ ${TARGET} == ${HOST} ]] ; then
dstlib=${EROOT}/usr/${HOST}/lib
+ elif [[ -d ${EROOT}/usr/${TARGET}/lib ]] ; then
+ # true for at least avr and msp targets
+ dstlib=${EROOT}/usr/${TARGET}/lib
else
dstlib=${EROOT}/usr/${HOST}/${TARGET}/lib
fi
# When upgrading, we need to clean up ldscripts and libs.
# Don't symlink back in the libs -- the binutils-lib package handles
# these now.
- # TODO: Stop requiring even the ldscripts symlink.
+ # TODO: Stop requiring even the ldscripts symlink, except
+ # we can't for bare-metal toolchains, so... bug #147155
mkdir -p "${dstlib}"
rm -rf "${ROOT}/${BINPATH_LINKS}"/ldscripts
atomic_ln "${LIBPATH}/ldscripts" "${dstlib}" "ldscripts"
- find -L "${dstlib}" -xtype l -name 'lib*' -delete
- # Detect older binutils w/broken rpaths. #562460
- # We can hardcode the "/lib" part since that's what the binutils
- # configure scripts have. They did not include any other path.
- if [[ $(scanelf -qF '%r#F' "${ROOT}/${BINPATH}/as") == */lib ]] ; then
- ewarn "Old cross-binutils detected; please re-emerge to fix (see bug #562460)."
- for x in lib* ; do
- atomic_ln "${LIBPATH}/${x}" "${dstlib}" "${x}"
- done
- fi
+ find -L "${dstlib}" -xtype l -name 'lib*' -exec rm -f {} +
#
# Clean out old generated include symlinks
@@ -257,7 +252,7 @@ uninstall_target() {
local x
for x in \
- addr2line ar as c++filt dwp elf2flt elfedit flthdr gprof \
+ addr2line ar as c++filt elf2flt elfedit flthdr gprof \
ld ld.{bfd,gold,real} \
nm objcopy objdump ranlib readelf size strings strip
do
@@ -412,12 +407,8 @@ while [[ $# -gt 0 ]] ; do
-d|--debug) DEBUG="yes" ;;
-h|--help) usage 0 ;;
-V|--version)
- unset Header
- cvsver="$Id$"
- cvsver=${cvsver##*binutils-config-}
- bver=${cvsver%%,v *}
- cvsver=${cvsver#* }
- echo "binutils-config-${bver} (r${cvsver%% *})"
+ ver="@PV@"
+ echo "binutils-config-${ver/@'PV'@/git}"
exit 0
;;
-*)
diff --git a/sys-devel/binutils-config/files/binutils-config.8 b/sys-devel/binutils-config/files/binutils-config.8
index 0d8adb5a70..52cf7101e6 100644
--- a/sys-devel/binutils-config/files/binutils-config.8
+++ b/sys-devel/binutils-config/files/binutils-config.8
@@ -48,16 +48,12 @@ This is really for internal use only. Used to remove all traces of the
\fITARGET\fR binutils from your system.
.SH "CRUFTY OPTIONS"
.TP
-\fB\-\-gold\fR
-Change the default linker for the specified \fIPROFILE\fR to the [newer] gold
-linker. This only works if the binutils actually supports gold. Note that
-not all options supported by the bfd linker are supportd by the gold linker.
-.TP
-\fB\-\-bfd\fR
-Change the default linker for the specified \fIPROFILE\fR to the [older but
-stable] bfd linker. If unsure, stick to this one.
+\fB\-\-linker\fR \fB<linker>\fR
+Change the default linker for the specified \fIPROFILE\fR to the \fB<linker>\fR.
+Common names are \fBld.gold\fR for the newer gold linker and \fBld.bfd\fR for
+the classic linker. Note that not all targets support the gold linker.
.SH "REPORTING BUGS"
-Please report bugs via http://bugs.gentoo.org/
+Please report bugs via https://bugs.gentoo.org/
.SH "SEE ALSO"
.BR ar (1),
.BR as (1),
diff --git a/sys-devel/binutils-config/files/ldwrapper.c b/sys-devel/binutils-config/files/ldwrapper.c
index 84431fb3ac..88f93a8602 100644
--- a/sys-devel/binutils-config/files/ldwrapper.c
+++ b/sys-devel/binutils-config/files/ldwrapper.c
@@ -189,7 +189,7 @@ main(int argc, char *argv[])
/* add the 4 paths we want (-L + -R) and a null-terminator */
newargc += 8 + 1;
#endif
-#ifdef _AIX
+#ifdef TARGET_AIX
/* AIX ld accepts -R only with -bsvr4 */
newargc++; /* -bsvr4 */
#endif
@@ -222,7 +222,7 @@ main(int argc, char *argv[])
/* position k right after the original arguments */
k = j - 1 + argc;
for (i = 1; i < argc; i++, j++) {
-#ifdef _AIX
+#ifdef TARGET_AIX
/* AIX ld has this problem:
* $ /usr/ccs/bin/ld -bsvr4 -bE:xx.exp -bnoentry xx.o
* ld: 0706-005 Cannot find or open file: l
@@ -291,7 +291,7 @@ main(int argc, char *argv[])
newargv[k++] = "-L" EPREFIX "/lib";
newargv[k++] = "-R" EPREFIX "/lib";
#endif
-#ifdef _AIX
+#ifdef TARGET_AIX
newargv[k++] = "-bsvr4"; /* last one, see above */
#endif
newargv[k] = NULL;