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/gdb/files/, sys-devel/gdb/
Date: Sun, 29 Mar 2020 10:11:16
Message-Id: 1585476658.3d246a8e7d1e202cc441001a27b358d79cd97366.slyfox@gentoo
1 commit: 3d246a8e7d1e202cc441001a27b358d79cd97366
2 Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
3 AuthorDate: Sun Mar 29 10:10:58 2020 +0000
4 Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
5 CommitDate: Sun Mar 29 10:10:58 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3d246a8e
7
8 sys-devel/gdb: drop 8.3.1, bug #690582
9
10 Bug: https://bugs.gentoo.org/690582
11 Package-Manager: Portage-2.3.96, Repoman-2.3.22
12 Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>
13
14 sys-devel/gdb/Manifest | 1 -
15 sys-devel/gdb/files/gdb-8.3.1-gcc-10.patch | 222 ------------------------
16 sys-devel/gdb/gdb-8.3.1-r1.ebuild | 262 -----------------------------
17 sys-devel/gdb/gdb-8.3.1.ebuild | 260 ----------------------------
18 4 files changed, 745 deletions(-)
19
20 diff --git a/sys-devel/gdb/Manifest b/sys-devel/gdb/Manifest
21 index 7770b5e8807..5c3fc0f0d88 100644
22 --- a/sys-devel/gdb/Manifest
23 +++ b/sys-devel/gdb/Manifest
24 @@ -1,2 +1 @@
25 -DIST gdb-8.3.1.tar.xz 20489528 BLAKE2B 5a671f620a2ed3337486a8ff53b93d65b3b6079e59ea07bc0f31e3ea6d459ced1d8549a76cfcf124762e0890e243eaabcf8b204bfc631002e759339a89b9bf9a SHA512 9053a2dc6b9eb921907afbc4cecc75d635aa76df5e8c4f0e5824ccf57cb206b299c19b127fff000b65c334826ff8304a54ff6098428365a8e997cca886c39e9a
26 DIST gdb-9.1.tar.xz 20980824 BLAKE2B b84b1dc627d7ba697dfd76ba7c0f4f88f1725e1e1b83134d08cf53bf867ebfa07e1d01eff2acd9a57d22a779077bf6ed95d6098e8a58c4d86eaed034ca62ac30 SHA512 84cdd408d80a3fc5779de459c5b26154d31b329ebde7e3aa78799fb1eb245d8b64b8c8ee7242382a1dbd95b4e6f9d84fef41d12a0646aa75d3dee4709ea1f6e7
27
28 diff --git a/sys-devel/gdb/files/gdb-8.3.1-gcc-10.patch b/sys-devel/gdb/files/gdb-8.3.1-gcc-10.patch
29 deleted file mode 100644
30 index affc3b7392a..00000000000
31 --- a/sys-devel/gdb/files/gdb-8.3.1-gcc-10.patch
32 +++ /dev/null
33 @@ -1,222 +0,0 @@
34 -From 851c0536cabb661847c45c73ebd796eb3299066b Mon Sep 17 00:00:00 2001
35 -Date: Tue, 26 Nov 2019 12:52:56 -0300
36 -Subject: [PATCH] [ARM, sim] Fix build error and warnings
37 -From: Luis Machado <luis.machado@××××××.org>
38 -
39 -Newer GCC's have switched to -fno-common by default, and this breaks the build
40 -for the ARM sim, like this:
41 -
42 -binutils-gdb.git~gdb-8.3-release/sim/arm/maverick.c:65: multiple definition of `DSPsc'; libsim.a(wrapper.o):binutils-gdb.git~gdb-8.3-release/sim/arm/wrapper.c:134: first defined here
43 -binutils-gdb.git~gdb-8.3-release/sim/arm/maverick.c:64: multiple definition of `DSPacc'; libsim.a(wrapper.o):binutils-gdb.git~gdb-8.3-release/sim/arm/wrapper.c:133: first defined here
44 -binutils-gdb.git~gdb-8.3-release/sim/arm/maverick.c:63: multiple definition of `DSPregs'; libsim.a(wrapper.o):binutils-gdb.git~gdb-8.3-release/sim/arm/wrapper.c:132: first defined here
45 -
46 -I also noticed a few warnings due to mismatching types, as follows:
47 -
48 -../../../../repos/binutils-gdb/sim/arm/wrapper.c: In function ‘sim_create_inferior’:
49 -../../../../repos/binutils-gdb/sim/arm/wrapper.c:335:16: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
50 - for (arg = argv; *arg != NULL; arg++)
51 - ^
52 -../../../../repos/binutils-gdb/sim/arm/wrapper.c:342:8: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
53 - arg = argv;
54 - ^
55 -../../../../repos/binutils-gdb/sim/arm/wrapper.c:345:13: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
56 - for (arg = argv; *arg != NULL; arg++)
57 - ^
58 -The following patch fixes both of the above.
59 -
60 -Change-Id: I21db699d3b61b2de8c44053e47be4387285af28f
61 ----
62 - sim/arm/armemu.c | 4 ----
63 - sim/arm/arminit.c | 4 ++++
64 - sim/arm/maverick.c | 35 +++++------------------------------
65 - sim/arm/maverick.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++
66 - sim/arm/wrapper.c | 35 ++---------------------------------
67 - create mode 100644 sim/arm/maverick.h
68 -
69 ---- a/sim/arm/armemu.c
70 -+++ b/sim/arm/armemu.c
71 -@@ -1140,10 +1140,6 @@ handle_VFP_move (ARMul_State * state, ARMword instr)
72 -
73 - /* EMULATION of ARM6. */
74 -
75 --/* The PC pipeline value depends on whether ARM
76 -- or Thumb instructions are being executed. */
77 --ARMword isize;
78 --
79 - ARMword
80 - #ifdef MODE32
81 - ARMul_Emulate32 (ARMul_State * state)
82 ---- a/sim/arm/arminit.c
83 -+++ b/sim/arm/arminit.c
84 -@@ -40,6 +40,10 @@ unsigned ARMul_MultTable[32] =
85 - ARMword ARMul_ImmedTable[4096]; /* immediate DP LHS values */
86 - char ARMul_BitList[256]; /* number of bits in a byte table */
87 -
88 -+/* The PC pipeline value depends on whether ARM
89 -+ or Thumb instructions are being executed. */
90 -+ARMword isize;
91 -+
92 - /***************************************************************************\
93 - * Call this routine once to set up the emulator's tables. *
94 - \***************************************************************************/
95 ---- a/sim/arm/maverick.c
96 -+++ b/sim/arm/maverick.c
97 -@@ -19,6 +19,7 @@
98 - #include "armdefs.h"
99 - #include "ansidecl.h"
100 - #include "armemu.h"
101 -+#include "maverick.h"
102 -
103 - /*#define CIRRUS_DEBUG 1 */
104 - #if CIRRUS_DEBUG
105 -@@ -30,36 +31,10 @@
106 - #define POS64(i) ( (~(i)) >> 63 )
107 - #define NEG64(i) ( (i) >> 63 )
108 -
109 --/* Define Co-Processor instruction handlers here. */
110 --
111 --/* Here's ARMulator's DSP definition. A few things to note:
112 -- 1) it has 16 64-bit registers and 4 72-bit accumulators
113 -- 2) you can only access its registers with MCR and MRC. */
114 --
115 --/* We can't define these in here because this file might not be linked
116 -- unless the target is arm9e-*. They are defined in wrapper.c.
117 -- Eventually the simulator should be made to handle any coprocessor
118 -- at run time. */
119 --struct maverick_regs
120 --{
121 -- union
122 -- {
123 -- int i;
124 -- float f;
125 -- } upper;
126 --
127 -- union
128 -- {
129 -- int i;
130 -- float f;
131 -- } lower;
132 --};
133 --
134 --union maverick_acc_regs
135 --{
136 -- long double ld; /* Acc registers are 72-bits. */
137 --};
138 --
139 -+/* These variables are defined here and made extern in maverick.h for use
140 -+ in wrapper.c for now.
141 -+ Eventually the simulator should be made to handle any coprocessor at run
142 -+ time. */
143 - struct maverick_regs DSPregs[16];
144 - union maverick_acc_regs DSPacc[4];
145 - ARMword DSPsc;
146 ---- /dev/null
147 -+++ b/sim/arm/maverick.h
148 -@@ -0,0 +1,46 @@
149 -+/* maverick.h -- Cirrus/DSP co-processor interface header
150 -+ Copyright (C) 2003-2019 Free Software Foundation, Inc.
151 -+ Contributed by Aldy Hernandez (aldyh@××××××.com).
152 -+
153 -+ This program is free software; you can redistribute it and/or modify
154 -+ it under the terms of the GNU General Public License as published by
155 -+ the Free Software Foundation; either version 3 of the License, or
156 -+ (at your option) any later version.
157 -+
158 -+ This program is distributed in the hope that it will be useful,
159 -+ but WITHOUT ANY WARRANTY; without even the implied warranty of
160 -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
161 -+ GNU General Public License for more details.
162 -+
163 -+ You should have received a copy of the GNU General Public License
164 -+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
165 -+
166 -+/* Define Co-Processor instruction handlers here. */
167 -+
168 -+/* Here's ARMulator's DSP definition. A few things to note:
169 -+ 1) it has 16 64-bit registers and 4 72-bit accumulators
170 -+ 2) you can only access its registers with MCR and MRC. */
171 -+
172 -+struct maverick_regs
173 -+{
174 -+ union
175 -+ {
176 -+ int i;
177 -+ float f;
178 -+ } upper;
179 -+
180 -+ union
181 -+ {
182 -+ int i;
183 -+ float f;
184 -+ } lower;
185 -+};
186 -+
187 -+union maverick_acc_regs
188 -+{
189 -+ long double ld; /* Acc registers are 72-bits. */
190 -+};
191 -+
192 -+extern struct maverick_regs DSPregs[16];
193 -+extern union maverick_acc_regs DSPacc[4];
194 -+extern ARMword DSPsc;
195 ---- a/sim/arm/wrapper.c
196 -+++ b/sim/arm/wrapper.c
197 -@@ -37,6 +37,7 @@
198 - #include "gdb/signals.h"
199 - #include "libiberty.h"
200 - #include "iwmmxt.h"
201 -+#include "maverick.h"
202 -
203 - /* TODO: This should get pulled from the SIM_DESC. */
204 - host_callback *sim_callback;
205 -@@ -101,38 +102,6 @@ print_insn (ARMword instr)
206 - fprintf (stderr, " %*s\n", size, opbuf);
207 - }
208 -
209 --/* Cirrus DSP registers.
210 --
211 -- We need to define these registers outside of maverick.c because
212 -- maverick.c might not be linked in unless --target=arm9e-* in which
213 -- case wrapper.c will not compile because it tries to access Cirrus
214 -- registers. This should all go away once we get the Cirrus and ARM
215 -- Coprocessor to coexist in armcopro.c-- aldyh. */
216 --
217 --struct maverick_regs
218 --{
219 -- union
220 -- {
221 -- int i;
222 -- float f;
223 -- } upper;
224 --
225 -- union
226 -- {
227 -- int i;
228 -- float f;
229 -- } lower;
230 --};
231 --
232 --union maverick_acc_regs
233 --{
234 -- long double ld; /* Acc registers are 72-bits. */
235 --};
236 --
237 --struct maverick_regs DSPregs[16];
238 --union maverick_acc_regs DSPacc[4];
239 --ARMword DSPsc;
240 --
241 - static void
242 - init (void)
243 - {
244 -@@ -236,7 +205,7 @@ sim_create_inferior (SIM_DESC sd ATTRIBUTE_UNUSED,
245 - {
246 - int argvlen = 0;
247 - int mach;
248 -- char **arg;
249 -+ char * const *arg;
250 -
251 - init ();
252 -
253 ---
254 -2.25.0
255 -
256
257 diff --git a/sys-devel/gdb/gdb-8.3.1-r1.ebuild b/sys-devel/gdb/gdb-8.3.1-r1.ebuild
258 deleted file mode 100644
259 index 2d2ec2e6952..00000000000
260 --- a/sys-devel/gdb/gdb-8.3.1-r1.ebuild
261 +++ /dev/null
262 @@ -1,262 +0,0 @@
263 -# Copyright 1999-2020 Gentoo Authors
264 -# Distributed under the terms of the GNU General Public License v2
265 -
266 -EAPI=7
267 -PYTHON_COMPAT=( python{3_6,3_7} )
268 -
269 -inherit eutils flag-o-matic python-single-r1
270 -
271 -export CTARGET=${CTARGET:-${CHOST}}
272 -if [[ ${CTARGET} == ${CHOST} ]] ; then
273 - if [[ ${CATEGORY} == cross-* ]] ; then
274 - export CTARGET=${CATEGORY#cross-}
275 - fi
276 -fi
277 -is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
278 -
279 -MY_PV=${PV}
280 -case ${PV} in
281 -9999*)
282 - # live git tree
283 - EGIT_REPO_URI="https://sourceware.org/git/binutils-gdb.git"
284 - inherit git-r3
285 - SRC_URI=""
286 - ;;
287 -*.*.50.2???????)
288 - # weekly snapshots
289 - SRC_URI="ftp://sourceware.org/pub/gdb/snapshots/current/gdb-weekly-${PV}.tar.xz"
290 - ;;
291 -*)
292 - # Normal upstream release
293 - SRC_URI="mirror://gnu/gdb/${P}.tar.xz
294 - ftp://sourceware.org/pub/gdb/releases/${P}.tar.xz"
295 - ;;
296 -esac
297 -
298 -PATCH_VER=""
299 -PATCH_DEV=""
300 -DESCRIPTION="GNU debugger"
301 -HOMEPAGE="https://sourceware.org/gdb/"
302 -SRC_URI="${SRC_URI}
303 - ${PATCH_DEV:+https://dev.gentoo.org/~${PATCH_DEV}/distfiles/${P}-patches-${PATCH_VER}.tar.xz}
304 - ${PATCH_VER:+mirror://gentoo/${P}-patches-${PATCH_VER}.tar.xz}
305 -"
306 -
307 -LICENSE="GPL-2 LGPL-2"
308 -SLOT="0"
309 -if [[ ${PV} != 9999* ]] ; then
310 - KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
311 -fi
312 -IUSE="+client lzma multitarget nls +python +server source-highlight test vanilla xml"
313 -REQUIRED_USE="
314 - python? ( ${PYTHON_REQUIRED_USE} )
315 - || ( client server )
316 -"
317 -
318 -# ia64 kernel crashes when gdb testsuite is running
319 -# hppa kernel crashes when gdb testsuite is running
320 -RESTRICT="
321 - hppa? ( test )
322 - ia64? ( test )
323 -
324 - !test? ( test )
325 -"
326 -
327 -RDEPEND="
328 - client? (
329 - dev-libs/mpfr:0=
330 - >=sys-libs/ncurses-5.2-r2:0=
331 - sys-libs/readline:0=
332 - lzma? ( app-arch/xz-utils )
333 - python? ( ${PYTHON_DEPS} )
334 - xml? ( dev-libs/expat )
335 - sys-libs/zlib
336 - )
337 - source-highlight? (
338 - dev-util/source-highlight
339 - )
340 -"
341 -DEPEND="${RDEPEND}"
342 -BDEPEND="
343 - app-arch/xz-utils
344 - sys-apps/texinfo
345 - client? (
346 - virtual/yacc
347 - test? ( dev-util/dejagnu )
348 - nls? ( sys-devel/gettext )
349 - )"
350 -
351 -S=${WORKDIR}/${PN}-${MY_PV}
352 -
353 -PATCHES=(
354 - "${FILESDIR}"/${PN}-8.3.1-verbose-build.patch
355 - "${FILESDIR}"/${PN}-8.3.1-gcc-10.patch
356 -)
357 -
358 -pkg_setup() {
359 - use python && python-single-r1_pkg_setup
360 -}
361 -
362 -src_prepare() {
363 - default
364 -
365 - strip-linguas -u bfd/po opcodes/po
366 -}
367 -
368 -gdb_branding() {
369 - printf "Gentoo ${PV} "
370 - if ! use vanilla && [[ -n ${PATCH_VER} ]] ; then
371 - printf "p${PATCH_VER}"
372 - else
373 - printf "vanilla"
374 - fi
375 - [[ -n ${EGIT_COMMIT} ]] && printf " ${EGIT_COMMIT}"
376 -}
377 -
378 -src_configure() {
379 - strip-unsupported-flags
380 -
381 - local myconf=(
382 - # portage's econf() does not detect presence of --d-d-t
383 - # because it greps only top-level ./configure. But not
384 - # gnulib's or gdb's configure.
385 - --disable-dependency-tracking
386 -
387 - --with-pkgversion="$(gdb_branding)"
388 - --with-bugurl='https://bugs.gentoo.org/'
389 - --disable-werror
390 - # Disable modules that are in a combined binutils/gdb tree. #490566
391 - --disable-{binutils,etc,gas,gold,gprof,ld}
392 - )
393 - local sysroot="${EPREFIX}/usr/${CTARGET}"
394 - is_cross && myconf+=(
395 - --with-sysroot="${sysroot}"
396 - --includedir="${sysroot}/usr/include"
397 - --with-gdb-datadir="\${datadir}/gdb/${CTARGET}"
398 - )
399 -
400 - if use server && ! use client ; then
401 - # just configure+build in the gdbserver subdir to speed things up
402 - cd gdb/gdbserver
403 - myconf+=( --program-transform-name='' )
404 - else
405 - # gdbserver only works for native targets (CHOST==CTARGET).
406 - # it also doesn't support all targets, so rather than duplicate
407 - # the target list (which changes between versions), use the
408 - # "auto" value when things are turned on.
409 - is_cross \
410 - && myconf+=( --disable-gdbserver ) \
411 - || myconf+=( $(use_enable server gdbserver auto) )
412 - fi
413 -
414 - if ! ( use server && ! use client ) ; then
415 - # if we are configuring in the top level, then use all
416 - # the additional global options
417 - myconf+=(
418 - --enable-64-bit-bfd
419 - --disable-install-libbfd
420 - --disable-install-libiberty
421 - # Disable guile for now as it requires guile-2.x #562902
422 - --without-guile
423 - # This only disables building in the readline subdir.
424 - # For gdb itself, it'll use the system version.
425 - --disable-readline
426 - --with-system-readline
427 - # This only disables building in the zlib subdir.
428 - # For gdb itself, it'll use the system version.
429 - --without-zlib
430 - --with-system-zlib
431 - --with-separate-debug-dir="${EPREFIX}"/usr/lib/debug
432 - $(use_with xml expat)
433 - $(use_with lzma)
434 - $(use_enable nls)
435 - $(use_enable source-highlight)
436 - $(use multitarget && echo --enable-targets=all)
437 - $(use_with python python "${EPYTHON}")
438 - )
439 - fi
440 - if use sparc-solaris || use x86-solaris ; then
441 - # disable largefile support
442 - # https://sourceware.org/ml/gdb-patches/2014-12/msg00058.html
443 - myconf+=( --disable-largefile )
444 - fi
445 -
446 - econf "${myconf[@]}"
447 -}
448 -
449 -src_install() {
450 - if use server && ! use client; then
451 - cd gdb/gdbserver || die
452 - fi
453 - default
454 - if use client; then
455 - find "${ED}"/usr -name libiberty.a -delete || die
456 - fi
457 - cd "${S}" || die
458 -
459 - # Delete translations that conflict with binutils-libs. #528088
460 - # Note: Should figure out how to store these in an internal gdb dir.
461 - if use nls ; then
462 - find "${ED}" \
463 - -regextype posix-extended -regex '.*/(bfd|opcodes)[.]g?mo$' \
464 - -delete || die
465 - fi
466 -
467 - # Don't install docs when building a cross-gdb
468 - if [[ ${CTARGET} != ${CHOST} ]] ; then
469 - rm -rf "${ED}"/usr/share/{doc,info,locale} || die
470 - local f
471 - for f in "${ED}"/usr/share/man/*/* ; do
472 - if [[ ${f##*/} != ${CTARGET}-* ]] ; then
473 - mv "${f}" "${f%/*}/${CTARGET}-${f##*/}" || die
474 - fi
475 - done
476 - return 0
477 - fi
478 - # Install it by hand for now:
479 - # https://sourceware.org/ml/gdb-patches/2011-12/msg00915.html
480 - # Only install if it exists due to the twisted behavior (see
481 - # notes in src_configure above).
482 - [[ -e gdb/gdbserver/gdbreplay ]] && dobin gdb/gdbserver/gdbreplay
483 -
484 - if use client ; then
485 - docinto gdb
486 - dodoc gdb/CONTRIBUTE gdb/README gdb/MAINTAINERS \
487 - gdb/NEWS gdb/ChangeLog gdb/PROBLEMS
488 - fi
489 - docinto sim
490 - dodoc sim/{ChangeLog,MAINTAINERS,README-HACKING}
491 - if use server ; then
492 - docinto gdbserver
493 - dodoc gdb/gdbserver/{ChangeLog,README}
494 - fi
495 -
496 - if [[ -n ${PATCH_VER} ]] ; then
497 - dodoc "${WORKDIR}"/extra/gdbinit.sample
498 - fi
499 -
500 - # Remove shared info pages
501 - rm -f "${ED}"/usr/share/info/{annotate,bfd,configure,standards}.info*
502 -
503 - # gcore is part of ubin on freebsd
504 - if [[ ${CHOST} == *-freebsd* ]]; then
505 - rm "${ED}"/usr/bin/gcore || die
506 - fi
507 -
508 - if use python; then
509 - python_optimize "${ED}"/usr/share/gdb/python/gdb
510 - fi
511 -}
512 -
513 -pkg_postinst() {
514 - # portage sucks and doesnt unmerge files in /etc
515 - rm -vf "${EROOT}"/etc/skel/.gdbinit
516 -
517 - if use prefix && [[ ${CHOST} == *-darwin* ]] ; then
518 - ewarn "gdb is unable to get a mach task port when installed by Prefix"
519 - ewarn "Portage, unprivileged. To make gdb fully functional you'll"
520 - ewarn "have to perform the following steps:"
521 - ewarn " % sudo chgrp procmod ${EPREFIX}/usr/bin/gdb"
522 - ewarn " % sudo chmod g+s ${EPREFIX}/usr/bin/gdb"
523 - fi
524 -}
525
526 diff --git a/sys-devel/gdb/gdb-8.3.1.ebuild b/sys-devel/gdb/gdb-8.3.1.ebuild
527 deleted file mode 100644
528 index ac1ce8d7b8e..00000000000
529 --- a/sys-devel/gdb/gdb-8.3.1.ebuild
530 +++ /dev/null
531 @@ -1,260 +0,0 @@
532 -# Copyright 1999-2020 Gentoo Authors
533 -# Distributed under the terms of the GNU General Public License v2
534 -
535 -EAPI=7
536 -PYTHON_COMPAT=( python{3_6,3_7} )
537 -
538 -inherit eutils flag-o-matic python-single-r1
539 -
540 -export CTARGET=${CTARGET:-${CHOST}}
541 -if [[ ${CTARGET} == ${CHOST} ]] ; then
542 - if [[ ${CATEGORY} == cross-* ]] ; then
543 - export CTARGET=${CATEGORY#cross-}
544 - fi
545 -fi
546 -is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
547 -
548 -RPM=
549 -MY_PV=${PV}
550 -case ${PV} in
551 -9999*)
552 - # live git tree
553 - EGIT_REPO_URI="https://sourceware.org/git/binutils-gdb.git"
554 - inherit git-r3
555 - SRC_URI=""
556 - ;;
557 -*.*.50.2???????)
558 - # weekly snapshots
559 - SRC_URI="ftp://sourceware.org/pub/gdb/snapshots/current/gdb-weekly-${PV}.tar.xz"
560 - ;;
561 -*)
562 - # Normal upstream release
563 - SRC_URI="mirror://gnu/gdb/${P}.tar.xz
564 - ftp://sourceware.org/pub/gdb/releases/${P}.tar.xz"
565 - ;;
566 -esac
567 -
568 -PATCH_VER=""
569 -PATCH_DEV=""
570 -DESCRIPTION="GNU debugger"
571 -HOMEPAGE="https://sourceware.org/gdb/"
572 -SRC_URI="${SRC_URI}
573 - ${PATCH_DEV:+https://dev.gentoo.org/~${PATCH_DEV}/distfiles/${P}-patches-${PATCH_VER}.tar.xz}
574 - ${PATCH_VER:+mirror://gentoo/${P}-patches-${PATCH_VER}.tar.xz}
575 -"
576 -
577 -LICENSE="GPL-2 LGPL-2"
578 -SLOT="0"
579 -if [[ ${PV} != 9999* ]] ; then
580 - KEYWORDS="~alpha amd64 arm arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~riscv s390 sparc x86 ~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
581 -fi
582 -IUSE="+client lzma multitarget nls +python +server source-highlight test vanilla xml"
583 -REQUIRED_USE="
584 - python? ( ${PYTHON_REQUIRED_USE} )
585 - || ( client server )
586 -"
587 -
588 -# ia64 kernel crashes when gdb testsuite is running
589 -# hppa kernel crashes when gdb testsuite is running
590 -RESTRICT="
591 - hppa? ( test )
592 - ia64? ( test )
593 -
594 - !test? ( test )
595 -"
596 -
597 -RDEPEND="
598 - client? (
599 - dev-libs/mpfr:0=
600 - >=sys-libs/ncurses-5.2-r2:0=
601 - sys-libs/readline:0=
602 - lzma? ( app-arch/xz-utils )
603 - python? ( ${PYTHON_DEPS} )
604 - xml? ( dev-libs/expat )
605 - sys-libs/zlib
606 - )
607 - source-highlight? (
608 - dev-util/source-highlight
609 - )
610 -"
611 -DEPEND="${RDEPEND}"
612 -BDEPEND="
613 - app-arch/xz-utils
614 - sys-apps/texinfo
615 - client? (
616 - virtual/yacc
617 - test? ( dev-util/dejagnu )
618 - nls? ( sys-devel/gettext )
619 - )"
620 -
621 -S=${WORKDIR}/${PN}-${MY_PV}
622 -
623 -PATCHES=(
624 - "${FILESDIR}"/${PN}-8.3.1-verbose-build.patch
625 -)
626 -
627 -pkg_setup() {
628 - use python && python-single-r1_pkg_setup
629 -}
630 -
631 -src_prepare() {
632 - [[ -n ${RPM} ]] && rpm_spec_epatch "${WORKDIR}"/gdb.spec
633 -
634 - default
635 -
636 - strip-linguas -u bfd/po opcodes/po
637 -}
638 -
639 -gdb_branding() {
640 - printf "Gentoo ${PV} "
641 - if ! use vanilla && [[ -n ${PATCH_VER} ]] ; then
642 - printf "p${PATCH_VER}"
643 - else
644 - printf "vanilla"
645 - fi
646 - [[ -n ${EGIT_COMMIT} ]] && printf " ${EGIT_COMMIT}"
647 -}
648 -
649 -src_configure() {
650 - strip-unsupported-flags
651 -
652 - local myconf=(
653 - # portage's econf() does not detect presence of --d-d-t
654 - # because it greps only top-level ./configure. But not
655 - # gnulib's or gdb's configure.
656 - --disable-dependency-tracking
657 -
658 - --with-pkgversion="$(gdb_branding)"
659 - --with-bugurl='https://bugs.gentoo.org/'
660 - --disable-werror
661 - # Disable modules that are in a combined binutils/gdb tree. #490566
662 - --disable-{binutils,etc,gas,gold,gprof,ld}
663 - )
664 - local sysroot="${EPREFIX}/usr/${CTARGET}"
665 - is_cross && myconf+=(
666 - --with-sysroot="${sysroot}"
667 - --includedir="${sysroot}/usr/include"
668 - --with-gdb-datadir="\${datadir}/gdb/${CTARGET}"
669 - )
670 -
671 - if use server && ! use client ; then
672 - # just configure+build in the gdbserver subdir to speed things up
673 - cd gdb/gdbserver
674 - myconf+=( --program-transform-name='' )
675 - else
676 - # gdbserver only works for native targets (CHOST==CTARGET).
677 - # it also doesn't support all targets, so rather than duplicate
678 - # the target list (which changes between versions), use the
679 - # "auto" value when things are turned on.
680 - is_cross \
681 - && myconf+=( --disable-gdbserver ) \
682 - || myconf+=( $(use_enable server gdbserver auto) )
683 - fi
684 -
685 - if ! ( use server && ! use client ) ; then
686 - # if we are configuring in the top level, then use all
687 - # the additional global options
688 - myconf+=(
689 - --enable-64-bit-bfd
690 - --disable-install-libbfd
691 - --disable-install-libiberty
692 - # Disable guile for now as it requires guile-2.x #562902
693 - --without-guile
694 - # This only disables building in the readline subdir.
695 - # For gdb itself, it'll use the system version.
696 - --disable-readline
697 - --with-system-readline
698 - # This only disables building in the zlib subdir.
699 - # For gdb itself, it'll use the system version.
700 - --without-zlib
701 - --with-system-zlib
702 - --with-separate-debug-dir="${EPREFIX}"/usr/lib/debug
703 - $(use_with xml expat)
704 - $(use_with lzma)
705 - $(use_enable nls)
706 - $(use_enable source-highlight)
707 - $(use multitarget && echo --enable-targets=all)
708 - $(use_with python python "${EPYTHON}")
709 - )
710 - fi
711 - if use sparc-solaris || use x86-solaris ; then
712 - # disable largefile support
713 - # https://sourceware.org/ml/gdb-patches/2014-12/msg00058.html
714 - myconf+=( --disable-largefile )
715 - fi
716 -
717 - econf "${myconf[@]}"
718 -}
719 -
720 -src_install() {
721 - if use server && ! use client; then
722 - cd gdb/gdbserver || die
723 - fi
724 - default
725 - if use client; then
726 - find "${ED}"/usr -name libiberty.a -delete || die
727 - fi
728 - cd "${S}" || die
729 -
730 - # Delete translations that conflict with binutils-libs. #528088
731 - # Note: Should figure out how to store these in an internal gdb dir.
732 - if use nls ; then
733 - find "${ED}" \
734 - -regextype posix-extended -regex '.*/(bfd|opcodes)[.]g?mo$' \
735 - -delete || die
736 - fi
737 -
738 - # Don't install docs when building a cross-gdb
739 - if [[ ${CTARGET} != ${CHOST} ]] ; then
740 - rm -rf "${ED}"/usr/share/{doc,info,locale} || die
741 - local f
742 - for f in "${ED}"/usr/share/man/*/* ; do
743 - if [[ ${f##*/} != ${CTARGET}-* ]] ; then
744 - mv "${f}" "${f%/*}/${CTARGET}-${f##*/}" || die
745 - fi
746 - done
747 - return 0
748 - fi
749 - # Install it by hand for now:
750 - # https://sourceware.org/ml/gdb-patches/2011-12/msg00915.html
751 - # Only install if it exists due to the twisted behavior (see
752 - # notes in src_configure above).
753 - [[ -e gdb/gdbserver/gdbreplay ]] && dobin gdb/gdbserver/gdbreplay
754 -
755 - if use client ; then
756 - docinto gdb
757 - dodoc gdb/CONTRIBUTE gdb/README gdb/MAINTAINERS \
758 - gdb/NEWS gdb/ChangeLog gdb/PROBLEMS
759 - fi
760 - docinto sim
761 - dodoc sim/{ChangeLog,MAINTAINERS,README-HACKING}
762 - if use server ; then
763 - docinto gdbserver
764 - dodoc gdb/gdbserver/{ChangeLog,README}
765 - fi
766 -
767 - if [[ -n ${PATCH_VER} ]] ; then
768 - dodoc "${WORKDIR}"/extra/gdbinit.sample
769 - fi
770 -
771 - # Remove shared info pages
772 - rm -f "${ED}"/usr/share/info/{annotate,bfd,configure,standards}.info*
773 -
774 - # gcore is part of ubin on freebsd
775 - if [[ ${CHOST} == *-freebsd* ]]; then
776 - rm "${ED}"/usr/bin/gcore || die
777 - fi
778 -}
779 -
780 -pkg_postinst() {
781 - # portage sucks and doesnt unmerge files in /etc
782 - rm -vf "${EROOT}"/etc/skel/.gdbinit
783 -
784 - if use prefix && [[ ${CHOST} == *-darwin* ]] ; then
785 - ewarn "gdb is unable to get a mach task port when installed by Prefix"
786 - ewarn "Portage, unprivileged. To make gdb fully functional you'll"
787 - ewarn "have to perform the following steps:"
788 - ewarn " % sudo chgrp procmod ${EPREFIX}/usr/bin/gdb"
789 - ewarn " % sudo chmod g+s ${EPREFIX}/usr/bin/gdb"
790 - fi
791 -}