qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] mos6522: fix linking error when CONFIG_MOS6522 is not set


From: Murilo Opsfelder Araújo
Subject: Re: [PATCH] mos6522: fix linking error when CONFIG_MOS6522 is not set
Date: Fri, 6 May 2022 20:44:04 -0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0 Thunderbird/91.8.0

On 5/2/22 06:43, Mark Cave-Ayland wrote:
On 30/04/2022 00:31, Murilo Opsfelder Araujo wrote:

When CONFIG_MOS6522 is not set, building ppc64-softmmu target fails:

     /usr/bin/ld: libqemu-ppc64-softmmu.fa.p/monitor_misc.c.o:(.data+0x1158): 
undefined reference to `hmp_info_via'
     clang-13: error: linker command failed with exit code 1 (use -v to see 
invocation)

Add CONFIG_MOS6522 check for hmp_info_via in hmp-commands-info.hx to fix
such linking error.

Fixes: 409e9f7131e5 (mos6522: add "info via" HMP command for debugging)
Signed-off-by: Murilo Opsfelder Araujo <muriloo@linux.ibm.com>
Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Cc: Fabiano Rosas <farosas@linux.ibm.com>
---
  hmp-commands-info.hx | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx
index adfa085a9b..9ad784dd9f 100644
--- a/hmp-commands-info.hx
+++ b/hmp-commands-info.hx
@@ -881,6 +881,7 @@ SRST
  ERST
  #if defined(TARGET_M68K) || defined(TARGET_PPC)
+#if defined(CONFIG_MOS6522)
      {
          .name         = "via",
          .args_type    = "",
@@ -889,6 +890,7 @@ ERST
          .cmd          = hmp_info_via,
      },
  #endif
+#endif
  SRST
    ``info via``

Hmmm. The patch in its proposed form isn't correct, since device CONFIG_* 
defines aren't declared when processing hmp-commands-info.hx. This was 
something that was discovered and discussed in the original thread for which 
the current workaround is to use the per-target TARGET_* defines instead.

I've sent a v2 of this patch that addresses this, i.e.: the CONFIG_* options 
are available in hmp-commands-info.hx:

    
20220506011632.183257-1-muriloo@linux.ibm.com/">https://lore.kernel.org/qemu-devel/20220506011632.183257-1-muriloo@linux.ibm.com/

I hope it can resolve the build issue in the short-term.
I'd appreciate if you or anyone on this thread could review it.

Thank you, Mark, for the discussion and knowledge sharing!

Cheers!

--
Murilo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]