stubs: Move qemu_fd_register stub to util/main-loop.c
authorThomas Huth <thuth@redhat.com>
Wed, 2 Sep 2020 11:17:24 +0000 (13:17 +0200)
committerThomas Huth <thuth@redhat.com>
Mon, 7 Sep 2020 10:34:17 +0000 (12:34 +0200)
The linker of MinGW sometimes runs into the following problem:

libqemuutil.a(util_main-loop.c.obj): In function `qemu_fd_register':
/builds/huth/qemu/build/../util/main-loop.c:331: multiple definition of
 `qemu_fd_register'
libqemuutil.a(stubs_fd-register.c.obj):/builds/huth/qemu/stubs/fd-register.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

qemu_fd_register() is defined in util/main-loop.c for WIN32, so let's simply
move the stub also there in the #else part of the corresponding #ifndef
to fix this problem.

Message-Id: <20200903054503.425435-1-thuth@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
stubs/fd-register.c [deleted file]
stubs/meson.build
util/main-loop.c

diff --git a/stubs/fd-register.c b/stubs/fd-register.c
deleted file mode 100644 (file)
index 63a4abd..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#include "qemu/osdep.h"
-#include "qemu/main-loop.h"
-
-void qemu_fd_register(int fd)
-{
-}
index e2dfedc2a79ed76ebe39d8165fee4b3d74de2545..e0b322bc282fa2ff5bdbf57c0307fbeab337c303 100644 (file)
@@ -9,7 +9,6 @@ stub_ss.add(files('cpu-get-clock.c'))
 stub_ss.add(files('cpu-get-icount.c'))
 stub_ss.add(files('dump.c'))
 stub_ss.add(files('error-printf.c'))
-stub_ss.add(files('fd-register.c'))
 stub_ss.add(files('fdset.c'))
 stub_ss.add(files('fw_cfg.c'))
 stub_ss.add(files('gdbstub.c'))
index f69f055013963f8109c0a53b2c66defd125f1983..217c8d60560805c1bb92747a57800b1e9ecf704c 100644 (file)
@@ -179,6 +179,10 @@ static int max_priority;
 static int glib_pollfds_idx;
 static int glib_n_poll_fds;
 
+void qemu_fd_register(int fd)
+{
+}
+
 static void glib_pollfds_fill(int64_t *cur_timeout)
 {
     GMainContext *context = g_main_context_default();