diff mbox series

[PATCH-for-5.1] stubs: Fix notify-event stub linkage error on MinGW

Message ID 20200804182241.31805-1-philmd@redhat.com
State New
Headers show
Series [PATCH-for-5.1] stubs: Fix notify-event stub linkage error on MinGW | expand

Commit Message

Philippe Mathieu-Daudé Aug. 4, 2020, 6:22 p.m. UTC
In commit e4d6d41ce2 we reduced the user-mode object list,
but forgot to also change the notify.o stub in the next commit
dc70f80fb2. This triggers a linker error while compiling the
tests under MinGW:

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

Correct by placing the stub object between the system emulation /
tools guards.

Fixes: dc70f80fb2 ("stubs/Makefile: Reduce the user-mode object list")
Reported-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 stubs/Makefile.objs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Philippe Mathieu-Daudé Aug. 4, 2020, 6:51 p.m. UTC | #1
On 8/4/20 8:22 PM, Philippe Mathieu-Daudé wrote:
> In commit e4d6d41ce2 we reduced the user-mode object list,
> but forgot to also change the notify.o stub in the next commit
> dc70f80fb2. This triggers a linker error while compiling the
> tests under MinGW:
> 
>   LINK    tests/test-timed-average.exe
>  libqemuutil.a(main-loop.o): In function `qemu_notify_event':
>  util/main-loop.c:139: multiple definition of `qemu_notify_event'
>  tests/test-timed-average.o:/builds/huth/qemu/tests/../stubs/notify-event.c:5: first defined here
>  collect2: error: ld returned 1 exit status
>  rules.mak:124: recipe for target 'tests/test-timed-average.exe' failed
> 
> Correct by placing the stub object between the system emulation /
> tools guards.
> 
> Fixes: dc70f80fb2 ("stubs/Makefile: Reduce the user-mode object list")
> Reported-by: Thomas Huth <thuth@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  stubs/Makefile.objs | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs
> index d42046afe4..4e8605a609 100644
> --- a/stubs/Makefile.objs
> +++ b/stubs/Makefile.objs
> @@ -12,7 +12,6 @@ stub-obj-y += isa-bus.o
>  stub-obj-$(CONFIG_LINUX_AIO) += linux-aio.o
>  stub-obj-$(CONFIG_LINUX_IO_URING) += io_uring.o
>  stub-obj-y += monitor-core.o
> -stub-obj-y += notify-event.o
>  stub-obj-y += pci-bus.o
>  stub-obj-y += qmp_memory_device.o
>  stub-obj-y += qtest.o
> @@ -45,6 +44,7 @@ stub-obj-y += iothread.o
>  stub-obj-y += machine-init-done.o
>  stub-obj-y += migr-blocker.o
>  stub-obj-y += monitor.o
> +stub-obj-y += notify-event.o
>  stub-obj-y += pci-host-piix.o
>  stub-obj-y += ram-block.o
>  stub-obj-y += replay-user.o
> 

self-NACK, this doesn't work as expected =)
diff mbox series

Patch

diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs
index d42046afe4..4e8605a609 100644
--- a/stubs/Makefile.objs
+++ b/stubs/Makefile.objs
@@ -12,7 +12,6 @@  stub-obj-y += isa-bus.o
 stub-obj-$(CONFIG_LINUX_AIO) += linux-aio.o
 stub-obj-$(CONFIG_LINUX_IO_URING) += io_uring.o
 stub-obj-y += monitor-core.o
-stub-obj-y += notify-event.o
 stub-obj-y += pci-bus.o
 stub-obj-y += qmp_memory_device.o
 stub-obj-y += qtest.o
@@ -45,6 +44,7 @@  stub-obj-y += iothread.o
 stub-obj-y += machine-init-done.o
 stub-obj-y += migr-blocker.o
 stub-obj-y += monitor.o
+stub-obj-y += notify-event.o
 stub-obj-y += pci-host-piix.o
 stub-obj-y += ram-block.o
 stub-obj-y += replay-user.o