Gentoo Archives: gentoo-commits

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