All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] stubs: Move qemu_timer_notify_cb() and remove qemu_notify_event() stub
@ 2020-09-02 10:24 Thomas Huth
  2020-09-02 10:32 ` Paolo Bonzini
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Huth @ 2020-09-02 10:24 UTC (permalink / raw)
  To: qemu-devel, Paolo Bonzini; +Cc: Philippe Mathieu-Daudé, Claudio Fontana

When cross-compiling with MinGW, there are sometimes some weird linker
errors like:

ibqemuutil.a(util_main-loop.c.obj): In function `qemu_notify_event':
/builds/huth/qemu/build/../util/main-loop.c:139: multiple definition of
 `qemu_notify_event'
libqemuutil.a(stubs_notify-event.c.obj):/builds/huth/qemu/stubs/notify-event.c:5:
 first defined here
collect2: error: ld returned 1 exit status
/builds/huth/qemu/rules.mak:88: recipe for target 'tests/test-timed-average.exe'
 failed

It seems like it works better when the qemu_timer_notify_cb() stub (which
calls qemu_notify_event()) is in a separate file - then we can also even
remove the qemu_notify_event() stub now.

This patch is based on ideas from the patch "stubs: Remove qemu_notify_event()"
by Philippe Mathieu-Daudé and the patch "cpu-timers, icount: new modules" from
Claudio Fontana.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 stubs/cpu-get-icount.c       | 5 -----
 stubs/meson.build            | 2 +-
 stubs/notify-event.c         | 6 ------
 stubs/qemu-timer-notify-cb.c | 8 ++++++++
 4 files changed, 9 insertions(+), 12 deletions(-)
 delete mode 100644 stubs/notify-event.c
 create mode 100644 stubs/qemu-timer-notify-cb.c

diff --git a/stubs/cpu-get-icount.c b/stubs/cpu-get-icount.c
index b35f844638..4001613240 100644
--- a/stubs/cpu-get-icount.c
+++ b/stubs/cpu-get-icount.c
@@ -14,8 +14,3 @@ int64_t cpu_get_icount_raw(void)
 {
     abort();
 }
-
-void qemu_timer_notify_cb(void *opaque, QEMUClockType type)
-{
-    qemu_notify_event();
-}
diff --git a/stubs/meson.build b/stubs/meson.build
index 019bd79c7a..e2dfedc2a7 100644
--- a/stubs/meson.build
+++ b/stubs/meson.build
@@ -24,9 +24,9 @@ stub_ss.add(files('machine-init-done.c'))
 stub_ss.add(files('migr-blocker.c'))
 stub_ss.add(files('monitor.c'))
 stub_ss.add(files('monitor-core.c'))
-stub_ss.add(files('notify-event.c'))
 stub_ss.add(files('pci-bus.c'))
 stub_ss.add(files('pci-host-piix.c'))
+stub_ss.add(files('qemu-timer-notify-cb.c'))
 stub_ss.add(files('qmp_memory_device.c'))
 stub_ss.add(files('qtest.c'))
 stub_ss.add(files('ram-block.c'))
diff --git a/stubs/notify-event.c b/stubs/notify-event.c
deleted file mode 100644
index 827bb52d1a..0000000000
--- a/stubs/notify-event.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include "qemu/osdep.h"
-#include "qemu/main-loop.h"
-
-void qemu_notify_event(void)
-{
-}
diff --git a/stubs/qemu-timer-notify-cb.c b/stubs/qemu-timer-notify-cb.c
new file mode 100644
index 0000000000..054b408b1c
--- /dev/null
+++ b/stubs/qemu-timer-notify-cb.c
@@ -0,0 +1,8 @@
+#include "qemu/osdep.h"
+#include "sysemu/cpus.h"
+#include "qemu/main-loop.h"
+
+void qemu_timer_notify_cb(void *opaque, QEMUClockType type)
+{
+    qemu_notify_event();
+}
-- 
2.18.2



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

* Re: [PATCH] stubs: Move qemu_timer_notify_cb() and remove qemu_notify_event() stub
  2020-09-02 10:24 [PATCH] stubs: Move qemu_timer_notify_cb() and remove qemu_notify_event() stub Thomas Huth
@ 2020-09-02 10:32 ` Paolo Bonzini
  2020-09-05  6:05   ` 罗勇刚(Yonggang Luo)
  0 siblings, 1 reply; 4+ messages in thread
From: Paolo Bonzini @ 2020-09-02 10:32 UTC (permalink / raw)
  To: Thomas Huth, qemu-devel; +Cc: Philippe Mathieu-Daudé, Claudio Fontana

On 02/09/20 12:24, Thomas Huth wrote:
> When cross-compiling with MinGW, there are sometimes some weird linker
> errors like:
> 
> ibqemuutil.a(util_main-loop.c.obj): In function `qemu_notify_event':
> /builds/huth/qemu/build/../util/main-loop.c:139: multiple definition of
>  `qemu_notify_event'
> libqemuutil.a(stubs_notify-event.c.obj):/builds/huth/qemu/stubs/notify-event.c:5:
>  first defined here
> collect2: error: ld returned 1 exit status
> /builds/huth/qemu/rules.mak:88: recipe for target 'tests/test-timed-average.exe'
>  failed
> 
> It seems like it works better when the qemu_timer_notify_cb() stub (which
> calls qemu_notify_event()) is in a separate file - then we can also even
> remove the qemu_notify_event() stub now.
> 
> This patch is based on ideas from the patch "stubs: Remove qemu_notify_event()"
> by Philippe Mathieu-Daudé and the patch "cpu-timers, icount: new modules" from
> Claudio Fontana.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  stubs/cpu-get-icount.c       | 5 -----
>  stubs/meson.build            | 2 +-
>  stubs/notify-event.c         | 6 ------
>  stubs/qemu-timer-notify-cb.c | 8 ++++++++
>  4 files changed, 9 insertions(+), 12 deletions(-)
>  delete mode 100644 stubs/notify-event.c
>  create mode 100644 stubs/qemu-timer-notify-cb.c
> 
> diff --git a/stubs/cpu-get-icount.c b/stubs/cpu-get-icount.c
> index b35f844638..4001613240 100644
> --- a/stubs/cpu-get-icount.c
> +++ b/stubs/cpu-get-icount.c
> @@ -14,8 +14,3 @@ int64_t cpu_get_icount_raw(void)
>  {
>      abort();
>  }
> -
> -void qemu_timer_notify_cb(void *opaque, QEMUClockType type)
> -{
> -    qemu_notify_event();
> -}
> diff --git a/stubs/meson.build b/stubs/meson.build
> index 019bd79c7a..e2dfedc2a7 100644
> --- a/stubs/meson.build
> +++ b/stubs/meson.build
> @@ -24,9 +24,9 @@ stub_ss.add(files('machine-init-done.c'))
>  stub_ss.add(files('migr-blocker.c'))
>  stub_ss.add(files('monitor.c'))
>  stub_ss.add(files('monitor-core.c'))
> -stub_ss.add(files('notify-event.c'))
>  stub_ss.add(files('pci-bus.c'))
>  stub_ss.add(files('pci-host-piix.c'))
> +stub_ss.add(files('qemu-timer-notify-cb.c'))
>  stub_ss.add(files('qmp_memory_device.c'))
>  stub_ss.add(files('qtest.c'))
>  stub_ss.add(files('ram-block.c'))
> diff --git a/stubs/notify-event.c b/stubs/notify-event.c
> deleted file mode 100644
> index 827bb52d1a..0000000000
> --- a/stubs/notify-event.c
> +++ /dev/null
> @@ -1,6 +0,0 @@
> -#include "qemu/osdep.h"
> -#include "qemu/main-loop.h"
> -
> -void qemu_notify_event(void)
> -{
> -}
> diff --git a/stubs/qemu-timer-notify-cb.c b/stubs/qemu-timer-notify-cb.c
> new file mode 100644
> index 0000000000..054b408b1c
> --- /dev/null
> +++ b/stubs/qemu-timer-notify-cb.c
> @@ -0,0 +1,8 @@
> +#include "qemu/osdep.h"
> +#include "sysemu/cpus.h"
> +#include "qemu/main-loop.h"
> +
> +void qemu_timer_notify_cb(void *opaque, QEMUClockType type)
> +{
> +    qemu_notify_event();
> +}
> 

Acked-by: Paolo Bonzini <pbonzini@redhat.com>



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

* Re: [PATCH] stubs: Move qemu_timer_notify_cb() and remove qemu_notify_event() stub
  2020-09-02 10:32 ` Paolo Bonzini
