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