All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH] qapi: Incorrect attempt to fix building with MC146818RTC=n
@ 2019-12-31 18:49 Philippe Mathieu-Daudé
  2020-01-07 10:34 ` Paolo Bonzini
  2020-01-13 14:01 ` Markus Armbruster
  0 siblings, 2 replies; 12+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-12-31 18:49 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, Markus Armbruster, Philippe Mathieu-Daudé

When configured with --without-default-devices and setting
MC146818RTC=n, the build fails:

    LINK    x86_64-softmmu/qemu-system-x86_64
  /usr/bin/ld: qapi/qapi-commands-misc-target.o: in function `qmp_marshal_rtc_reset_reinjection':
  qapi/qapi-commands-misc-target.c:46: undefined reference to `qmp_rtc_reset_reinjection'
  /usr/bin/ld: qapi/qapi-commands-misc-target.c:46: undefined reference to `qmp_rtc_reset_reinjection'
  collect2: error: ld returned 1 exit status
  make[1]: *** [Makefile:206: qemu-system-x86_64] Error 1
  make: *** [Makefile:483: x86_64-softmmu/all] Error 2

This patch tries to fix this, but this is incorrect because QAPI
scripts only provide TARGET definitions, so with MC146818RTC=y we
get:

  hw/rtc/mc146818rtc.c:113:6: error: no previous prototype for ‘qmp_rtc_reset_reinjection’ [-Werror=missing-prototypes]
    113 | void qmp_rtc_reset_reinjection(Error **errp)
        |      ^~~~~~~~~~~~~~~~~~~~~~~~~
  cc1: all warnings being treated as errors
  make[1]: *** [rules.mak:69: hw/rtc/mc146818rtc.o] Error 1

Any idea? :)

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 qapi/misc-target.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qapi/misc-target.json b/qapi/misc-target.json
index a00fd821eb..8e49c113d1 100644
--- a/qapi/misc-target.json
+++ b/qapi/misc-target.json
@@ -41,7 +41,7 @@
 #
 ##
 { 'command': 'rtc-reset-reinjection',
-  'if': 'defined(TARGET_I386)' }
+  'if': 'defined(TARGET_I386) && defined(CONFIG_MC146818RTC)' }
 
 
 ##
-- 
2.21.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-01-23  8:22 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-31 18:49 [RFC PATCH] qapi: Incorrect attempt to fix building with MC146818RTC=n Philippe Mathieu-Daudé
2020-01-07 10:34 ` Paolo Bonzini
2020-01-13 14:01 ` Markus Armbruster
2020-01-18 20:47   ` Paolo Bonzini
2020-01-21  5:49     ` Markus Armbruster
2020-01-21  8:16       ` Paolo Bonzini
2020-01-21 14:22         ` Markus Armbruster
2020-01-21 14:48           ` Philippe Mathieu-Daudé
2020-01-21 20:44           ` Paolo Bonzini
2020-01-22  5:41             ` Markus Armbruster
2020-01-22 14:30               ` Paolo Bonzini
2020-01-23  8:21                 ` Markus Armbruster

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.