@ 2020-09-05  6:05   ` 罗勇刚(Yonggang Luo)
  2020-09-05  7:27     ` Thomas Huth
  0 siblings, 1 reply; 4+ messages in thread
From: 罗勇刚(Yonggang Luo) @ 2020-09-05  6:05 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: Thomas Huth, Philippe Mathieu-Daudé, qemu-level, Claudio Fontana

[-- Attachment #1: Type: text/plain, Size: 3432 bytes --]

On Wed, Sep 2, 2020 at 6:33 PM Paolo Bonzini <pbonzini@redhat.com> wrote:

> On 02/09/20 12:24, Thomas Huth wrote:
> > When cross-compiling with MinGW, there are sometimes some weird linker
> > errors like:
> >
> > ibqemuutil.a(util_main-loop.c.obj): In function `qemu_notify_event':
> > /builds/huth/qemu/build/../util/main-loop.c:139: multiple definition of
> >  `qemu_notify_event'
> >
> libqemuutil.a(stubs_notify-event.c.obj):/builds/huth/qemu/stubs/notify-event.c:5:
> >  first defined here
> > collect2: error: ld returned 1 exit status
> > /builds/huth/qemu/rules.mak:88: recipe for target
> 'tests/test-timed-average.exe'
> >  failed
> >
> > It seems like it works better when the qemu_timer_notify_cb() stub (which
> > calls qemu_notify_event()) is in a separate file - then we can also even
> > remove the qemu_notify_event() stub now.
> >
> > This patch is based on ideas from the patch "stubs: Remove
> qemu_notify_event()"
> > by Philippe Mathieu-Daudé and the patch "cpu-timers, icount: new
> modules" from
> > Claudio Fontana.
> >
> > Signed-off-by: Thomas Huth <thuth@redhat.com>
> > ---
> >  stubs/cpu-get-icount.c       | 5 -----
> >  stubs/meson.build            | 2 +-
> >  stubs/notify-event.c         | 6 ------
> >  stubs/qemu-timer-notify-cb.c | 8 ++++++++
> >  4 files changed, 9 insertions(+), 12 deletions(-)
> >  delete mode 100644 stubs/notify-event.c
> >  create mode 100644 stubs/qemu-timer-notify-cb.c
> >
> > diff --git a/stubs/cpu-get-icount.c b/stubs/cpu-get-icount.c
> > index b35f844638..4001613240 100644
> > --- a/stubs/cpu-get-icount.c
> > +++ b/stubs/cpu-get-icount.c
> > @@ -14,8 +14,3 @@ int64_t cpu_get_icount_raw(void)
> >  {
> >      abort();
> >  }
> > -
> > -void qemu_timer_notify_cb(void *opaque, QEMUClockType type)
> > -{
> > -    qemu_notify_event();
> > -}
> > diff --git a/stubs/meson.build b/stubs/meson.build
> > index 019bd79c7a..e2dfedc2a7 100644
> > --- a/stubs/meson.build
> > +++ b/stubs/meson.build
> > @@ -24,9 +24,9 @@ stub_ss.add(files('machine-init-done.c'))
> >  stub_ss.add(files('migr-blocker.c'))
> >  stub_ss.add(files('monitor.c'))
> >  stub_ss.add(files('monitor-core.c'))
> > -stub_ss.add(files('notify-event.c'))
> >  stub_ss.add(files('pci-bus.c'))
> >  stub_ss.add(files('pci-host-piix.c'))
> > +stub_ss.add(files('qemu-timer-notify-cb.c'))
> >  stub_ss.add(files('qmp_memory_device.c'))
> >  stub_ss.add(files('qtest.c'))
> >  stub_ss.add(files('ram-block.c'))
> > diff --git a/stubs/notify-event.c b/stubs/notify-event.c
> > deleted file mode 100644
> > index 827bb52d1a..0000000000
> > --- a/stubs/notify-event.c
> > +++ /dev/null
> > @@ -1,6 +0,0 @@
> > -#include "qemu/osdep.h"
> > -#include "qemu/main-loop.h"
> > -
> > -void qemu_notify_event(void)
> > -{
> > -}
> > diff --git a/stubs/qemu-timer-notify-cb.c b/stubs/qemu-timer-notify-cb.c
> > new file mode 100644
> > index 0000000000..054b408b1c
> > --- /dev/null
> > +++ b/stubs/qemu-timer-notify-cb.c
> > @@ -0,0 +1,8 @@
> > +#include "qemu/osdep.h"
> > +#include "sysemu/cpus.h"
> > +#include "qemu/main-loop.h"
> > +
> > +void qemu_timer_notify_cb(void *opaque, QEMUClockType type)
> > +{
> > +    qemu_notify_event();
> > +}
> >
>
> Acked-by: Paolo Bonzini <pbonzini@redhat.com>
>
LGTM, can you queue this patch,


-- 
         此致
礼
罗勇刚
Yours
    sincerely,
Yonggang Luo

[-- Attachment #2: Type: text/html, Size: 4598 bytes --]

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

* Re: [PATCH] stubs: Move qemu_timer_notify_cb() and remove qemu_notify_event() stub
  2020-09-05  6:05   ` 罗勇刚(Yonggang Luo)
@ 2020-09-05  7:27     ` Thomas Huth
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Huth @ 2020-09-05  7:27 UTC (permalink / raw)
  To: luoyonggang, Paolo Bonzini
  Cc: Philippe Mathieu-Daudé, qemu-level, Claudio Fontana

On 05/09/2020 08.05, 罗勇刚(Yonggang Luo) wrote:
> 
> 
> On Wed, Sep 2, 2020 at 6:33 PM Paolo Bonzini <pbonzini@redhat.com
> <mailto:pbonzini@redhat.com>> wrote:
> 
>     On 02/09/20 12:24, Thomas Huth wrote:
>     > When cross-compiling with MinGW, there are sometimes some weird linker
>     > errors like:
>     >
>     > ibqemuutil.a(util_main-loop.c.obj): In function `qemu_notify_event':
>     > /builds/huth/qemu/build/../util/main-loop.c:139: multiple
>     definition of
>     >  `qemu_notify_event'
>     >
>     libqemuutil.a(stubs_notify-event.c.obj):/builds/huth/qemu/stubs/notify-event.c:5:
>     >  first defined here
>     > collect2: error: ld returned 1 exit status
>     > /builds/huth/qemu/rules.mak:88: recipe for target
>     'tests/test-timed-average.exe'
>     >  failed
>     >
>     > It seems like it works better when the qemu_timer_notify_cb() stub
>     (which
>     > calls qemu_notify_event()) is in a separate file - then we can
>     also even
>     > remove the qemu_notify_event() stub now.
>     >
>     > This patch is based on ideas from the patch "stubs: Remove
>     qemu_notify_event()"
>     > by Philippe Mathieu-Daudé and the patch "cpu-timers, icount: new
>     modules" from
>     > Claudio Fontana.
>     >
>     > Signed-off-by: Thomas Huth <thuth@redhat.com
>     <mailto:thuth@redhat.com>>
>     > ---
>     >  stubs/cpu-get-icount.c       | 5 -----
>     >  stubs/meson.build            | 2 +-
>     >  stubs/notify-event.c         | 6 ------
>     >  stubs/qemu-timer-notify-cb.c | 8 ++++++++
>     >  4 files changed, 9 insertions(+), 12 deletions(-)
>     >  delete mode 100644 stubs/notify-event.c
>     >  create mode 100644 stubs/qemu-timer-notify-cb.c
>     >
>     > diff --git a/stubs/cpu-get-icount.c b/stubs/cpu-get-icount.c
>     > index b35f844638..4001613240 100644
>     > --- a/stubs/cpu-get-icount.c
>     > +++ b/stubs/cpu-get-icount.c
>     > @@ -14,8 +14,3 @@ int64_t cpu_get_icount_raw(void)
>     >  {
>     >      abort();
>     >  }
>     > -
>     > -void qemu_timer_notify_cb(void *opaque, QEMUClockType type)
>     > -{
>     > -    qemu_notify_event();
>     > -}
>     > diff --git a/stubs/meson.build b/stubs/meson.build
>     > index 019bd79c7a..e2dfedc2a7 100644
>     > --- a/stubs/meson.build
>     > +++ b/stubs/meson.build
>     > @@ -24,9 +24,9 @@ stub_ss.add(files('machine-init-done.c'))
>     >  stub_ss.add(files('migr-blocker.c'))
>     >  stub_ss.add(files('monitor.c'))
>     >  stub_ss.add(files('monitor-core.c'))
>     > -stub_ss.add(files('notify-event.c'))
>     >  stub_ss.add(files('pci-bus.c'))
>     >  stub_ss.add(files('pci-host-piix.c'))
>     > +stub_ss.add(files('qemu-timer-notify-cb.c'))
>     >  stub_ss.add(files('qmp_memory_device.c'))
>     >  stub_ss.add(files('qtest.c'))
>     >  stub_ss.add(files('ram-block.c'))
>     > diff --git a/stubs/notify-event.c b/stubs/notify-event.c
>     > deleted file mode 100644
>     > index 827bb52d1a..0000000000
>     > --- a/stubs/notify-event.c
>     > +++ /dev/null
>     > @@ -1,6 +0,0 @@
>     > -#include "qemu/osdep.h"
>     > -#include "qemu/main-loop.h"
>     > -
>     > -void qemu_notify_event(void)
>     > -{
>     > -}
>     > diff --git a/stubs/qemu-timer-notify-cb.c
>     b/stubs/qemu-timer-notify-cb.c
>     > new file mode 100644
>     > index 0000000000..054b408b1c
>     > --- /dev/null
>     > +++ b/stubs/qemu-timer-notify-cb.c
>     > @@ -0,0 +1,8 @@
>     > +#include "qemu/osdep.h"
>     > +#include "sysemu/cpus.h"
>     > +#include "qemu/main-loop.h"
>     > +
>     > +void qemu_timer_notify_cb(void *opaque, QEMUClockType type)
>     > +{
>     > +    qemu_notify_event();
>     > +}
>     >
> 
>     Acked-by: Paolo Bonzini <pbonzini@redhat.com
>     <mailto:pbonzini@redhat.com>>
> 
> LGTM, can you queue this patch,

Yes, I've got it in my queue for the patch series that enables
cross-compilers on gitlab. I just want to wait for Paolo's latest meson
series to hit the master branch before I send my pull request for the
cross-compiler series.

 Thomas



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

end of thread, other threads:[~2020-09-05  7:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-02 10:24 [PATCH] stubs: Move qemu_timer_notify_cb() and remove qemu_notify_event() stub Thomas Huth
2020-09-02 10:32 ` Paolo Bonzini
2020-09-05  6:05   ` 罗勇刚(Yonggang Luo)
2020-09-05  7:27     ` Thomas Huth

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.