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