Gentoo Archives: gentoo-commits

From: "Andreas K. Hüttel" <dilfridge@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-devel/binutils/
Date: Fri, 30 Nov 2018 22:26:04
Message-Id: 1543616752.bbfd6046b2226311ba889d80fc2f3c7e6fd6886e.dilfridge@gentoo
1 commit: bbfd6046b2226311ba889d80fc2f3c7e6fd6886e
2 Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
3 AuthorDate: Fri Nov 30 22:25:25 2018 +0000
4 Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
5 CommitDate: Fri Nov 30 22:25:52 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bbfd6046
7
8 sys-devel/binutils: Remove old
9
10 Package-Manager: Portage-2.3.52, Repoman-2.3.12
11 Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
12
13 sys-devel/binutils/Manifest | 2 -
14 sys-devel/binutils/binutils-2.30-r3.ebuild | 416 ----------------------------
15 sys-devel/binutils/binutils-2.31.1.ebuild | 424 -----------------------------
16 3 files changed, 842 deletions(-)
17
18 diff --git a/sys-devel/binutils/Manifest b/sys-devel/binutils/Manifest
19 index 7c9af85c0bf..4776f356d52 100644
20 --- a/sys-devel/binutils/Manifest
21 +++ b/sys-devel/binutils/Manifest
22 @@ -9,10 +9,8 @@ DIST binutils-2.28.1.tar.bz2 28120394 BLAKE2B 3a0ed2bcf0c859638546b7460d9e6f0a55
23 DIST binutils-2.29.1-patches-3.tar.xz 20904 BLAKE2B 5549cb2412123e4ad3a13935762cc0dca46215950dbf38a149caf4c6416da382a0fd7ecffe97b10bce4dfdcef5edc2673d49bb21e9d37be37e33b454a8c2bc1a SHA512 ba54efaf9e9f668d2922972acd2cdf5c3e6f174cfcc73d29953ab4ba6e157ce0cb500c583568a4e3baaaa92c9d30c394a327f29b51292acc66f8d3f20f5eae2a
24 DIST binutils-2.29.1.tar.bz2 29123355 BLAKE2B 83de518a27bae0f13c57b1979493dd7f7cabae424cff5e8495d1f064da24b6ef9e1c19d1d1adad2dca7142372782023f66b4b4223170a49b96ba3834266fe878 SHA512 4063d34555526922376ccceb3f14b43e287442e82a8038cf50f4f51ad97d438c672c0e310ca4b856c9aff5aa9911073e256e8298a7a3f1844eeb60b90d955592
25 DIST binutils-2.30-patches-2.tar.xz 490272 BLAKE2B a28a5b5bb8faa33fec269f2c69d6ed0e4e7d5a9169861aa4b3c45511794e1e749c216862a8258c2029f1b40c511dcb2a0aeaecda57e75d52418f10d6f345718f SHA512 1686d5b58ee968f2000647acab2bee4c263d1c85fd43fed8c820fccfc0d7024a01211e7853cd5ce452fa90da500bc17309edf6dbc901c7fd6fc7b3e3d6f42581
26 -DIST binutils-2.30-patches-3.tar.xz 548804 BLAKE2B 428a1750233ae3f019e20cb5ed1d8e6fe6455181e8f5961dbfe7b66493d1c42050f889e45c02c1fc1a84d545c9e61f81ad6ffd5afc0b1099a702ccc7637c3abe SHA512 c91e902d1d9fc2e9782df04c93173c3207c771f1c063e2ff12c9336593c954ea3f1b2474a8fc045927d72fe18f7401874059599d100c4a1fd152081f05913d03
27 DIST binutils-2.30-patches-5.tar.xz 590864 BLAKE2B 71de4d08f92ab1898ad576a21763f955067cbbed543250888e0c5d51f4ef77d0d829049e9a835691cf2de03965fbcc9bcfa092eb304c03f9b885e7a3dadab286 SHA512 029b3be6ae9b8620f8580a35701bd4517b4e0232ff3cf9983b3808475c7443cbf500b6cace2c052df0bd1e47202838f4d2453238db28709a947117071d9ae804
28 DIST binutils-2.30.tar.xz 20286700 BLAKE2B 2dd5436a15a601011a1950e6082ec00082f5916fb82ce95ceab424fd8dc19f6daa7ac32a149f222ccdcc603354165cc206fde070eaa44fe2cc5e57486efc7868 SHA512 e747ea20d8d79fcd21b9d9f6695059caa7189d60f19256da398e34b789fea9a133c32b192e9693b5828d27683739b0198431bf8b3e39fb3b04884cf89d9aa839
29 -DIST binutils-2.31.1-patches-2.tar.xz 11232 BLAKE2B b8ac65872017c063650d4e04855efa3fd3e9faa566e81fa9fb3ae777c1337627023c1af85b708a7933b577a69652451ff488340d7cc9f035d3a3a655da0fc8d6 SHA512 2d0ee2e727586fc39cdb8abc7251c12dd350d18dd84103ddacc08978db48d45445c05b7ea5f095842f6e0350db94d593270b23a38920a01ca59c363decaa2a58
30 DIST binutils-2.31.1-patches-3.tar.xz 12640 BLAKE2B 3444b219dd02ad513e6c36214d649a8a74638382103c88ec8de76a579be0ee13f8d1450e3b8d82dfddad55f2f851b32aee910a99230c7d8673f8426fc79a4cd9 SHA512 67b23c17518305561d190a15cba4a1af18a0a3cf1d7e62583ac7667d2fa40e7c7ec024cc981009d5d1caf1939633ab55fc0a198b69af02dc7841be43ff1acd13
31 DIST binutils-2.31.1.tar.xz 20467996 BLAKE2B 6b914df1fbb7cf54f2159f71b2c2b09f3f6a569b7a3cb4cf9790d0a3733a7548bc0ea32334a178ed3b56e8b97656ae99c7abaf212601beeaeae9a0884c0f6051 SHA512 0fca326feb1d5f5fe505a827b20237fe3ec9c13eaf7ec7e35847fd71184f605ba1cefe1314b1b8f8a29c0aa9d88162849ee1c1a3e70c2f7407d88339b17edb30
32 DIST binutils-9999-patches-2.tar.xz 11672 BLAKE2B 40b790713fc6cf463de3b3c3d207686890cc674fa44828952e73a66b723e4d9e8374b9e13fd44ffc5e0e5e1dc6eb63910563f4f318ff22f56813bd29ba4fe338 SHA512 ed1d88b693e35368e7ec6e16ccd7a5561ba697b778afc2da296f46698aff5d4d6a39c5fc030ce189b00af944d80f673bdac770771d23dd1f256eac2fb5858493
33
34 diff --git a/sys-devel/binutils/binutils-2.30-r3.ebuild b/sys-devel/binutils/binutils-2.30-r3.ebuild
35 deleted file mode 100644
36 index 7902b582213..00000000000
37 --- a/sys-devel/binutils/binutils-2.30-r3.ebuild
38 +++ /dev/null
39 @@ -1,416 +0,0 @@
40 -# Copyright 1999-2018 Gentoo Foundation
41 -# Distributed under the terms of the GNU General Public License v2
42 -
43 -EAPI=6
44 -
45 -inherit eutils libtool flag-o-matic gnuconfig multilib versionator
46 -
47 -DESCRIPTION="Tools necessary to build programs"
48 -HOMEPAGE="https://sourceware.org/binutils/"
49 -LICENSE="GPL-3+"
50 -IUSE="+cxx doc multitarget +nls static-libs test"
51 -
52 -# Variables that can be set here:
53 -# PATCH_VER - the patchset version
54 -# Default: empty, no patching
55 -# PATCH_BINUTILS_VER - the binutils version in the patchset name
56 -# - Default: PV
57 -# PATCH_DEV - Use download URI https://dev.gentoo.org/~{PATCH_DEV}/distfiles/...
58 -# for the patchsets
59 -# Default: dilfridge :)
60 -
61 -PATCH_VER=3
62 -
63 -case ${PV} in
64 - 9999)
65 - BVER="git"
66 - EGIT_REPO_URI="https://sourceware.org/git/binutils-gdb.git"
67 - inherit git-r3
68 - S=${WORKDIR}/binutils
69 - EGIT_CHECKOUT_DIR=${S}
70 - ;;
71 - *)
72 - BVER=${PV}
73 - SRC_URI="mirror://gnu/binutils/binutils-${BVER}.tar.xz https://sourceware.org/pub/binutils/releases/binutils-${BVER}.tar.xz"
74 - ;;
75 -esac
76 -SLOT="${BVER}"
77 -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd"
78 -
79 -#
80 -# The Gentoo patchset
81 -#
82 -PATCH_BINUTILS_VER=${PATCH_BINUTILS_VER:-${BVER}}
83 -PATCH_DEV=${PATCH_DEV:-dilfridge}
84 -
85 -[[ -z ${PATCH_VER} ]] || SRC_URI="${SRC_URI}
86 - https://dev.gentoo.org/~${PATCH_DEV}/distfiles/binutils-${PATCH_BINUTILS_VER}-patches-${PATCH_VER}.tar.xz"
87 -
88 -#
89 -# The cross-compile logic
90 -#
91 -export CTARGET=${CTARGET:-${CHOST}}
92 -if [[ ${CTARGET} == ${CHOST} ]] ; then
93 - if [[ ${CATEGORY} == cross-* ]] ; then
94 - export CTARGET=${CATEGORY#cross-}
95 - fi
96 -fi
97 -is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
98 -
99 -#
100 -# The dependencies
101 -#
102 -RDEPEND="
103 - >=sys-devel/binutils-config-3
104 - sys-libs/zlib
105 -"
106 -DEPEND="${RDEPEND}
107 - doc? ( sys-apps/texinfo )
108 - test? ( dev-util/dejagnu )
109 - nls? ( sys-devel/gettext )
110 - sys-devel/flex
111 - virtual/yacc
112 -"
113 -if is_cross ; then
114 - # The build assumes the host has libiberty and such when cross-compiling
115 - # its build tools. We should probably make binutils itself build a local
116 - # copy to use, but until then, be lazy.
117 - DEPEND+=" >=sys-libs/binutils-libs-${PV}"
118 -fi
119 -
120 -MY_BUILDDIR=${WORKDIR}/build
121 -
122 -src_unpack() {
123 - case ${PV} in
124 - 9999)
125 - git-r3_src_unpack;
126 - ;;
127 - *)
128 - default
129 - ;;
130 - esac
131 - mkdir -p "${MY_BUILDDIR}"
132 -}
133 -
134 -src_prepare() {
135 - if [[ ! -z ${PATCH_VER} ]] ; then
136 - einfo "Applying binutils-${PATCH_BINUTILS_VER} patchset ${PATCH_VER}"
137 - eapply "${WORKDIR}/patch"/*.patch
138 - fi
139 -
140 - # This check should probably go somewhere else, like pkg_pretend.
141 - if [[ ${CTARGET} == *-uclibc* ]] ; then
142 - if grep -qs 'linux-gnu' "${S}"/ltconfig ; then
143 - die "sorry, but this binutils doesn't yet support uClibc :("
144 - fi
145 - fi
146 -
147 - # Make sure our explicit libdir paths don't get clobbered. #562460
148 - sed -i \
149 - -e 's:@bfdlibdir@:@libdir@:g' \
150 - -e 's:@bfdincludedir@:@includedir@:g' \
151 - {bfd,opcodes}/Makefile.in || die
152 -
153 - # Fix locale issues if possible #122216
154 - if [[ -e ${FILESDIR}/binutils-configure-LANG.patch ]] ; then
155 - einfo "Fixing misc issues in configure files"
156 - for f in $(find "${S}" -name configure -exec grep -l 'autoconf version 2.13' {} +) ; do
157 - ebegin " Updating ${f/${S}\/}"
158 - patch "${f}" "${FILESDIR}"/binutils-configure-LANG.patch >& "${T}"/configure-patch.log \
159 - || eerror "Please file a bug about this"
160 - eend $?
161 - done
162 - fi
163 -
164 - # Fix conflicts with newer glibc #272594
165 - if [[ -e libiberty/testsuite/test-demangle.c ]] ; then
166 - sed -i 's:\<getline\>:get_line:g' libiberty/testsuite/test-demangle.c
167 - fi
168 -
169 - # Apply things from PATCHES and user dirs
170 - default
171 -
172 - # Run misc portage update scripts
173 - gnuconfig_update
174 - elibtoolize --portage --no-uclibc
175 -}
176 -
177 -toolchain-binutils_bugurl() {
178 - printf "https://bugs.gentoo.org/"
179 -}
180 -toolchain-binutils_pkgversion() {
181 - printf "Gentoo ${BVER}"
182 - [[ -n ${PATCH_VER} ]] && printf " p${PATCH_VER}"
183 -}
184 -
185 -src_configure() {
186 - # Setup some paths
187 - LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${BVER}
188 - INCPATH=${LIBPATH}/include
189 - DATAPATH=/usr/share/binutils-data/${CTARGET}/${BVER}
190 - if is_cross ; then
191 - TOOLPATH=/usr/${CHOST}/${CTARGET}
192 - else
193 - TOOLPATH=/usr/${CTARGET}
194 - fi
195 - BINPATH=${TOOLPATH}/binutils-bin/${BVER}
196 -
197 - # Make sure we filter $LINGUAS so that only ones that
198 - # actually work make it through #42033
199 - strip-linguas -u */po
200 -
201 - # Keep things sane
202 - strip-flags
203 -
204 - local x
205 - echo
206 - for x in CATEGORY CBUILD CHOST CTARGET CFLAGS LDFLAGS ; do
207 - einfo "$(printf '%10s' ${x}:) ${!x}"
208 - done
209 - echo
210 -
211 - cd "${MY_BUILDDIR}"
212 - local myconf=()
213 -
214 - # enable gold (installed as ld.gold) and ld's plugin architecture
215 - if use cxx ; then
216 - myconf+=( --enable-gold )
217 - myconf+=( --enable-plugins )
218 - fi
219 -
220 - if use nls ; then
221 - myconf+=( --without-included-gettext )
222 - else
223 - myconf+=( --disable-nls )
224 - fi
225 -
226 - myconf+=( --with-system-zlib )
227 -
228 - # For bi-arch systems, enable a 64bit bfd. This matches
229 - # the bi-arch logic in toolchain.eclass. #446946
230 - # We used to do it for everyone, but it's slow on 32bit arches. #438522
231 - case $(tc-arch) in
232 - ppc|sparc|x86) myconf+=( --enable-64-bit-bfd ) ;;
233 - esac
234 -
235 - use multitarget && myconf+=( --enable-targets=all --enable-64-bit-bfd )
236 -
237 - [[ -n ${CBUILD} ]] && myconf+=( --build=${CBUILD} )
238 -
239 - is_cross && myconf+=(
240 - --with-sysroot="${EPREFIX}"/usr/${CTARGET}
241 - --enable-poison-system-directories
242 - )
243 -
244 - # glibc-2.3.6 lacks support for this ... so rather than force glibc-2.5+
245 - # on everyone in alpha (for now), we'll just enable it when possible
246 - has_version ">=${CATEGORY}/glibc-2.5" && myconf+=( --enable-secureplt )
247 - has_version ">=sys-libs/glibc-2.5" && myconf+=( --enable-secureplt )
248 -
249 - # mips can't do hash-style=gnu ...
250 - if [[ $(tc-arch) != mips ]] ; then
251 - myconf+=( --enable-default-hash-style=gnu )
252 - fi
253 -
254 - myconf+=(
255 - --prefix="${EPREFIX}"/usr
256 - --host=${CHOST}
257 - --target=${CTARGET}
258 - --datadir="${EPREFIX}"${DATAPATH}
259 - --datarootdir="${EPREFIX}"${DATAPATH}
260 - --infodir="${EPREFIX}"${DATAPATH}/info
261 - --mandir="${EPREFIX}"${DATAPATH}/man
262 - --bindir="${EPREFIX}"${BINPATH}
263 - --libdir="${EPREFIX}"${LIBPATH}
264 - --libexecdir="${EPREFIX}"${LIBPATH}
265 - --includedir="${EPREFIX}"${INCPATH}
266 - --enable-obsolete
267 - --enable-shared
268 - --enable-threads
269 - # Newer versions (>=2.27) offer a configure flag now.
270 - --enable-relro
271 - # Newer versions (>=2.24) make this an explicit option. #497268
272 - --enable-install-libiberty
273 - --disable-werror
274 - --with-bugurl="$(toolchain-binutils_bugurl)"
275 - --with-pkgversion="$(toolchain-binutils_pkgversion)"
276 - $(use_enable static-libs static)
277 - ${EXTRA_ECONF}
278 - # Disable modules that are in a combined binutils/gdb tree. #490566
279 - --disable-{gdb,libdecnumber,readline,sim}
280 - # Strip out broken static link flags.
281 - # https://gcc.gnu.org/PR56750
282 - --without-stage1-ldflags
283 - )
284 - echo ./configure "${myconf[@]}"
285 - "${S}"/configure "${myconf[@]}" || die
286 -
287 - # Prevent makeinfo from running if doc is unset.
288 - if ! use doc ; then
289 - sed -i \
290 - -e '/^MAKEINFO/s:=.*:= true:' \
291 - Makefile || die
292 - fi
293 -}
294 -
295 -src_compile() {
296 - cd "${MY_BUILDDIR}"
297 - # see Note [tooldir hack for ldscripts]
298 - emake tooldir="${EPREFIX}${TOOLPATH}" all
299 -
300 - # only build info pages if the user wants them
301 - if use doc ; then
302 - emake info
303 - fi
304 -
305 - # we nuke the manpages when we're left with junk
306 - # (like when we bootstrap, no perl -> no manpages)
307 - find . -name '*.1' -a -size 0 -delete
308 -}
309 -
310 -src_test() {
311 - cd "${MY_BUILDDIR}"
312 - emake -k check
313 -}
314 -
315 -src_install() {
316 - local x d
317 -
318 - cd "${MY_BUILDDIR}"
319 - # see Note [tooldir hack for ldscripts]
320 - emake DESTDIR="${D}" tooldir="${EPREFIX}${LIBPATH}" install
321 - rm -rf "${ED}"/${LIBPATH}/bin
322 - use static-libs || find "${ED}" -name '*.la' -delete
323 -
324 - # Newer versions of binutils get fancy with ${LIBPATH} #171905
325 - cd "${ED}"/${LIBPATH}
326 - for d in ../* ; do
327 - [[ ${d} == ../${BVER} ]] && continue
328 - mv ${d}/* . || die
329 - rmdir ${d} || die
330 - done
331 -
332 - # Now we collect everything intp the proper SLOT-ed dirs
333 - # When something is built to cross-compile, it installs into
334 - # /usr/$CHOST/ by default ... we have to 'fix' that :)
335 - if is_cross ; then
336 - cd "${ED}"/${BINPATH}
337 - for x in * ; do
338 - mv ${x} ${x/${CTARGET}-}
339 - done
340 -
341 - if [[ -d ${ED}/usr/${CHOST}/${CTARGET} ]] ; then
342 - mv "${ED}"/usr/${CHOST}/${CTARGET}/include "${ED}"/${INCPATH}
343 - mv "${ED}"/usr/${CHOST}/${CTARGET}/lib/* "${ED}"/${LIBPATH}/
344 - rm -r "${ED}"/usr/${CHOST}/{include,lib}
345 - fi
346 - fi
347 - insinto ${INCPATH}
348 - local libiberty_headers=(
349 - # Not all the libiberty headers. See libiberty/Makefile.in:install_to_libdir.
350 - demangle.h
351 - dyn-string.h
352 - fibheap.h
353 - hashtab.h
354 - libiberty.h
355 - objalloc.h
356 - splay-tree.h
357 - )
358 - doins "${libiberty_headers[@]/#/${S}/include/}" || die
359 - if [[ -d ${ED}/${LIBPATH}/lib ]] ; then
360 - mv "${ED}"/${LIBPATH}/lib/* "${ED}"/${LIBPATH}/
361 - rm -r "${ED}"/${LIBPATH}/lib
362 - fi
363 -
364 - # Generate an env.d entry for this binutils
365 - insinto /etc/env.d/binutils
366 - cat <<-EOF > "${T}"/env.d
367 - TARGET="${CTARGET}"
368 - VER="${BVER}"
369 - LIBPATH="${EPREFIX}${LIBPATH}"
370 - EOF
371 - newins "${T}"/env.d ${CTARGET}-${BVER}
372 -
373 - # Handle documentation
374 - if ! is_cross ; then
375 - cd "${S}"
376 - dodoc README
377 - docinto bfd
378 - dodoc bfd/ChangeLog* bfd/README bfd/PORTING bfd/TODO
379 - docinto binutils
380 - dodoc binutils/ChangeLog binutils/NEWS binutils/README
381 - docinto gas
382 - dodoc gas/ChangeLog* gas/CONTRIBUTORS gas/NEWS gas/README*
383 - docinto gprof
384 - dodoc gprof/ChangeLog* gprof/TEST gprof/TODO gprof/bbconv.pl
385 - docinto ld
386 - dodoc ld/ChangeLog* ld/README ld/NEWS ld/TODO
387 - docinto libiberty
388 - dodoc libiberty/ChangeLog* libiberty/README
389 - docinto opcodes
390 - dodoc opcodes/ChangeLog*
391 - fi
392 -
393 - # Remove shared info pages
394 - rm -f "${ED}"/${DATAPATH}/info/{dir,configure.info,standards.info}
395 -
396 - # Trim all empty dirs
397 - find "${ED}" -depth -type d -exec rmdir {} + 2>/dev/null
398 -}
399 -
400 -pkg_postinst() {
401 - # Make sure this ${CTARGET} has a binutils version selected
402 - [[ -e ${EROOT}/etc/env.d/binutils/config-${CTARGET} ]] && return 0
403 - binutils-config ${CTARGET}-${BVER}
404 -}
405 -
406 -pkg_postrm() {
407 - local current_profile=$(binutils-config -c ${CTARGET})
408 -
409 - # If no other versions exist, then uninstall for this
410 - # target ... otherwise, switch to the newest version
411 - # Note: only do this if this version is unmerged. We
412 - # rerun binutils-config if this is a remerge, as
413 - # we want the mtimes on the symlinks updated (if
414 - # it is the same as the current selected profile)
415 - if [[ ! -e ${EPREFIX}${BINPATH}/ld ]] && [[ ${current_profile} == ${CTARGET}-${BVER} ]] ; then
416 - local choice=$(binutils-config -l | grep ${CTARGET} | awk '{print $2}')
417 - choice=${choice//$'\n'/ }
418 - choice=${choice/* }
419 - if [[ -z ${choice} ]] ; then
420 - binutils-config -u ${CTARGET}
421 - else
422 - binutils-config ${choice}
423 - fi
424 - elif [[ $(CHOST=${CTARGET} binutils-config -c) == ${CTARGET}-${BVER} ]] ; then
425 - binutils-config ${CTARGET}-${BVER}
426 - fi
427 -}
428 -
429 -# Note [slotting support]
430 -# -----------------------
431 -# Gentoo's layout for binutils files is non-standard as Gentoo
432 -# supports slotted installation for binutils. Many tools
433 -# still expect binutils to reside in known locations.
434 -# binutils-config package restores symlinks into known locations,
435 -# like:
436 -# /usr/bin/${CTARGET}-<tool>
437 -# /usr/bin/${CHOST}/${CTARGET}/lib/ldscrips
438 -# /usr/include/
439 -#
440 -# Note [tooldir hack for ldscripts]
441 -# ---------------------------------
442 -# Build system does not allow ./configure to tweak every location
443 -# we need for slotting binutils hence all the shuffling in
444 -# src_install(). This note is about SCRIPTDIR define handling.
445 -#
446 -# SCRIPTDIR defines 'ldscripts/' directory location. SCRIPTDIR value
447 -# is set at build-time in ld/Makefile.am as: 'scriptdir = $(tooldir)/lib'
448 -# and hardcoded as -DSCRIPTDIR='"$(scriptdir)"' at compile time.
449 -# Thus we can't just move files around after compilation finished.
450 -#
451 -# Our goal is the following:
452 -# - at build-time set scriptdir to point to symlinked location:
453 -# ${TOOLPATH}: /usr/${CHOST} (or /usr/${CHOST}/${CTARGET} for cross-case)
454 -# - at install-time set scriptdir to point to slotted location:
455 -# ${LIBPATH}: /usr/$(get_libdir)/binutils/${CTARGET}/${BVER}
456
457 diff --git a/sys-devel/binutils/binutils-2.31.1.ebuild b/sys-devel/binutils/binutils-2.31.1.ebuild
458 deleted file mode 100644
459 index aa2b74cf6c1..00000000000
460 --- a/sys-devel/binutils/binutils-2.31.1.ebuild
461 +++ /dev/null
462 @@ -1,424 +0,0 @@
463 -# Copyright 1999-2018 Gentoo Foundation
464 -# Distributed under the terms of the GNU General Public License v2
465 -
466 -EAPI=6
467 -
468 -inherit eutils libtool flag-o-matic gnuconfig multilib versionator
469 -
470 -DESCRIPTION="Tools necessary to build programs"
471 -HOMEPAGE="https://sourceware.org/binutils/"
472 -LICENSE="GPL-3+"
473 -IUSE="+cxx doc multitarget +nls static-libs test"
474 -
475 -# Variables that can be set here:
476 -# PATCH_VER - the patchset version
477 -# Default: empty, no patching
478 -# PATCH_BINUTILS_VER - the binutils version in the patchset name
479 -# - Default: PV
480 -# PATCH_DEV - Use download URI https://dev.gentoo.org/~{PATCH_DEV}/distfiles/...
481 -# for the patchsets
482 -# Default: dilfridge :)
483 -
484 -PATCH_VER=2
485 -
486 -case ${PV} in
487 - 9999)
488 - EGIT_REPO_URI="https://sourceware.org/git/binutils-gdb.git"
489 - inherit git-r3
490 - S=${WORKDIR}/binutils
491 - EGIT_CHECKOUT_DIR=${S}
492 - SLOT=${PV}
493 - ;;
494 - *.9999)
495 - EGIT_REPO_URI="https://sourceware.org/git/binutils-gdb.git"
496 - inherit git-r3
497 - S=${WORKDIR}/binutils
498 - EGIT_CHECKOUT_DIR=${S}
499 - EGIT_BRANCH=$(get_version_component_range 1-2)
500 - EGIT_BRANCH="binutils-${EGIT_BRANCH/./_}-branch"
501 - SLOT=$(get_version_component_range 1-2)
502 - ;;
503 - *)
504 - SRC_URI="mirror://gnu/binutils/binutils-${PV}.tar.xz"
505 - SLOT=$(get_version_component_range 1-2)
506 - KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd"
507 - ;;
508 -esac
509 -
510 -#
511 -# The Gentoo patchset
512 -#
513 -PATCH_BINUTILS_VER=${PATCH_BINUTILS_VER:-${PV}}
514 -PATCH_DEV=${PATCH_DEV:-slyfox}
515 -
516 -[[ -z ${PATCH_VER} ]] || SRC_URI="${SRC_URI}
517 - https://dev.gentoo.org/~${PATCH_DEV}/distfiles/binutils-${PATCH_BINUTILS_VER}-patches-${PATCH_VER}.tar.xz"
518 -
519 -#
520 -# The cross-compile logic
521 -#
522 -export CTARGET=${CTARGET:-${CHOST}}
523 -if [[ ${CTARGET} == ${CHOST} ]] ; then
524 - if [[ ${CATEGORY} == cross-* ]] ; then
525 - export CTARGET=${CATEGORY#cross-}
526 - fi
527 -fi
528 -is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
529 -
530 -#
531 -# The dependencies
532 -#
533 -RDEPEND="
534 - >=sys-devel/binutils-config-3
535 - sys-libs/zlib
536 -"
537 -DEPEND="${RDEPEND}
538 - doc? ( sys-apps/texinfo )
539 - test? ( dev-util/dejagnu )
540 - nls? ( sys-devel/gettext )
541 - sys-devel/flex
542 - virtual/yacc
543 -"
544 -if is_cross ; then
545 - # The build assumes the host has libiberty and such when cross-compiling
546 - # its build tools. We should probably make binutils itself build a local
547 - # copy to use, but until then, be lazy.
548 - DEPEND+=" >=sys-libs/binutils-libs-${PV}"
549 -fi
550 -
551 -MY_BUILDDIR=${WORKDIR}/build
552 -
553 -src_unpack() {
554 - case ${PV} in
555 - *9999)
556 - git-r3_src_unpack
557 - ;;
558 - *)
559 - ;;
560 - esac
561 - default
562 - mkdir -p "${MY_BUILDDIR}"
563 -}
564 -
565 -src_prepare() {
566 - if [[ ! -z ${PATCH_VER} ]] ; then
567 - einfo "Applying binutils-${PATCH_BINUTILS_VER} patchset ${PATCH_VER}"
568 - eapply "${WORKDIR}/patch"/*.patch
569 - fi
570 -
571 - # This check should probably go somewhere else, like pkg_pretend.
572 - if [[ ${CTARGET} == *-uclibc* ]] ; then
573 - if grep -qs 'linux-gnu' "${S}"/ltconfig ; then
574 - die "sorry, but this binutils doesn't yet support uClibc :("
575 - fi
576 - fi
577 -
578 - # Make sure our explicit libdir paths don't get clobbered. #562460
579 - sed -i \
580 - -e 's:@bfdlibdir@:@libdir@:g' \
581 - -e 's:@bfdincludedir@:@includedir@:g' \
582 - {bfd,opcodes}/Makefile.in || die
583 -
584 - # Fix locale issues if possible #122216
585 - if [[ -e ${FILESDIR}/binutils-configure-LANG.patch ]] ; then
586 - einfo "Fixing misc issues in configure files"
587 - for f in $(find "${S}" -name configure -exec grep -l 'autoconf version 2.13' {} +) ; do
588 - ebegin " Updating ${f/${S}\/}"
589 - patch "${f}" "${FILESDIR}"/binutils-configure-LANG.patch >& "${T}"/configure-patch.log \
590 - || eerror "Please file a bug about this"
591 - eend $?
592 - done
593 - fi
594 -
595 - # Fix conflicts with newer glibc #272594
596 - if [[ -e libiberty/testsuite/test-demangle.c ]] ; then
597 - sed -i 's:\<getline\>:get_line:g' libiberty/testsuite/test-demangle.c
598 - fi
599 -
600 - # Apply things from PATCHES and user dirs
601 - default
602 -
603 - # Run misc portage update scripts
604 - gnuconfig_update
605 - elibtoolize --portage --no-uclibc
606 -}
607 -
608 -toolchain-binutils_bugurl() {
609 - printf "https://bugs.gentoo.org/"
610 -}
611 -toolchain-binutils_pkgversion() {
612 - printf "Gentoo ${PV}"
613 - [[ -n ${PATCH_VER} ]] && printf " p${PATCH_VER}"
614 -}
615 -
616 -src_configure() {
617 - # Setup some paths
618 - LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${PV}
619 - INCPATH=${LIBPATH}/include
620 - DATAPATH=/usr/share/binutils-data/${CTARGET}/${PV}
621 - if is_cross ; then
622 - TOOLPATH=/usr/${CHOST}/${CTARGET}
623 - else
624 - TOOLPATH=/usr/${CTARGET}
625 - fi
626 - BINPATH=${TOOLPATH}/binutils-bin/${PV}
627 -
628 - # Make sure we filter $LINGUAS so that only ones that
629 - # actually work make it through #42033
630 - strip-linguas -u */po
631 -
632 - # Keep things sane
633 - strip-flags
634 -
635 - local x
636 - echo
637 - for x in CATEGORY CBUILD CHOST CTARGET CFLAGS LDFLAGS ; do
638 - einfo "$(printf '%10s' ${x}:) ${!x}"
639 - done
640 - echo
641 -
642 - cd "${MY_BUILDDIR}"
643 - local myconf=()
644 -
645 - # enable gold (installed as ld.gold) and ld's plugin architecture
646 - if use cxx ; then
647 - myconf+=( --enable-gold )
648 - myconf+=( --enable-plugins )
649 - fi
650 -
651 - if use nls ; then
652 - myconf+=( --without-included-gettext )
653 - else
654 - myconf+=( --disable-nls )
655 - fi
656 -
657 - myconf+=( --with-system-zlib )
658 -
659 - # For bi-arch systems, enable a 64bit bfd. This matches
660 - # the bi-arch logic in toolchain.eclass. #446946
661 - # We used to do it for everyone, but it's slow on 32bit arches. #438522
662 - case $(tc-arch) in
663 - ppc|sparc|x86) myconf+=( --enable-64-bit-bfd ) ;;
664 - esac
665 -
666 - use multitarget && myconf+=( --enable-targets=all --enable-64-bit-bfd )
667 -
668 - [[ -n ${CBUILD} ]] && myconf+=( --build=${CBUILD} )
669 -
670 - is_cross && myconf+=(
671 - --with-sysroot="${EPREFIX}"/usr/${CTARGET}
672 - --enable-poison-system-directories
673 - )
674 -
675 - # glibc-2.3.6 lacks support for this ... so rather than force glibc-2.5+
676 - # on everyone in alpha (for now), we'll just enable it when possible
677 - has_version ">=${CATEGORY}/glibc-2.5" && myconf+=( --enable-secureplt )
678 - has_version ">=sys-libs/glibc-2.5" && myconf+=( --enable-secureplt )
679 -
680 - # mips can't do hash-style=gnu ...
681 - if [[ $(tc-arch) != mips ]] ; then
682 - myconf+=( --enable-default-hash-style=gnu )
683 - fi
684 -
685 - myconf+=(
686 - --prefix="${EPREFIX}"/usr
687 - --host=${CHOST}
688 - --target=${CTARGET}
689 - --datadir="${EPREFIX}"${DATAPATH}
690 - --datarootdir="${EPREFIX}"${DATAPATH}
691 - --infodir="${EPREFIX}"${DATAPATH}/info
692 - --mandir="${EPREFIX}"${DATAPATH}/man
693 - --bindir="${EPREFIX}"${BINPATH}
694 - --libdir="${EPREFIX}"${LIBPATH}
695 - --libexecdir="${EPREFIX}"${LIBPATH}
696 - --includedir="${EPREFIX}"${INCPATH}
697 - --enable-obsolete
698 - --enable-shared
699 - --enable-threads
700 - # Newer versions (>=2.27) offer a configure flag now.
701 - --enable-relro
702 - # Newer versions (>=2.24) make this an explicit option. #497268
703 - --enable-install-libiberty
704 - --disable-werror
705 - --with-bugurl="$(toolchain-binutils_bugurl)"
706 - --with-pkgversion="$(toolchain-binutils_pkgversion)"
707 - $(use_enable static-libs static)
708 - ${EXTRA_ECONF}
709 - # Disable modules that are in a combined binutils/gdb tree. #490566
710 - --disable-{gdb,libdecnumber,readline,sim}
711 - # Strip out broken static link flags.
712 - # https://gcc.gnu.org/PR56750
713 - --without-stage1-ldflags
714 - )
715 - echo ./configure "${myconf[@]}"
716 - "${S}"/configure "${myconf[@]}" || die
717 -
718 - # Prevent makeinfo from running if doc is unset.
719 - if ! use doc ; then
720 - sed -i \
721 - -e '/^MAKEINFO/s:=.*:= true:' \
722 - Makefile || die
723 - fi
724 -}
725 -
726 -src_compile() {
727 - cd "${MY_BUILDDIR}"
728 - # see Note [tooldir hack for ldscripts]
729 - emake tooldir="${EPREFIX}${TOOLPATH}" all
730 -
731 - # only build info pages if the user wants them
732 - if use doc ; then
733 - emake info
734 - fi
735 -
736 - # we nuke the manpages when we're left with junk
737 - # (like when we bootstrap, no perl -> no manpages)
738 - find . -name '*.1' -a -size 0 -delete
739 -}
740 -
741 -src_test() {
742 - cd "${MY_BUILDDIR}"
743 - emake -k check
744 -}
745 -
746 -src_install() {
747 - local x d
748 -
749 - cd "${MY_BUILDDIR}"
750 - # see Note [tooldir hack for ldscripts]
751 - emake DESTDIR="${D}" tooldir="${EPREFIX}${LIBPATH}" install
752 - rm -rf "${ED}"/${LIBPATH}/bin
753 - use static-libs || find "${ED}" -name '*.la' -delete
754 -
755 - # Newer versions of binutils get fancy with ${LIBPATH} #171905
756 - cd "${ED}"/${LIBPATH}
757 - for d in ../* ; do
758 - [[ ${d} == ../${PV} ]] && continue
759 - mv ${d}/* . || die
760 - rmdir ${d} || die
761 - done
762 -
763 - # Now we collect everything intp the proper SLOT-ed dirs
764 - # When something is built to cross-compile, it installs into
765 - # /usr/$CHOST/ by default ... we have to 'fix' that :)
766 - if is_cross ; then
767 - cd "${ED}"/${BINPATH}
768 - for x in * ; do
769 - mv ${x} ${x/${CTARGET}-}
770 - done
771 -
772 - if [[ -d ${ED}/usr/${CHOST}/${CTARGET} ]] ; then
773 - mv "${ED}"/usr/${CHOST}/${CTARGET}/include "${ED}"/${INCPATH}
774 - mv "${ED}"/usr/${CHOST}/${CTARGET}/lib/* "${ED}"/${LIBPATH}/
775 - rm -r "${ED}"/usr/${CHOST}/{include,lib}
776 - fi
777 - fi
778 - insinto ${INCPATH}
779 - local libiberty_headers=(
780 - # Not all the libiberty headers. See libiberty/Makefile.in:install_to_libdir.
781 - demangle.h
782 - dyn-string.h
783 - fibheap.h
784 - hashtab.h
785 - libiberty.h
786 - objalloc.h
787 - splay-tree.h
788 - )
789 - doins "${libiberty_headers[@]/#/${S}/include/}" || die
790 - if [[ -d ${ED}/${LIBPATH}/lib ]] ; then
791 - mv "${ED}"/${LIBPATH}/lib/* "${ED}"/${LIBPATH}/
792 - rm -r "${ED}"/${LIBPATH}/lib
793 - fi
794 -
795 - # Generate an env.d entry for this binutils
796 - insinto /etc/env.d/binutils
797 - cat <<-EOF > "${T}"/env.d
798 - TARGET="${CTARGET}"
799 - VER="${PV}"
800 - LIBPATH="${EPREFIX}${LIBPATH}"
801 - EOF
802 - newins "${T}"/env.d ${CTARGET}-${PV}
803 -
804 - # Handle documentation
805 - if ! is_cross ; then
806 - cd "${S}"
807 - dodoc README
808 - docinto bfd
809 - dodoc bfd/ChangeLog* bfd/README bfd/PORTING bfd/TODO
810 - docinto binutils
811 - dodoc binutils/ChangeLog binutils/NEWS binutils/README
812 - docinto gas
813 - dodoc gas/ChangeLog* gas/CONTRIBUTORS gas/NEWS gas/README*
814 - docinto gprof
815 - dodoc gprof/ChangeLog* gprof/TEST gprof/TODO gprof/bbconv.pl
816 - docinto ld
817 - dodoc ld/ChangeLog* ld/README ld/NEWS ld/TODO
818 - docinto libiberty
819 - dodoc libiberty/ChangeLog* libiberty/README
820 - docinto opcodes
821 - dodoc opcodes/ChangeLog*
822 - fi
823 -
824 - # Remove shared info pages
825 - rm -f "${ED}"/${DATAPATH}/info/{dir,configure.info,standards.info}
826 -
827 - # Trim all empty dirs
828 - find "${ED}" -depth -type d -exec rmdir {} + 2>/dev/null
829 -}
830 -
831 -pkg_postinst() {
832 - # Make sure this ${CTARGET} has a binutils version selected
833 - [[ -e ${EROOT}/etc/env.d/binutils/config-${CTARGET} ]] && return 0
834 - binutils-config ${CTARGET}-${PV}
835 -}
836 -
837 -pkg_postrm() {
838 - local current_profile=$(binutils-config -c ${CTARGET})
839 -
840 - # If no other versions exist, then uninstall for this
841 - # target ... otherwise, switch to the newest version
842 - # Note: only do this if this version is unmerged. We
843 - # rerun binutils-config if this is a remerge, as
844 - # we want the mtimes on the symlinks updated (if
845 - # it is the same as the current selected profile)
846 - if [[ ! -e ${EPREFIX}${BINPATH}/ld ]] && [[ ${current_profile} == ${CTARGET}-${PV} ]] ; then
847 - local choice=$(binutils-config -l | grep ${CTARGET} | awk '{print $2}')
848 - choice=${choice//$'\n'/ }
849 - choice=${choice/* }
850 - if [[ -z ${choice} ]] ; then
851 - binutils-config -u ${CTARGET}
852 - else
853 - binutils-config ${choice}
854 - fi
855 - elif [[ $(CHOST=${CTARGET} binutils-config -c) == ${CTARGET}-${PV} ]] ; then
856 - binutils-config ${CTARGET}-${PV}
857 - fi
858 -}
859 -
860 -# Note [slotting support]
861 -# -----------------------
862 -# Gentoo's layout for binutils files is non-standard as Gentoo
863 -# supports slotted installation for binutils. Many tools
864 -# still expect binutils to reside in known locations.
865 -# binutils-config package restores symlinks into known locations,
866 -# like:
867 -# /usr/bin/${CTARGET}-<tool>
868 -# /usr/bin/${CHOST}/${CTARGET}/lib/ldscrips
869 -# /usr/include/
870 -#
871 -# Note [tooldir hack for ldscripts]
872 -# ---------------------------------
873 -# Build system does not allow ./configure to tweak every location
874 -# we need for slotting binutils hence all the shuffling in
875 -# src_install(). This note is about SCRIPTDIR define handling.
876 -#
877 -# SCRIPTDIR defines 'ldscripts/' directory location. SCRIPTDIR value
878 -# is set at build-time in ld/Makefile.am as: 'scriptdir = $(tooldir)/lib'
879 -# and hardcoded as -DSCRIPTDIR='"$(scriptdir)"' at compile time.
880 -# Thus we can't just move files around after compilation finished.
881 -#
882 -# Our goal is the following:
883 -# - at build-time set scriptdir to point to symlinked location:
884 -# ${TOOLPATH}: /usr/${CHOST} (or /usr/${CHOST}/${CTARGET} for cross-case)
885 -# - at install-time set scriptdir to point to slotted location:
886 -# ${LIBPATH}: /usr/$(get_libdir)/binutils/${CTARGET}/${PV}