From: "Luis Machado (Code Review)" <gerrit@gnutoolchain-gerrit.osci.io>
To: gdb-patches@sourceware.org
Subject: [review] [ARM, sim] Fix build error and warnings
Date: Wed, 27 Nov 2019 12:15:00 -0000 [thread overview]
Message-ID: <gerrit.1574856916000.I21db699d3b61b2de8c44053e47be4387285af28f@gnutoolchain-gerrit.osci.io> (raw)
In-Reply-To: <gerrit.1574856916000.I21db699d3b61b2de8c44053e47be4387285af28f@gnutoolchain-gerrit.osci.io>
Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/726
......................................................................
[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:
binutils-gdb/sim/arm/wrapper.c:870:31: warning: passing argument 1 of âsim_target_parse_arg_arrayâ discards âconstâ qualifier from pointer target type [-Wdiscarded-qualifiers]
sim_target_parse_arg_array (argv);
binutils-gdb/sim/arm/wrapper.c:775:1: note: expected âchar **â but argument is of type âchar * const*â
sim_target_parse_arg_array (char ** argv)
The following patch fixes both of the above.
sim/arm/ChangeLog:
2019-11-26 Luis Machado <luis.machado@linaro.org>
* armemu.c (isize): Move this declaration ...
* arminit.c (isize): ... here.
* wrapper.c (DSPregs): Make extern.
(DSPacc): Likewise.
(DSPsc): Likewise.
(sim_create_inferior): Cast variables to proper type.
Signed-off-by: Luis Machado <luis.machado@linaro.org>
Change-Id: I21db699d3b61b2de8c44053e47be4387285af28f
---
M sim/arm/armemu.c
M sim/arm/arminit.c
M sim/arm/wrapper.c
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/sim/arm/armemu.c b/sim/arm/armemu.c
index 76f398b..3a72277 100644
--- a/sim/arm/armemu.c
+++ b/sim/arm/armemu.c
@@ -1140,10 +1140,6 @@
/* EMULATION of ARM6. */
-/* The PC pipeline value depends on whether ARM
- or Thumb instructions are being executed. */
-ARMword isize;
-
ARMword
#ifdef MODE32
ARMul_Emulate32 (ARMul_State * state)
diff --git a/sim/arm/arminit.c b/sim/arm/arminit.c
index 851d356..3a626c8 100644
--- a/sim/arm/arminit.c
+++ b/sim/arm/arminit.c
@@ -40,6 +40,10 @@
ARMword ARMul_ImmedTable[4096]; /* immediate DP LHS values */
char ARMul_BitList[256]; /* number of bits in a byte table */
+/* The PC pipeline value depends on whether ARM
+ or Thumb instructions are being executed. */
+ARMword isize;
+
/***************************************************************************\
* Call this routine once to set up the emulator's tables. *
\***************************************************************************/
diff --git a/sim/arm/wrapper.c b/sim/arm/wrapper.c
index fde5d8c..9f86e08 100644
--- a/sim/arm/wrapper.c
+++ b/sim/arm/wrapper.c
@@ -129,9 +129,9 @@
long double ld; /* Acc registers are 72-bits. */
};
-struct maverick_regs DSPregs[16];
-union maverick_acc_regs DSPacc[4];
-ARMword DSPsc;
+extern struct maverick_regs DSPregs[16];
+extern union maverick_acc_regs DSPacc[4];
+extern ARMword DSPsc;
static void
init (void)
@@ -236,7 +236,7 @@
{
int argvlen = 0;
int mach;
- char **arg;
+ char * const *arg;
init ();
@@ -867,7 +867,7 @@
sim_callback = cb;
- sim_target_parse_arg_array (argv);
+ sim_target_parse_arg_array ((char **) argv);
if (argv[1] != NULL)
{
--
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: I21db699d3b61b2de8c44053e47be4387285af28f
Gerrit-Change-Number: 726
Gerrit-PatchSet: 1
Gerrit-Owner: Luis Machado <luis.machado@linaro.org>
Gerrit-MessageType: newchange
next parent reply other threads:[~2019-11-27 12:15 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-27 12:15 Luis Machado (Code Review) [this message]
2019-11-27 15:36 ` Simon Marchi (Code Review)
2019-11-27 16:20 ` Luis Machado (Code Review)
2019-11-27 16:54 ` Simon Marchi (Code Review)
2019-11-27 16:55 ` Simon Marchi (Code Review)
2019-11-27 18:20 ` Luis Machado (Code Review)
2019-11-28 12:12 ` Andrew Burgess (Code Review)
2019-11-28 12:38 ` Luis Machado (Code Review)
2019-11-28 13:30 ` [review v2] " Luis Machado (Code Review)
2019-11-28 13:33 ` [review v3] " Luis Machado (Code Review)
2019-12-02 22:16 ` Andrew Burgess (Code Review)
2019-12-03 13:49 ` Luis Machado (Code Review)
2019-12-03 13:55 ` [review v4] " Luis Machado (Code Review)
2019-12-06 10:35 ` Andrew Burgess (Code Review)
2019-12-06 13:09 ` Luis Machado (Code Review)
2019-12-06 13:15 ` Luis Machado (Code Review)
2019-12-06 13:21 ` Luis Machado (Code Review)
2019-12-06 14:50 ` Tom Tromey (Code Review)
2019-12-06 21:18 ` [pushed] " Sourceware to Gerrit sync (Code Review)
2019-12-06 21:18 ` Sourceware to Gerrit sync (Code Review)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=gerrit.1574856916000.I21db699d3b61b2de8c44053e47be4387285af28f@gnutoolchain-gerrit.osci.io \
--to=gerrit@gnutoolchain-gerrit.osci.io \
--cc=gdb-patches@sourceware.org \
--cc=luis.machado@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).