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-hppa64/
Date: Fri, 31 Jul 2020 16:06:18
Message-Id: 1596211554.3b33e7cfa5c6a94411539df2768cd1d98e0cc697.dilfridge@gentoo
1 commit: 3b33e7cfa5c6a94411539df2768cd1d98e0cc697
2 Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jul 31 15:52:13 2020 +0000
4 Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
5 CommitDate: Fri Jul 31 16:05:54 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3b33e7cf
7
8 sys-devel/binutils-hppa64: Bump to 2.34 patchlevel 6
9
10 Package-Manager: Portage-2.3.103, Repoman-2.3.23
11 Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
12
13 sys-devel/binutils-hppa64/Manifest | 1 +
14 .../binutils-hppa64/binutils-hppa64-2.34-r2.ebuild | 439 +++++++++++++++++++++
15 2 files changed, 440 insertions(+)
16
17 diff --git a/sys-devel/binutils-hppa64/Manifest b/sys-devel/binutils-hppa64/Manifest
18 index fcb40a674c2..b906ec41388 100644
19 --- a/sys-devel/binutils-hppa64/Manifest
20 +++ b/sys-devel/binutils-hppa64/Manifest
21 @@ -3,6 +3,7 @@ DIST binutils-2.32.tar.xz 20774880 BLAKE2B d1bdbd9c8487c091665c197974ce4bdf520b7
22 DIST binutils-2.33.1-patches-1.tar.xz 17944 BLAKE2B 811ad416fe9c059f645856a3123ed32303afe1d0f166a15cb6de0673b5494fdcc4c165da4a68eb7ab73f007618e3a97a5578c4b47de21e57fe501d6a21b6d595 SHA512 63b439637206d21e46d2b79383b38da2b28365a0fdea1f5ac3b665cd05e0b55cd1d7763c05567a5f7ae2c645d2ae639a27e465d535b928d9f8f0e6b94f31e1f7
23 DIST binutils-2.33.1.tar.xz 21490848 BLAKE2B c336a8412938dc8c224f40a763a8bea9937cca0462a8fb80e62f14aabe590107fc061a3f4b9327e1f4652cb026384d36a91b4766d4d469d2d0680932874b638c SHA512 b7a6767c6c7ca6b5cafa7080e6820b7bb3a53b7148348c438d99905defbdf0d30c9744a484ee01c9441a8153901808513366b15ba9533e20c9673c262ade36ac
24 DIST binutils-2.34-patches-4.tar.xz 95232 BLAKE2B 0a355120ecaf447d863f6d0837028061968166c9024da36212ce7d172ee2060e4027be1fca0089e38ab9073b5332307ff1dc05b868603bd2aa0ec8e88af7cd0a SHA512 e593edbeddaf97ef23fa8eb25c5714c7f2dd2500d11422bd9dba42e119884fe71593adc98862f74c7d391ceb298556ed049eee3c504733c634faef236045876b
25 +DIST binutils-2.34-patches-6.tar.xz 103028 BLAKE2B d0e866d0941d2b550c7d7f23530c6ee393fa13b4f2f27832f07790989476f11d1beddb5ad5a9be5c65c1d4dff9d4598d21adcb00c1d0490f69a99127f4527447 SHA512 e05ed8886acb5cb95a3e97c5bc0564215f7d44b604610f5c4545997fd9625d6de909c37063127e819926cd1548a48d3529dd3e82e98ee6a5dbaced028c57355d
26 DIST binutils-2.34.tar.xz 21637796 BLAKE2B 07dd23916a7d27f71c3f160c8c16abe2bd4fce294c738c665a012a3be6a87dbe8160d0c38740524f9025e01d438e99b2a94bcf9f9f79ee214f5dd033de8aad3d SHA512 2c7976939dcf5e8c5b7374cccd39bfe803b1bec73c6abfa0eb17c24e1942574c6bdb874c66a092a82adc443182eacd8a5a8001c19a76101f0c7ba40c27de0bbd
27 DIST binutils-2.35-patches-1.tar.xz 12216 BLAKE2B a811449da684e3501a7520a26639e04dda2f2d2fc8610974293eff3e4a1e23c4abeb97f52fe3b796679452bd6e3a5330fef4beb6f64b9ce2a1162076803390a0 SHA512 b8da16a4d97b264da925cc939b54bedbc148eb72a8d60f79d7ed222e9e299dca2a4f1fad4a6d60448d9d196c11331443eca0508dcbb85cb4c2da6c67bfaf4cd2
28 DIST binutils-2.35.tar.xz 22042160 BLAKE2B 72ea79edf3a77aa93dcf38274123abbae5ce8f800a95e6379b4c8807050b05c2dfec314f06c027b1343c5570f369324fa3e195d7e0db5f8a57c0579937c49d3f SHA512 9f222e4ab6720036402d03904fb11b73ab87714b85cd84997f7d357f405c7e10581d70202f9165a1ee0c70538632db27ecc9dfe627dddb1e6bc7edb1537cf786
29
30 diff --git a/sys-devel/binutils-hppa64/binutils-hppa64-2.34-r2.ebuild b/sys-devel/binutils-hppa64/binutils-hppa64-2.34-r2.ebuild
31 new file mode 100644
32 index 00000000000..9fef7573cba
33 --- /dev/null
34 +++ b/sys-devel/binutils-hppa64/binutils-hppa64-2.34-r2.ebuild
35 @@ -0,0 +1,439 @@
36 +# Copyright 1999-2020 Gentoo Authors
37 +# Distributed under the terms of the GNU General Public License v2
38 +
39 +EAPI=7
40 +
41 +export CTARGET=hppa64-${CHOST#*-}
42 +
43 +inherit eutils libtool flag-o-matic gnuconfig multilib toolchain-funcs
44 +
45 +DESCRIPTION="Tools necessary to build programs"
46 +HOMEPAGE="https://sourceware.org/binutils/"
47 +LICENSE="GPL-3+"
48 +IUSE="default-gold doc +gold multitarget +nls +plugins static-libs test"
49 +REQUIRED_USE="default-gold? ( gold )"
50 +
51 +# Variables that can be set here:
52 +# PATCH_VER - the patchset version
53 +# Default: empty, no patching
54 +# PATCH_BINUTILS_VER - the binutils version in the patchset name
55 +# - Default: PV
56 +# PATCH_DEV - Use download URI https://dev.gentoo.org/~{PATCH_DEV}/distfiles/...
57 +# for the patchsets
58 +
59 +PATCH_VER=6
60 +PATCH_DEV=dilfridge
61 +
62 +case ${PV} in
63 + 9999)
64 + EGIT_REPO_URI="https://sourceware.org/git/binutils-gdb.git"
65 + inherit git-r3
66 + S=${WORKDIR}/binutils
67 + EGIT_CHECKOUT_DIR=${S}
68 + SLOT=${PV}
69 + ;;
70 + *.9999)
71 + EGIT_REPO_URI="https://sourceware.org/git/binutils-gdb.git"
72 + inherit git-r3
73 + S=${WORKDIR}/binutils
74 + EGIT_CHECKOUT_DIR=${S}
75 + EGIT_BRANCH=$(ver_cut 1-2)
76 + EGIT_BRANCH="binutils-${EGIT_BRANCH/./_}-branch"
77 + SLOT=$(ver_cut 1-2)
78 + ;;
79 + *)
80 + SRC_URI="mirror://gnu/binutils/binutils-${PV}.tar.xz"
81 + SLOT=$(ver_cut 1-2)
82 + KEYWORDS="-* ~hppa"
83 + ;;
84 +esac
85 +
86 +#
87 +# The Gentoo patchset
88 +#
89 +PATCH_BINUTILS_VER=${PATCH_BINUTILS_VER:-${PV}}
90 +PATCH_DEV=${PATCH_DEV:-slyfox}
91 +
92 +[[ -z ${PATCH_VER} ]] || SRC_URI="${SRC_URI}
93 + https://dev.gentoo.org/~${PATCH_DEV}/distfiles/binutils-${PATCH_BINUTILS_VER}-patches-${PATCH_VER}.tar.xz"
94 +
95 +#
96 +# The cross-compile logic
97 +#
98 +export CTARGET=${CTARGET:-${CHOST}}
99 +if [[ ${CTARGET} == ${CHOST} ]] ; then
100 + if [[ ${CATEGORY} == cross-* ]] ; then
101 + export CTARGET=${CATEGORY#cross-}
102 + fi
103 +fi
104 +is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
105 +
106 +#
107 +# The dependencies
108 +#
109 +RDEPEND="
110 + >=sys-devel/binutils-config-3
111 + sys-libs/zlib
112 +"
113 +DEPEND="${RDEPEND}"
114 +BDEPEND="
115 + doc? ( sys-apps/texinfo )
116 + test? ( dev-util/dejagnu )
117 + nls? ( sys-devel/gettext )
118 + sys-devel/flex
119 + virtual/yacc
120 +"
121 +
122 +RESTRICT="!test? ( test )"
123 +
124 +MY_BUILDDIR=${WORKDIR}/build
125 +S=${WORKDIR}/${P/-hppa64/}
126 +
127 +src_unpack() {
128 + case ${PV} in
129 + *9999)
130 + git-r3_src_unpack
131 + ;;
132 + *)
133 + ;;
134 + esac
135 + default
136 + mkdir -p "${MY_BUILDDIR}"
137 +}
138 +
139 +src_prepare() {
140 + if [[ ! -z ${PATCH_VER} ]] ; then
141 + einfo "Applying binutils-${PATCH_BINUTILS_VER} patchset ${PATCH_VER}"
142 + eapply "${WORKDIR}/patch"/*.patch
143 + fi
144 +
145 + # This check should probably go somewhere else, like pkg_pretend.
146 + if [[ ${CTARGET} == *-uclibc* ]] ; then
147 + if grep -qs 'linux-gnu' "${S}"/ltconfig ; then
148 + die "sorry, but this binutils doesn't yet support uClibc :("
149 + fi
150 + fi
151 +
152 + # Make sure our explicit libdir paths don't get clobbered. #562460
153 + sed -i \
154 + -e 's:@bfdlibdir@:@libdir@:g' \
155 + -e 's:@bfdincludedir@:@includedir@:g' \
156 + {bfd,opcodes}/Makefile.in || die
157 +
158 + # Fix locale issues if possible #122216
159 + if [[ -e ${FILESDIR}/binutils-configure-LANG.patch ]] ; then
160 + einfo "Fixing misc issues in configure files"
161 + for f in $(find "${S}" -name configure -exec grep -l 'autoconf version 2.13' {} +) ; do
162 + ebegin " Updating ${f/${S}\/}"
163 + patch "${f}" "${FILESDIR}"/binutils-configure-LANG.patch >& "${T}"/configure-patch.log \
164 + || eerror "Please file a bug about this"
165 + eend $?
166 + done
167 + fi
168 +
169 + # Fix conflicts with newer glibc #272594
170 + if [[ -e libiberty/testsuite/test-demangle.c ]] ; then
171 + sed -i 's:\<getline\>:get_line:g' libiberty/testsuite/test-demangle.c
172 + fi
173 +
174 + # Apply things from PATCHES and user dirs
175 + default
176 +
177 + # Run misc portage update scripts
178 + gnuconfig_update
179 + elibtoolize --portage --no-uclibc
180 +}
181 +
182 +toolchain-binutils_bugurl() {
183 + printf "https://bugs.gentoo.org/"
184 +}
185 +toolchain-binutils_pkgversion() {
186 + printf "Gentoo ${PV}"
187 + [[ -n ${PATCH_VER} ]] && printf " p${PATCH_VER}"
188 +}
189 +
190 +src_configure() {
191 + # Setup some paths
192 + LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${PV}
193 + INCPATH=${LIBPATH}/include
194 + DATAPATH=/usr/share/binutils-data/${CTARGET}/${PV}
195 + if is_cross ; then
196 + TOOLPATH=/usr/${CHOST}/${CTARGET}
197 + else
198 + TOOLPATH=/usr/${CTARGET}
199 + fi
200 + BINPATH=${TOOLPATH}/binutils-bin/${PV}
201 +
202 + # Make sure we filter $LINGUAS so that only ones that
203 + # actually work make it through #42033
204 + strip-linguas -u */po
205 +
206 + # Keep things sane
207 + strip-flags
208 +
209 + local x
210 + echo
211 + for x in CATEGORY CBUILD CHOST CTARGET CFLAGS LDFLAGS ; do
212 + einfo "$(printf '%10s' ${x}:) ${!x}"
213 + done
214 + echo
215 +
216 + cd "${MY_BUILDDIR}"
217 + local myconf=()
218 +
219 + if use plugins ; then
220 + myconf+=( --enable-plugins )
221 + fi
222 + # enable gold (installed as ld.gold) and ld's plugin architecture
223 + if use gold ; then
224 + myconf+=( --enable-gold )
225 + if use default-gold; then
226 + myconf+=( --enable-gold=default )
227 + fi
228 + fi
229 +
230 + if use nls ; then
231 + myconf+=( --without-included-gettext )
232 + else
233 + myconf+=( --disable-nls )
234 + fi
235 +
236 + myconf+=( --with-system-zlib )
237 +
238 + # For bi-arch systems, enable a 64bit bfd. This matches
239 + # the bi-arch logic in toolchain.eclass. #446946
240 + # We used to do it for everyone, but it's slow on 32bit arches. #438522
241 + case $(tc-arch) in
242 + ppc|sparc|x86) myconf+=( --enable-64-bit-bfd ) ;;
243 + esac
244 +
245 + use multitarget && myconf+=( --enable-targets=all --enable-64-bit-bfd )
246 +
247 + [[ -n ${CBUILD} ]] && myconf+=( --build=${CBUILD} )
248 +
249 + is_cross && myconf+=(
250 + --with-sysroot="${EPREFIX}"/usr/${CTARGET}
251 + --enable-poison-system-directories
252 + )
253 +
254 + # glibc-2.3.6 lacks support for this ... so rather than force glibc-2.5+
255 + # on everyone in alpha (for now), we'll just enable it when possible
256 + has_version ">=${CATEGORY}/glibc-2.5" && myconf+=( --enable-secureplt )
257 + has_version ">=sys-libs/glibc-2.5" && myconf+=( --enable-secureplt )
258 +
259 + # mips can't do hash-style=gnu ...
260 + if [[ $(tc-arch) != mips ]] ; then
261 + myconf+=( --enable-default-hash-style=gnu )
262 + fi
263 +
264 + myconf+=(
265 + --prefix="${EPREFIX}"/usr
266 + --host=${CHOST}
267 + --target=${CTARGET}
268 + --datadir="${EPREFIX}"${DATAPATH}
269 + --datarootdir="${EPREFIX}"${DATAPATH}
270 + --infodir="${EPREFIX}"${DATAPATH}/info
271 + --mandir="${EPREFIX}"${DATAPATH}/man
272 + --bindir="${EPREFIX}"${BINPATH}
273 + --libdir="${EPREFIX}"${LIBPATH}
274 + --libexecdir="${EPREFIX}"${LIBPATH}
275 + --includedir="${EPREFIX}"${INCPATH}
276 + --enable-obsolete
277 + --enable-shared
278 + --enable-threads
279 + # Newer versions (>=2.27) offer a configure flag now.
280 + --enable-relro
281 + # Newer versions (>=2.24) make this an explicit option. #497268
282 + --enable-install-libiberty
283 + --disable-werror
284 + --with-bugurl="$(toolchain-binutils_bugurl)"
285 + --with-pkgversion="$(toolchain-binutils_pkgversion)"
286 + $(use_enable static-libs static)
287 + ${EXTRA_ECONF}
288 + # Disable modules that are in a combined binutils/gdb tree. #490566
289 + --disable-{gdb,libdecnumber,readline,sim}
290 + # Strip out broken static link flags.
291 + # https://gcc.gnu.org/PR56750
292 + --without-stage1-ldflags
293 + # Change SONAME to avoid conflict across
294 + # {native,cross}/binutils, binutils-libs. #666100
295 + --with-extra-soversion-suffix=gentoo-${CATEGORY}-${PN}-$(usex multitarget mt st)
296 + )
297 + echo ./configure "${myconf[@]}"
298 + "${S}"/configure "${myconf[@]}" || die
299 +
300 + # Prevent makeinfo from running if doc is unset.
301 + if ! use doc ; then
302 + sed -i \
303 + -e '/^MAKEINFO/s:=.*:= true:' \
304 + Makefile || die
305 + fi
306 +}
307 +
308 +src_compile() {
309 + cd "${MY_BUILDDIR}"
310 + # see Note [tooldir hack for ldscripts]
311 + emake tooldir="${EPREFIX}${TOOLPATH}" all
312 +
313 + # only build info pages if the user wants them
314 + if use doc ; then
315 + emake info
316 + fi
317 +
318 + # we nuke the manpages when we're left with junk
319 + # (like when we bootstrap, no perl -> no manpages)
320 + find . -name '*.1' -a -size 0 -delete
321 +}
322 +
323 +src_test() {
324 + cd "${MY_BUILDDIR}"
325 + # bug 637066
326 + filter-flags -Wall -Wreturn-type
327 + emake -k check
328 +}
329 +
330 +src_install() {
331 + local x d
332 +
333 + cd "${MY_BUILDDIR}"
334 + # see Note [tooldir hack for ldscripts]
335 + emake DESTDIR="${D}" tooldir="${EPREFIX}${LIBPATH}" install
336 + rm -rf "${ED}"/${LIBPATH}/bin
337 + use static-libs || find "${ED}" -name '*.la' -delete
338 +
339 + # Newer versions of binutils get fancy with ${LIBPATH} #171905
340 + cd "${ED}"/${LIBPATH}
341 + for d in ../* ; do
342 + [[ ${d} == ../${PV} ]] && continue
343 + mv ${d}/* . || die
344 + rmdir ${d} || die
345 + done
346 +
347 + # Now we collect everything intp the proper SLOT-ed dirs
348 + # When something is built to cross-compile, it installs into
349 + # /usr/$CHOST/ by default ... we have to 'fix' that :)
350 + if is_cross ; then
351 + cd "${ED}"/${BINPATH}
352 + for x in * ; do
353 + mv ${x} ${x/${CTARGET}-}
354 + done
355 +
356 + if [[ -d ${ED}/usr/${CHOST}/${CTARGET} ]] ; then
357 + mv "${ED}"/usr/${CHOST}/${CTARGET}/include "${ED}"/${INCPATH}
358 + mv "${ED}"/usr/${CHOST}/${CTARGET}/lib/* "${ED}"/${LIBPATH}/
359 + rm -r "${ED}"/usr/${CHOST}/{include,lib}
360 + fi
361 + fi
362 + insinto ${INCPATH}
363 + local libiberty_headers=(
364 + # Not all the libiberty headers. See libiberty/Makefile.in:install_to_libdir.
365 + demangle.h
366 + dyn-string.h
367 + fibheap.h
368 + hashtab.h
369 + libiberty.h
370 + objalloc.h
371 + splay-tree.h
372 + )
373 + doins "${libiberty_headers[@]/#/${S}/include/}"
374 + if [[ -d ${ED}/${LIBPATH}/lib ]] ; then
375 + mv "${ED}"/${LIBPATH}/lib/* "${ED}"/${LIBPATH}/
376 + rm -r "${ED}"/${LIBPATH}/lib
377 + fi
378 +
379 + # Generate an env.d entry for this binutils
380 + insinto /etc/env.d/binutils
381 + cat <<-EOF > "${T}"/env.d
382 + TARGET="${CTARGET}"
383 + VER="${PV}"
384 + LIBPATH="${EPREFIX}${LIBPATH}"
385 + EOF
386 + newins "${T}"/env.d ${CTARGET}-${PV}
387 +
388 + # Handle documentation
389 + if ! is_cross ; then
390 + cd "${S}"
391 + dodoc README
392 + docinto bfd
393 + dodoc bfd/ChangeLog* bfd/README bfd/PORTING bfd/TODO
394 + docinto binutils
395 + dodoc binutils/ChangeLog binutils/NEWS binutils/README
396 + docinto gas
397 + dodoc gas/ChangeLog* gas/CONTRIBUTORS gas/NEWS gas/README*
398 + docinto gprof
399 + dodoc gprof/ChangeLog* gprof/TEST gprof/TODO gprof/bbconv.pl
400 + docinto ld
401 + dodoc ld/ChangeLog* ld/README ld/NEWS ld/TODO
402 + docinto libiberty
403 + dodoc libiberty/ChangeLog* libiberty/README
404 + docinto opcodes
405 + dodoc opcodes/ChangeLog*
406 + fi
407 +
408 + # Remove shared info pages
409 + rm -f "${ED}"/${DATAPATH}/info/{dir,configure.info,standards.info}
410 +
411 + # Trim all empty dirs
412 + find "${ED}" -depth -type d -exec rmdir {} + 2>/dev/null
413 +
414 + # the hppa64 hack; this should go into 9999 as a PN-conditional
415 + # tweak the default fake list a little bit
416 + cd "${D}"/etc/env.d/binutils
417 + sed -i '/FAKE_TARGETS=/s:"$: hppa64-linux":' ${CTARGET}-${PV} || die
418 +}
419 +
420 +pkg_postinst() {
421 + # Make sure this ${CTARGET} has a binutils version selected
422 + [[ -e ${EROOT}/etc/env.d/binutils/config-${CTARGET} ]] && return 0
423 + binutils-config ${CTARGET}-${PV}
424 +}
425 +
426 +pkg_postrm() {
427 + local current_profile=$(binutils-config -c ${CTARGET})
428 +
429 + # If no other versions exist, then uninstall for this
430 + # target ... otherwise, switch to the newest version
431 + # Note: only do this if this version is unmerged. We
432 + # rerun binutils-config if this is a remerge, as
433 + # we want the mtimes on the symlinks updated (if
434 + # it is the same as the current selected profile)
435 + if [[ ! -e ${EPREFIX}${BINPATH}/ld ]] && [[ ${current_profile} == ${CTARGET}-${PV} ]] ; then
436 + local choice=$(binutils-config -l | grep ${CTARGET} | awk '{print $2}')
437 + choice=${choice//$'\n'/ }
438 + choice=${choice/* }
439 + if [[ -z ${choice} ]] ; then
440 + binutils-config -u ${CTARGET}
441 + else
442 + binutils-config ${choice}
443 + fi
444 + elif [[ $(CHOST=${CTARGET} binutils-config -c) == ${CTARGET}-${PV} ]] ; then
445 + binutils-config ${CTARGET}-${PV}
446 + fi
447 +}
448 +# Note [slotting support]
449 +# -----------------------
450 +# Gentoo's layout for binutils files is non-standard as Gentoo
451 +# supports slotted installation for binutils. Many tools
452 +# still expect binutils to reside in known locations.
453 +# binutils-config package restores symlinks into known locations,
454 +# like:
455 +# /usr/bin/${CTARGET}-<tool>
456 +# /usr/bin/${CHOST}/${CTARGET}/lib/ldscrips
457 +# /usr/include/
458 +#
459 +# Note [tooldir hack for ldscripts]
460 +# ---------------------------------
461 +# Build system does not allow ./configure to tweak every location
462 +# we need for slotting binutils hence all the shuffling in
463 +# src_install(). This note is about SCRIPTDIR define handling.
464 +#
465 +# SCRIPTDIR defines 'ldscripts/' directory location. SCRIPTDIR value
466 +# is set at build-time in ld/Makefile.am as: 'scriptdir = $(tooldir)/lib'
467 +# and hardcoded as -DSCRIPTDIR='"$(scriptdir)"' at compile time.
468 +# Thus we can't just move files around after compilation finished.
469 +#
470 +# Our goal is the following:
471 +# - at build-time set scriptdir to point to symlinked location:
472 +# ${TOOLPATH}: /usr/${CHOST} (or /usr/${CHOST}/${CTARGET} for cross-case)
473 +# - at install-time set scriptdir to point to slotted location:
474 +# ${LIBPATH}: /usr/$(get_libdir)/binutils/${CTARGET}/${PV}