aboutsummaryrefslogtreecommitdiff
path: root/sim/arm/wrapper.c
diff options
context:
space:
mode:
authorLuis Machado <luis.machado@linaro.org>2019-11-26 12:52:56 -0300
committerLuis Machado <luis.machado@linaro.org>2019-12-06 18:16:20 -0300
commit851c0536cabb661847c45c73ebd796eb3299066b (patch)
tree1ed4f67952113d7a26e88ff0fb769a2e68aeb853 /sim/arm/wrapper.c
parentdfb65191d80afcc7d8ce79d3d9f92ea2e1ab3fc9 (diff)
downloadgdb-851c0536cabb661847c45c73ebd796eb3299066b.zip
gdb-851c0536cabb661847c45c73ebd796eb3299066b.tar.gz
gdb-851c0536cabb661847c45c73ebd796eb3299066b.tar.bz2
[ARM, sim] Fix build error and warnings
Newer GCC's have switched to -fno-common by default, and this breaks the build for the ARM sim, like this: 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 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 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 I also noticed a few warnings due to mismatching types, as follows: ../../../../repos/binutils-gdb/sim/arm/wrapper.c: In function ‘sim_create_inferior’: ../../../../repos/binutils-gdb/sim/arm/wrapper.c:335:16: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] for (arg = argv; *arg != NULL; arg++) ^ ../../../../repos/binutils-gdb/sim/arm/wrapper.c:342:8: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] arg = argv; ^ ../../../../repos/binutils-gdb/sim/arm/wrapper.c:345:13: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] for (arg = argv; *arg != NULL; arg++) ^ The following patch fixes both of the above. sim/arm/ChangeLog: 2019-12-06 Luis Machado <luis.machado@linaro.org> * armemu.c (isize): Move this declaration ... * arminit.c (isize): ... here. * maverick.h: New file. * wrapper.c: Include "maverick.h". (<struct maverick_regs>, <union maverick_acc_regs>): Remove and update comment. (sim_create_inferior): Cast variables to proper type. * maverick.c: Include "maverick.h". (<struct maverick_regs>, <union maverick_acc_regs>): Move declarations to maverick.h and update comment. (DSPsc, DSPacc, DSPregs): Adjust comment. Change-Id: I21db699d3b61b2de8c44053e47be4387285af28f
Diffstat (limited to 'sim/arm/wrapper.c')
-rw-r--r--sim/arm/wrapper.c35
1 files changed, 2 insertions, 33 deletions
diff --git a/sim/arm/wrapper.c b/sim/arm/wrapper.c
index fde5d8c..78a9192 100644
--- a/sim/arm/wrapper.c
+++ b/sim/arm/wrapper.c
@@ -37,6 +37,7 @@
#include "gdb/signals.h"
#include "libiberty.h"
#include "iwmmxt.h"
+#include "maverick.h"
/* TODO: This should get pulled from the SIM_DESC. */
host_callback *sim_callback;
@@ -101,38 +102,6 @@ print_insn (ARMword instr)
fprintf (stderr, " %*s\n", size, opbuf);
}
-/* Cirrus DSP registers.
-
- We need to define these registers outside of maverick.c because
- maverick.c might not be linked in unless --target=arm9e-* in which
- case wrapper.c will not compile because it tries to access Cirrus
- registers. This should all go away once we get the Cirrus and ARM
- Coprocessor to coexist in armcopro.c-- aldyh. */
-
-struct maverick_regs
-{
- union
- {
- int i;
- float f;
- } upper;
-
- union
- {
- int i;
- float f;
- } lower;
-};
-
-union maverick_acc_regs
-{
- long double ld; /* Acc registers are 72-bits. */
-};
-
-struct maverick_regs DSPregs[16];
-union maverick_acc_regs DSPacc[4];
-ARMword DSPsc;
-
static void
init (void)
{
@@ -236,7 +205,7 @@ sim_create_inferior (SIM_DESC sd ATTRIBUTE_UNUSED,
{
int argvlen = 0;
int mach;
- char **arg;
+ char * const *arg;
init ();