Skip to contentSkip to conversation

mos6522: fix linking error when CONFIG_MOS6522 is not set

PATCH Superseded Murilo Opsfelder Araujo 2 participants 3 messages May 6, 2022 – May 11, 2022

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 mos6522: fix linking error when CONFIG_MOS6522 is not set

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'

Make devices configuration available in hmp-commands*.hx and check for CONFIG_MOS6522.

Fixes 409e9f7131e5 (mos6522: add "info via" HMP command for debugging)
Cc Mark Cave-Ayland <[email protected]>
Cc Fabiano Rosas <[email protected]>

---
v2:
- Included devices configuration in monitor/misc.c

v1:
- https://lore.kernel.org/qemu-devel/[email protected]/

 hmp-commands-info.hx | 2 ++
 monitor/misc.c       | 3 +++
 2 files changed, 5 insertions(+)
hmp-commands-info.hx +2 -0
index adfa085a9b..9ad784dd9f 100644
@@ -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``
monitor/misc.c +3 -0
index 6c5bb82d3b..3d2312ba8d 100644
@@ -84,6 +84,9 @@
 #include "hw/s390x/storage-attributes.h"
 #endif
 
+/* Make devices configuration available for use in hmp-commands*.hx templates */
+#include CONFIG_DEVICES
+
 /* file descriptors passed via SCM_RIGHTS */
 typedef struct mon_fd_t mon_fd_t;
 struct mon_fd_t {
Signature · 1 line
2.35.1
Reviewed-by on v2 1/1
#1 lore raw
Quoted 27 lines · Murilo Opsfelder Araujo

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'

Make devices configuration available in hmp-commands*.hx and check for CONFIG_MOS6522.

Fixes 409e9f7131e5 (mos6522: add "info via" HMP command for debugging)
Cc Mark Cave-Ayland <[email protected]>
Cc Fabiano Rosas <[email protected]>

---
v2:
- Included devices configuration in monitor/misc.c

v1:
- https://lore.kernel.org/qemu-devel/[email protected]/

  hmp-commands-info.hx | 2 ++
  monitor/misc.c       | 3 +++
  2 files changed, 5 insertions(+)
hmp-commands-info.hx +0 -0
index adfa085a9b..9ad784dd9f 100644

hmp-commands-info.hx SRST · line 884

Quoted 4 lines
hmp-commands-info.hx +1 -0
@@ -881,6 +881,7 @@ SRST
  ERST
 
  #if defined(TARGET_M68K) || defined(TARGET_PPC)
+#if defined(CONFIG_MOS6522)

I think you could even get rid of the TARGET_ stuff now that the CONFIG line works!

Quoted 16 lines
hmp-commands-info.hx +1 -0
      {
          .name         = "via",
          .args_type    = "",
@@ -889,6 +890,7 @@ ERST
          .cmd          = hmp_info_via,
      },
  #endif
+#endif
 
  SRST
    ``info via``
monitor/misc.c +0 -0
index 6c5bb82d3b..3d2312ba8d 100644

monitor/misc.c line 88

Quoted 5 lines
monitor/misc.c +2 -0
@@ -84,6 +84,9 @@
  #include "hw/s390x/storage-attributes.h"
  #endif
 
+/* Make devices configuration available for use in hmp-commands*.hx templates */
+#include CONFIG_DEVICES

Looks reasonable to me.

So with the "#if defined(TARGET_M68K) || defined(TARGET_PPC)" removed:

#2 lore raw

Hi, Thomas.

Quoted 56 lines · Thomas Huth
Quoted 27 lines · Murilo Opsfelder Araujo

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'

Make devices configuration available in hmp-commands*.hx and check for CONFIG_MOS6522.

Fixes 409e9f7131e5 (mos6522: add "info via" HMP command for debugging)
Cc Mark Cave-Ayland <[email protected]>
Cc Fabiano Rosas <[email protected]>

---
v2:
- Included devices configuration in monitor/misc.c

v1:
- https://lore.kernel.org/qemu-devel/[email protected]/

  hmp-commands-info.hx | 2 ++
  monitor/misc.c       | 3 +++

  2 files changed, 5 insertions(+)
hmp-commands-info.hx +0 -0
index adfa085a9b..9ad784dd9f 100644
@@ -881,6 +881,7 @@ SRST
Quoted 3 lines

  ERST
  #if defined(TARGET_M68K) || defined(TARGET_PPC)
+#if defined(CONFIG_MOS6522)

I think you could even get rid of the TARGET_ stuff now that the CONFIG line works!

Quoted 15 lines

      {
          .name         = "via",
          .args_type    = "",

hmp-commands-info.hx +1 -0
@@ -889,6 +890,7 @@ ERST
           .cmd          = hmp_info_via,
       },
   #endif
+#endif

  SRST
    ``info via``

monitor/misc.c +0 -0
index 6c5bb82d3b..3d2312ba8d 100644

monitor/misc.c line 87

Quoted 4 lines
monitor/misc.c +2 -0
@@ -84,6 +84,9 @@
   #include "hw/s390x/storage-attributes.h"
   #endif
+/* Make devices configuration available for use in hmp-commands*.hx templates */
+#include CONFIG_DEVICES

Looks reasonable to me.

Quoted 4 lines

So with the "#if defined(TARGET_M68K) || defined(TARGET_PPC)" removed:

I've sent v3 with your suggestion:

    https://lore.kernel.org/qemu-devel/[email protected]/

Thank you for your review.

Signature · 1 line
Murilo