Skip to contentSkip to conversation

stubs: Fix notify-event stub linkage error on MinGW

PATCH-for-5.1 Philippe Mathieu-Daudé 1 participant 2 messages Aug 4, 2020

lore
Share & tools
lore
#0 lore raw

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")
---
 stubs/Makefile.objs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
stubs/Makefile.objs +1 -1
index d42046afe4..4e8605a609 100644
@@ -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
Signature · 1 line
2.21.3
#1 lore raw
Quoted 36 lines · Philippe Mathieu-Daudé

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")
---
 stubs/Makefile.objs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
stubs/Makefile.objs +0 -1
index d42046afe4..4e8605a609 100644
@@ -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

stubs/Makefile.objs stub-obj-y += iothread.o · line 50

Quoted 7 lines
stubs/Makefile.objs +1 -0
@@ -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 =)