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: Sat, 24 Jul 2021 22:54:03
Message-Id: 1627167225.30845f7ac222de85e8cc17f6122d07a5bb8da1d1.dilfridge@gentoo
1 commit: 30845f7ac222de85e8cc17f6122d07a5bb8da1d1
2 Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
3 AuthorDate: Sat Jul 24 22:51:30 2021 +0000
4 Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
5 CommitDate: Sat Jul 24 22:53:45 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=30845f7a
7
8 sys-devel/binutils-hppa64: Bump 2.36.1 patchset to 4
9
10 Package-Manager: Portage-3.0.20, Repoman-3.0.3
11 Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
12
13 sys-devel/binutils-hppa64/Manifest | 1 +
14 .../binutils-hppa64-2.36.1-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 1543bc0e0d4..f802743c4cd 100644
19 --- a/sys-devel/binutils-hppa64/Manifest
20 +++ b/sys-devel/binutils-hppa64/Manifest
21 @@ -1,6 +1,7 @@
22 DIST binutils-2.35.2-patches-1.tar.xz 11836 BLAKE2B 0141349c9618992d1ab1e0309f7ed8fbc43b60a58be1dfed05eae8a8fee857241d9e112ae673da6fc9778767675f536ece818cb85567367bb1c8f87a0693623f SHA512 35de5f227c745c5fb800784fe657b2a6216faf43e2498e8481e7b0dc79b0d2f86b3b6a10b896e060319a77a51c61d2e1b7a951ae962b3a6ef8c1a2a261d9bb6c
23 DIST binutils-2.35.2.tar.xz 22056908 BLAKE2B 9c392e0db2b482442f9476f30bd80cf2796321cbf7be79cf21af7bef167b6074c4ae009dcf9b438d2f2f4a23381c935176b2cfa85de1a526ab46e0fd844a7ca5 SHA512 9974ede5978d32e0d68fef23da48fa00bd06b0bff7ec45b00ca075c126d6bbe0cf2defc03ecc3f17bc6cc85b64271a13009c4049d7ba17de26e84e3a6e2c0348
24 DIST binutils-2.36.1-patches-3.tar.xz 32720 BLAKE2B 2a5a60168ec5ff612e7e58530092f306460cdb4a963320978dffcc22d73684486a14a5981f6eab2f7fc270def22cdc9954de455d680b2de4befc1ad4916347ba SHA512 e429cc82451675f14715d4e7640fe7b995495c8759a8e919c4291f8ca8358a663012f05c1ec6e60b1261114848379fefc9df723929770462dd676fa04fc7aa54
25 +DIST binutils-2.36.1-patches-4.tar.xz 43508 BLAKE2B 116cefcbf4641f1ab649bb0345b80a23c29d1d3340d16f87068a1cffb911e4633f3e6da235534cd79c601cb4168bc78f9b7115185a49cdec78b6e7de7856b344 SHA512 3de95f1bb3787eeb7e942e2a9cf4a2bf967c5758158c3daf76b81a62ccefe5569b0a300cdc02e2e702c61a0cfc63d4209a7d306179cdddc3bc544d21b744eb82
26 DIST binutils-2.36.1.tar.xz 22772248 BLAKE2B 03fbfbedd6dba2beaa836b1ed254eddd7a54a163d3061fd93edd2b9591cae24ba049b26658c524b5ccecc2f22d431dfa168218d2531aa356945c994fbbe896fa SHA512 cc24590bcead10b90763386b6f96bb027d7594c659c2d95174a6352e8b98465a50ec3e4088d0da038428abe059bbc4ae5f37b269f31a40fc048072c8a234f4e9
27 DIST binutils-2.37-patches-2.tar.xz 79304 BLAKE2B bdcbe29efba3582f2d1be9057a39aedb655cbc225abe8ea656c1bcf090a53930c74197505c8de2dcfd9a105f1b1cc8fa84a0d532547221d2df34a77b06e7fa15 SHA512 5cea876cfbdcd1409f5ef8ee138a8c29ad5b3d38b5d72ce312f2eb94fb8b2165e9a10018c46bdc36bc59ade2e2764e5da4ac653d15690bfc0bc9784202cc0164
28 DIST binutils-2.37.tar.xz 22916924 BLAKE2B f5a374fdf0300f7734d1e462333296b16c9d5ed6eba167e1742a4da7082f4388c929e286bf76c3933b3e434937380340732a31790723654b491ea0c8ab5b9ba5 SHA512 5c11aeef6935860a6819ed3a3c93371f052e52b4bdc5033da36037c1544d013b7f12cb8d561ec954fe7469a68f1b66f1a3cd53d5a3af7293635a90d69edd15e7
29
30 diff --git a/sys-devel/binutils-hppa64/binutils-hppa64-2.36.1-r2.ebuild b/sys-devel/binutils-hppa64/binutils-hppa64-2.36.1-r2.ebuild
31 new file mode 100644
32 index 00000000000..50bbff890e1
33 --- /dev/null
34 +++ b/sys-devel/binutils-hppa64/binutils-hppa64-2.36.1-r2.ebuild
35 @@ -0,0 +1,439 @@
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="cet 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=4
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 + # Allow user to opt into CET for host libraries.
293 + # Ideally we would like automagic-or-disabled here.
294 + # But the check does not quite work on i686: bug #760926.
295 + $(use_enable cet)
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}