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: Tue, 21 Jan 2020 08:25:03
Message-Id: 1579595092.85d40e7435139585667847feb0728c038676a028.slyfox@gentoo
1 commit: 85d40e7435139585667847feb0728c038676a028
2 Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jan 21 08:24:37 2020 +0000
4 Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
5 CommitDate: Tue Jan 21 08:24:52 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=85d40e74
7
8 sys-devel/gdb: tweak for gcc-10
9
10 Pick upstream commit 851c0536c ("[ARM, sim] Fix build error and warnings").
11
12 Reported-by: Rolf Eike Beer
13 Package-Manager: Portage-2.3.84, Repoman-2.3.20
14 Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>
15
16 sys-devel/gdb/files/gdb-8.3.1-gcc-10.patch | 222 +++++++++++++++++++++++++++++
17 sys-devel/gdb/gdb-8.3.1-r1.ebuild | 4 +-
18 2 files changed, 223 insertions(+), 3 deletions(-)
19
20 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
21 new file mode 100644
22 index 00000000000..affc3b7392a
23 --- /dev/null
24 +++ b/sys-devel/gdb/files/gdb-8.3.1-gcc-10.patch
25 @@ -0,0 +1,222 @@
26 +From 851c0536cabb661847c45c73ebd796eb3299066b Mon Sep 17 00:00:00 2001
27 +Date: Tue, 26 Nov 2019 12:52:56 -0300
28 +Subject: [PATCH] [ARM, sim] Fix build error and warnings
29 +From: Luis Machado <luis.machado@××××××.org>
30 +
31 +Newer GCC's have switched to -fno-common by default, and this breaks the build
32 +for the ARM sim, like this:
33 +
34 +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
35 +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
36 +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
37 +
38 +I also noticed a few warnings due to mismatching types, as follows:
39 +
40 +../../../../repos/binutils-gdb/sim/arm/wrapper.c: In function ‘sim_create_inferior’:
41 +../../../../repos/binutils-gdb/sim/arm/wrapper.c:335:16: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
42 + for (arg = argv; *arg != NULL; arg++)
43 + ^
44 +../../../../repos/binutils-gdb/sim/arm/wrapper.c:342:8: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
45 + arg = argv;
46 + ^
47 +../../../../repos/binutils-gdb/sim/arm/wrapper.c:345:13: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
48 + for (arg = argv; *arg != NULL; arg++)
49 + ^
50 +The following patch fixes both of the above.
51 +
52 +Change-Id: I21db699d3b61b2de8c44053e47be4387285af28f
53 +---
54 + sim/arm/armemu.c | 4 ----
55 + sim/arm/arminit.c | 4 ++++
56 + sim/arm/maverick.c | 35 +++++------------------------------
57 + sim/arm/maverick.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++
58 + sim/arm/wrapper.c | 35 ++---------------------------------
59 + create mode 100644 sim/arm/maverick.h
60 +
61 +--- a/sim/arm/armemu.c
62 ++++ b/sim/arm/armemu.c
63 +@@ -1140,10 +1140,6 @@ handle_VFP_move (ARMul_State * state, ARMword instr)
64 +
65 + /* EMULATION of ARM6. */
66 +
67 +-/* The PC pipeline value depends on whether ARM
68 +- or Thumb instructions are being executed. */
69 +-ARMword isize;
70 +-
71 + ARMword
72 + #ifdef MODE32
73 + ARMul_Emulate32 (ARMul_State * state)
74 +--- a/sim/arm/arminit.c
75 ++++ b/sim/arm/arminit.c
76 +@@ -40,6 +40,10 @@ unsigned ARMul_MultTable[32] =
77 + ARMword ARMul_ImmedTable[4096]; /* immediate DP LHS values */
78 + char ARMul_BitList[256]; /* number of bits in a byte table */
79 +
80 ++/* The PC pipeline value depends on whether ARM
81 ++ or Thumb instructions are being executed. */
82 ++ARMword isize;
83 ++
84 + /***************************************************************************\
85 + * Call this routine once to set up the emulator's tables. *
86 + \***************************************************************************/
87 +--- a/sim/arm/maverick.c
88 ++++ b/sim/arm/maverick.c
89 +@@ -19,6 +19,7 @@
90 + #include "armdefs.h"
91 + #include "ansidecl.h"
92 + #include "armemu.h"
93 ++#include "maverick.h"
94 +
95 + /*#define CIRRUS_DEBUG 1 */
96 + #if CIRRUS_DEBUG
97 +@@ -30,36 +31,10 @@
98 + #define POS64(i) ( (~(i)) >> 63 )
99 + #define NEG64(i) ( (i) >> 63 )
100 +
101 +-/* Define Co-Processor instruction handlers here. */
102 +-
103 +-/* Here's ARMulator's DSP definition. A few things to note:
104 +- 1) it has 16 64-bit registers and 4 72-bit accumulators
105 +- 2) you can only access its registers with MCR and MRC. */
106 +-
107 +-/* We can't define these in here because this file might not be linked
108 +- unless the target is arm9e-*. They are defined in wrapper.c.
109 +- Eventually the simulator should be made to handle any coprocessor
110 +- at run time. */
111 +-struct maverick_regs
112 +-{
113 +- union
114 +- {
115 +- int i;
116 +- float f;
117 +- } upper;
118 +-
119 +- union
120 +- {
121 +- int i;
122 +- float f;
123 +- } lower;
124 +-};
125 +-
126 +-union maverick_acc_regs
127 +-{
128 +- long double ld; /* Acc registers are 72-bits. */
129 +-};
130 +-
131 ++/* These variables are defined here and made extern in maverick.h for use
132 ++ in wrapper.c for now.
133 ++ Eventually the simulator should be made to handle any coprocessor at run
134 ++ time. */
135 + struct maverick_regs DSPregs[16];
136 + union maverick_acc_regs DSPacc[4];
137 + ARMword DSPsc;
138 +--- /dev/null
139 ++++ b/sim/arm/maverick.h
140 +@@ -0,0 +1,46 @@
141 ++/* maverick.h -- Cirrus/DSP co-processor interface header
142 ++ Copyright (C) 2003-2019 Free Software Foundation, Inc.
143 ++ Contributed by Aldy Hernandez (aldyh@××××××.com).
144 ++
145 ++ This program is free software; you can redistribute it and/or modify
146 ++ it under the terms of the GNU General Public License as published by
147 ++ the Free Software Foundation; either version 3 of the License, or
148 ++ (at your option) any later version.
149 ++
150 ++ This program is distributed in the hope that it will be useful,
151 ++ but WITHOUT ANY WARRANTY; without even the implied warranty of
152 ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
153 ++ GNU General Public License for more details.
154 ++
155 ++ You should have received a copy of the GNU General Public License
156 ++ along with this program. If not, see <http://www.gnu.org/licenses/>. */
157 ++
158 ++/* Define Co-Processor instruction handlers here. */
159 ++
160 ++/* Here's ARMulator's DSP definition. A few things to note:
161 ++ 1) it has 16 64-bit registers and 4 72-bit accumulators
162 ++ 2) you can only access its registers with MCR and MRC. */
163 ++
164 ++struct maverick_regs
165 ++{
166 ++ union
167 ++ {
168 ++ int i;
169 ++ float f;
170 ++ } upper;
171 ++
172 ++ union
173 ++ {
174 ++ int i;
175 ++ float f;
176 ++ } lower;
177 ++};
178 ++
179 ++union maverick_acc_regs
180 ++{
181 ++ long double ld; /* Acc registers are 72-bits. */
182 ++};
183 ++
184 ++extern struct maverick_regs DSPregs[16];
185 ++extern union maverick_acc_regs DSPacc[4];
186 ++extern ARMword DSPsc;
187 +--- a/sim/arm/wrapper.c
188 ++++ b/sim/arm/wrapper.c
189 +@@ -37,6 +37,7 @@
190 + #include "gdb/signals.h"
191 + #include "libiberty.h"
192 + #include "iwmmxt.h"
193 ++#include "maverick.h"
194 +
195 + /* TODO: This should get pulled from the SIM_DESC. */
196 + host_callback *sim_callback;
197 +@@ -101,38 +102,6 @@ print_insn (ARMword instr)
198 + fprintf (stderr, " %*s\n", size, opbuf);
199 + }
200 +
201 +-/* Cirrus DSP registers.
202 +-
203 +- We need to define these registers outside of maverick.c because
204 +- maverick.c might not be linked in unless --target=arm9e-* in which
205 +- case wrapper.c will not compile because it tries to access Cirrus
206 +- registers. This should all go away once we get the Cirrus and ARM
207 +- Coprocessor to coexist in armcopro.c-- aldyh. */
208 +-
209 +-struct maverick_regs
210 +-{
211 +- union
212 +- {
213 +- int i;
214 +- float f;
215 +- } upper;
216 +-
217 +- union
218 +- {
219 +- int i;
220 +- float f;
221 +- } lower;
222 +-};
223 +-
224 +-union maverick_acc_regs
225 +-{
226 +- long double ld; /* Acc registers are 72-bits. */
227 +-};
228 +-
229 +-struct maverick_regs DSPregs[16];
230 +-union maverick_acc_regs DSPacc[4];
231 +-ARMword DSPsc;
232 +-
233 + static void
234 + init (void)
235 + {
236 +@@ -236,7 +205,7 @@ sim_create_inferior (SIM_DESC sd ATTRIBUTE_UNUSED,
237 + {
238 + int argvlen = 0;
239 + int mach;
240 +- char **arg;
241 ++ char * const *arg;
242 +
243 + init ();
244 +
245 +--
246 +2.25.0
247 +
248
249 diff --git a/sys-devel/gdb/gdb-8.3.1-r1.ebuild b/sys-devel/gdb/gdb-8.3.1-r1.ebuild
250 index 6188f7eb4f5..b5cae39cf9b 100644
251 --- a/sys-devel/gdb/gdb-8.3.1-r1.ebuild
252 +++ b/sys-devel/gdb/gdb-8.3.1-r1.ebuild
253 @@ -14,7 +14,6 @@ if [[ ${CTARGET} == ${CHOST} ]] ; then
254 fi
255 is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
256
257 -RPM=
258 MY_PV=${PV}
259 case ${PV} in
260 9999*)
261 @@ -91,6 +90,7 @@ S=${WORKDIR}/${PN}-${MY_PV}
262
263 PATCHES=(
264 "${FILESDIR}"/${PN}-8.3.1-verbose-build.patch
265 + "${FILESDIR}"/${PN}-8.3.1-gcc-10.patch
266 )
267
268 pkg_setup() {
269 @@ -98,8 +98,6 @@ pkg_setup() {
270 }
271
272 src_prepare() {
273 - [[ -n ${RPM} ]] && rpm_spec_epatch "${WORKDIR}"/gdb.spec
274 -
275 default
276
277 strip-linguas -u bfd/po opcodes/po