| 8 |
8 |
DESCRIPTION="Tools necessary to build programs"
|
| 9 |
9 |
HOMEPAGE="https://sourceware.org/binutils/"
|
| 10 |
10 |
LICENSE="GPL-3+"
|
| 11 |
|
IUSE="default-gold doc +gold multitarget +nls +plugins static-libs test"
|
|
11 |
IUSE="cet default-gold doc +gold multitarget +nls +plugins static-libs test vanilla"
|
| 12 |
12 |
REQUIRED_USE="default-gold? ( gold )"
|
| 13 |
13 |
|
| 14 |
|
# Variables that can be set here:
|
|
14 |
# Variables that can be set here (ignored for live ebuilds)
|
| 15 |
15 |
# PATCH_VER - the patchset version
|
| 16 |
16 |
# Default: empty, no patching
|
| 17 |
17 |
# PATCH_BINUTILS_VER - the binutils version in the patchset name
|
| ... | ... | |
| 19 |
19 |
# PATCH_DEV - Use download URI https://dev.gentoo.org/~{PATCH_DEV}/distfiles/...
|
| 20 |
20 |
# for the patchsets
|
| 21 |
21 |
|
| 22 |
|
PATCH_VER=6
|
|
22 |
PATCH_VER=1
|
| 23 |
23 |
PATCH_DEV=dilfridge
|
| 24 |
24 |
|
| 25 |
|
case ${PV} in
|
| 26 |
|
9999)
|
| 27 |
|
EGIT_REPO_URI="https://sourceware.org/git/binutils-gdb.git"
|
| 28 |
|
inherit git-r3
|
| 29 |
|
S=${WORKDIR}/binutils
|
| 30 |
|
EGIT_CHECKOUT_DIR=${S}
|
| 31 |
|
SLOT=${PV}
|
| 32 |
|
;;
|
| 33 |
|
*)
|
| 34 |
|
SRC_URI="mirror://gnu/binutils/binutils-${PV}.tar.xz"
|
| 35 |
|
SLOT=$(ver_cut 1-2)
|
| 36 |
|
KEYWORDS="~alpha amd64 arm arm64 hppa ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
|
| 37 |
|
;;
|
| 38 |
|
esac
|
| 39 |
|
|
| 40 |
|
#
|
| 41 |
|
# The Gentoo patchset
|
| 42 |
|
#
|
| 43 |
|
PATCH_BINUTILS_VER=${PATCH_BINUTILS_VER:-${PV}}
|
| 44 |
|
PATCH_DEV=${PATCH_DEV:-slyfox}
|
| 45 |
|
|
| 46 |
|
[[ -z ${PATCH_VER} ]] || SRC_URI="${SRC_URI}
|
| 47 |
|
https://dev.gentoo.org/~${PATCH_DEV}/distfiles/binutils-${PATCH_BINUTILS_VER}-patches-${PATCH_VER}.tar.xz"
|
|
25 |
if [[ ${PV} == 9999* ]]; then
|
|
26 |
inherit git-r3
|
|
27 |
SLOT=${PV}
|
|
28 |
else
|
|
29 |
PATCH_BINUTILS_VER=${PATCH_BINUTILS_VER:-${PV}}
|
|
30 |
PATCH_DEV=${PATCH_DEV:-slyfox}
|
|
31 |
SRC_URI="mirror://gnu/binutils/binutils-${PV}.tar.xz"
|
|
32 |
[[ -z ${PATCH_VER} ]] || SRC_URI="${SRC_URI}
|
|
33 |
https://dev.gentoo.org/~${PATCH_DEV}/distfiles/binutils-${PATCH_BINUTILS_VER}-patches-${PATCH_VER}.tar.xz"
|
|
34 |
SLOT=$(ver_cut 1-2)
|
|
35 |
KEYWORDS="~alpha amd64 arm arm64 hppa ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
|
|
36 |
fi
|
| 48 |
37 |
|
| 49 |
38 |
#
|
| 50 |
39 |
# The cross-compile logic
|
| ... | ... | |
| 67 |
56 |
DEPEND="${RDEPEND}"
|
| 68 |
57 |
BDEPEND="
|
| 69 |
58 |
doc? ( sys-apps/texinfo )
|
| 70 |
|
test? ( dev-util/dejagnu )
|
|
59 |
test? (
|
|
60 |
dev-util/dejagnu
|
|
61 |
app-alternatives/bc
|
|
62 |
)
|
| 71 |
63 |
nls? ( sys-devel/gettext )
|
| 72 |
64 |
app-alternatives/lex
|
| 73 |
65 |
app-alternatives/yacc
|
| ... | ... | |
| 75 |
67 |
|
| 76 |
68 |
RESTRICT="!test? ( test )"
|
| 77 |
69 |
|
|
70 |
PATCHES=(
|
|
71 |
"${FILESDIR}"/${PN}-2.35.1-cet.patch
|
|
72 |
"${FILESDIR}"/${PN}-2.35.2-powerpc-tests.patch
|
|
73 |
)
|
|
74 |
|
| 78 |
75 |
MY_BUILDDIR=${WORKDIR}/build
|
| 79 |
76 |
|
| 80 |
77 |
src_unpack() {
|
| 81 |
|
case ${PV} in
|
| 82 |
|
*9999)
|
| 83 |
|
git-r3_src_unpack
|
| 84 |
|
;;
|
| 85 |
|
*)
|
| 86 |
|
;;
|
| 87 |
|
esac
|
| 88 |
|
default
|
| 89 |
|
mkdir -p "${MY_BUILDDIR}"
|
|
78 |
if [[ ${PV} == 9999* ]] ; then
|
|
79 |
EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/toolchain/binutils-patches.git"
|
|
80 |
EGIT_CHECKOUT_DIR=${WORKDIR}/patches-git
|
|
81 |
git-r3_src_unpack
|
|
82 |
mv patches-git/9999 patch || die
|
|
83 |
|
|
84 |
EGIT_REPO_URI="https://sourceware.org/git/binutils-gdb.git"
|
|
85 |
S=${WORKDIR}/binutils
|
|
86 |
EGIT_CHECKOUT_DIR=${S}
|
|
87 |
git-r3_src_unpack
|
|
88 |
else
|
|
89 |
unpack ${P}.tar.xz
|
|
90 |
|
|
91 |
cd "${WORKDIR}" || die
|
|
92 |
unpack binutils-${PATCH_BINUTILS_VER}-patches-${PATCH_VER}.tar.xz
|
|
93 |
fi
|
|
94 |
|
|
95 |
cd "${WORKDIR}" || die
|
|
96 |
mkdir -p "${MY_BUILDDIR}" || die
|
| 90 |
97 |
}
|
| 91 |
98 |
|
| 92 |
99 |
src_prepare() {
|
| 93 |
|
if [[ -n ${PATCH_VER} ]] ; then
|
| 94 |
|
einfo "Applying binutils-${PATCH_BINUTILS_VER} patchset ${PATCH_VER}"
|
| 95 |
|
eapply "${WORKDIR}/patch"/*.patch
|
|
100 |
local patchsetname
|
|
101 |
if [[ ${PV} == 9999* ]] ; then
|
|
102 |
patchsetname="from git master"
|
|
103 |
else
|
|
104 |
patchsetname="${PATCH_BINUTILS_VER}-${PATCH_VER}"
|
|
105 |
fi
|
|
106 |
|
|
107 |
if [[ -n ${PATCH_VER} ]] || [[ ${PV} == 9999* ]] ; then
|
|
108 |
if ! use vanilla; then
|
|
109 |
einfo "Applying binutils patchset ${patchsetname}"
|
|
110 |
eapply "${WORKDIR}/patch"
|
|
111 |
einfo "Done."
|
|
112 |
fi
|
| 96 |
113 |
fi
|
| 97 |
114 |
|
| 98 |
115 |
# Make sure our explicit libdir paths don't get clobbered. #562460
|
| ... | ... | |
| 219 |
236 |
--enable-relro
|
| 220 |
237 |
# Newer versions (>=2.24) make this an explicit option. #497268
|
| 221 |
238 |
--enable-install-libiberty
|
|
239 |
# Available from 2.35 on
|
|
240 |
--enable-textrel-check=warning
|
| 222 |
241 |
--disable-werror
|
| 223 |
242 |
--with-bugurl="$(toolchain-binutils_bugurl)"
|
| 224 |
243 |
--with-pkgversion="$(toolchain-binutils_pkgversion)"
|
| ... | ... | |
| 236 |
255 |
# avoid automagic dependency on (currently prefix) systems
|
| 237 |
256 |
# systems with debuginfod library, bug #754753
|
| 238 |
257 |
--without-debuginfod
|
|
258 |
|
|
259 |
# Allow user to opt into CET for host libraries.
|
|
260 |
# Ideally we would like automagic-or-disabled here.
|
|
261 |
# But the check does not quite work on i686: bug #760926.
|
|
262 |
$(use_enable cet)
|
| 239 |
263 |
)
|
| 240 |
264 |
echo ./configure "${myconf[@]}"
|
| 241 |
265 |
"${S}"/configure "${myconf[@]}" || die
|