Commit 88ca2a5988d8712caf04406f08cfbf09f09101ab

Authored by Paul Brook
1 parent 55616505

Add tool_osdep.c

osdep.c is built in both as a toplevel target independant object, and
as a per-target object because of kqemu dependencies.  Under some
circumstances make picks up the wrong one.

Build the former as tool-osdep to avoid this conflict.

Signed-off-by: Paul Brook <paul@codesourcery.com>
Makefile
... ... @@ -222,11 +222,11 @@ libqemu_user.a: $(USER_OBJS)
222 222  
223 223 ######################################################################
224 224  
225   -qemu-img$(EXESUF): qemu-img.o qemu-tool.o osdep.o $(BLOCK_OBJS)
  225 +qemu-img$(EXESUF): qemu-img.o qemu-tool.o tool-osdep.o $(BLOCK_OBJS)
226 226  
227   -qemu-nbd$(EXESUF): qemu-nbd.o qemu-tool.o osdep.o $(BLOCK_OBJS)
  227 +qemu-nbd$(EXESUF): qemu-nbd.o qemu-tool.o tool-osdep.o $(BLOCK_OBJS)
228 228  
229   -qemu-io$(EXESUF): qemu-io.o qemu-tool.o osdep.o cmd.o $(BLOCK_OBJS)
  229 +qemu-io$(EXESUF): qemu-io.o qemu-tool.o tool-osdep.o cmd.o $(BLOCK_OBJS)
230 230  
231 231 qemu-img$(EXESUF) qemu-nbd$(EXESUF) qemu-io$(EXESUF): LIBS += -lz
232 232  
... ...
... ... @@ -33,6 +33,9 @@
33 33 #include <sys/statvfs.h>
34 34 #endif
35 35  
  36 +/* FIXME: This file should be target independent. However it has kqemu
  37 + hacks, so must be built for every target. */
  38 +
36 39 /* Needed early for HOST_BSD etc. */
37 40 #include "config-host.h"
38 41  
... ...
tool-osdep.c 0 → 100644
  1 +/* Hack to provide a version of osdep.o for qemu-img without conflicting with
  2 + the (kqemu) target specific osdep.o. */
  3 +#include "osdep.c"
  4 +
... ...