qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] ppce500_mpc8544ds: Fix compile with --enable-debug and --disable-kvm
@ 2011-04-08 10:08 David Gibson
  2011-04-08 10:19 ` [Qemu-devel] " Alexander Graf
  0 siblings, 1 reply; 2+ messages in thread
From: David Gibson @ 2011-04-08 10:08 UTC (permalink / raw)
  To: agraf, qemu-devel

When configured with --enable-debug, we compile without optimization.
This means that the function mpc8544_copy_soc_cell() in ppce500_mpc8544ds.c
is not optimized out, even though it is never called without kvm.  That in
turn causes a link failure, because it calls the function
kvmppc_read_host_property() which is in kvm_ppc.o and therefore not
included in a --disable-kvm build.

This patch fixes the problem by providing a dummy stub for
kvmppc_read_host_property() in kvm_ppc.h when !CONFIG_KVM.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
 target-ppc/kvm_ppc.h |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/target-ppc/kvm_ppc.h b/target-ppc/kvm_ppc.h
index 5afb308..45a1373 100644
--- a/target-ppc/kvm_ppc.h
+++ b/target-ppc/kvm_ppc.h
@@ -11,8 +11,17 @@
 
 void kvmppc_init(void);
 void kvmppc_fdt_update(void *fdt);
+#ifndef CONFIG_KVM
+static inline int kvmppc_read_host_property(const char *node_path, const char *prop,
+                                            void *val, size_t len)
+{
+    assert(0);
+    return -ENOSYS;
+}
+#else
 int kvmppc_read_host_property(const char *node_path, const char *prop,
                                      void *val, size_t len);
+#endif
 
 uint32_t kvmppc_get_tbfreq(void);
 int kvmppc_get_hypercall(CPUState *env, uint8_t *buf, int buf_len);
-- 
1.7.1

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

* [Qemu-devel] Re: [PATCH] ppce500_mpc8544ds: Fix compile with --enable-debug and --disable-kvm
  2011-04-08 10:08 [Qemu-devel] [PATCH] ppce500_mpc8544ds: Fix compile with --enable-debug and --disable-kvm David Gibson
@ 2011-04-08 10:19 ` Alexander Graf
  0 siblings, 0 replies; 2+ messages in thread
From: Alexander Graf @ 2011-04-08 10:19 UTC (permalink / raw)
  To: David Gibson; +Cc: qemu-devel


On 08.04.2011, at 12:08, David Gibson wrote:

> When configured with --enable-debug, we compile without optimization.
> This means that the function mpc8544_copy_soc_cell() in ppce500_mpc8544ds.c
> is not optimized out, even though it is never called without kvm.  That in
> turn causes a link failure, because it calls the function
> kvmppc_read_host_property() which is in kvm_ppc.o and therefore not
> included in a --disable-kvm build.
> 
> This patch fixes the problem by providing a dummy stub for
> kvmppc_read_host_property() in kvm_ppc.h when !CONFIG_KVM.

Looks good. When we get more such cases we should probably move this into our own kvm-stub.c, but for now having it in a header is good enough.

I'll take this into the ppc-next tree and send a pull request shortly.


Alex

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

end of thread, other threads:[~2011-04-08 10:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-08 10:08 [Qemu-devel] [PATCH] ppce500_mpc8544ds: Fix compile with --enable-debug and --disable-kvm David Gibson
2011-04-08 10:19 ` [Qemu-devel] " Alexander Graf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).