* [PATCH] sim: rl78: move storage out of header
@ 2021-01-09 15:19 Mike Frysinger
2021-01-11 11:28 ` Andrew Burgess
0 siblings, 1 reply; 3+ messages in thread
From: Mike Frysinger @ 2021-01-09 15:19 UTC (permalink / raw)
To: gdb-patches
This port declares its pc variable in a header and then includes
it times. This causes linker errors with newer gcc due to the
change in -fno-common behavior. Move the storage to a C file so
we only have one instance of it in the final program.
---
sim/rl78/cpu.c | 2 ++
sim/rl78/cpu.h | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/sim/rl78/cpu.c b/sim/rl78/cpu.c
index a1b85435001e..a38d6f688aee 100644
--- a/sim/rl78/cpu.c
+++ b/sim/rl78/cpu.c
@@ -36,6 +36,8 @@ int rl78_g10_mode = 0;
int g13_multiply = 0;
int g14_multiply = 0;
+SI pc;
+
#define REGISTER_ADDRESS 0xffee0
typedef struct {
diff --git a/sim/rl78/cpu.h b/sim/rl78/cpu.h
index 4629e0b69b05..a21de326731f 100644
--- a/sim/rl78/cpu.h
+++ b/sim/rl78/cpu.h
@@ -39,7 +39,7 @@ extern int rl78_in_gdb;
SI get_reg (RL78_Register);
SI set_reg (RL78_Register, SI);
-SI pc;
+extern SI pc;
extern const char * const reg_names[];
--
2.28.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] sim: rl78: move storage out of header
2021-01-09 15:19 [PATCH] sim: rl78: move storage out of header Mike Frysinger
@ 2021-01-11 11:28 ` Andrew Burgess
2021-01-11 13:25 ` Mike Frysinger
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Burgess @ 2021-01-11 11:28 UTC (permalink / raw)
To: Mike Frysinger; +Cc: gdb-patches
* Mike Frysinger via Gdb-patches <gdb-patches@sourceware.org> [2021-01-09 10:19:36 -0500]:
> This port declares its pc variable in a header and then includes
> it times. This causes linker errors with newer gcc due to the
Missing work 'it times' ?
Missing ChangeLog.
Otherwise, LGTM.
Thanks,
Andrew
> change in -fno-common behavior. Move the storage to a C file so
> we only have one instance of it in the final program.
> ---
> sim/rl78/cpu.c | 2 ++
> sim/rl78/cpu.h | 2 +-
> 2 files changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/sim/rl78/cpu.c b/sim/rl78/cpu.c
> index a1b85435001e..a38d6f688aee 100644
> --- a/sim/rl78/cpu.c
> +++ b/sim/rl78/cpu.c
> @@ -36,6 +36,8 @@ int rl78_g10_mode = 0;
> int g13_multiply = 0;
> int g14_multiply = 0;
>
> +SI pc;
> +
> #define REGISTER_ADDRESS 0xffee0
>
> typedef struct {
> diff --git a/sim/rl78/cpu.h b/sim/rl78/cpu.h
> index 4629e0b69b05..a21de326731f 100644
> --- a/sim/rl78/cpu.h
> +++ b/sim/rl78/cpu.h
> @@ -39,7 +39,7 @@ extern int rl78_in_gdb;
> SI get_reg (RL78_Register);
> SI set_reg (RL78_Register, SI);
>
> -SI pc;
> +extern SI pc;
>
>
> extern const char * const reg_names[];
> --
> 2.28.0
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] sim: rl78: move storage out of header
2021-01-11 11:28 ` Andrew Burgess
@ 2021-01-11 13:25 ` Mike Frysinger
0 siblings, 0 replies; 3+ messages in thread
From: Mike Frysinger @ 2021-01-11 13:25 UTC (permalink / raw)
To: Andrew Burgess; +Cc: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 668 bytes --]
On 11 Jan 2021 11:28, Andrew Burgess wrote:
> * Mike Frysinger via Gdb-patches <gdb-patches@sourceware.org> [2021-01-09 10:19:36 -0500]:
> > This port declares its pc variable in a header and then includes
> > it times. This causes linker errors with newer gcc due to the
>
> Missing work 'it times' ?
"Missing word" ? :)
yes, i left out "multiple", thanks.
> Missing ChangeLog.
sure, if i don't include it, i'll write it before pushing.
these are all extremely mechanical. the useful info is in
the commit message already.
2021-01-11 Mike Frysinger <vapier@gentoo.org>
* cpu.h (pc): Change to an extern.
* cpu.c (pc): Define.
-mike
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-01-11 13:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-09 15:19 [PATCH] sim: rl78: move storage out of header Mike Frysinger
2021-01-11 11:28 ` Andrew Burgess
2021-01-11 13:25 ` Mike Frysinger
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).