Patchwork [PATCHv2,4/6] dump: fix up memory mapping dependencies / stub

login
register
mail settings
Submitter Rabin Vincent
Date March 24, 2013, 5:27 p.m.
Message ID <1364146041-27041-5-git-send-email-rabin@rab.in>
Download mbox | patch
Permalink /patch/230470/
State New
Headers show

Comments

Rabin Vincent - March 24, 2013, 5:27 p.m.
dump.c won't build without the functions from memory_mapping.c (and
memory_mapping-stub.c does not help there), so build memory_mapping.c
when CONFIG_HAVE_CORE_DUMP is set.

  dump.c:84: undefined reference to `memory_mapping_list_free'
  dump.c:819: undefined reference to `memory_mapping_list_init'
  dump.c:827: undefined reference to `memory_mapping_filter'

Allow memory_mapping-stub.c to instead be used for targets which do not
set CONFIG_HAVE_GET_MEMORY_MAPPING.

Signed-off-by: Rabin Vincent <rabin@rab.in>
---
 Makefile.target       |    3 +--
 memory_mapping-stub.c |    5 -----
 2 files changed, 1 insertion(+), 7 deletions(-)
Paolo Bonzini - April 4, 2013, 9:43 a.m.
Il 24/03/2013 18:27, Rabin Vincent ha scritto:
> dump.c won't build without the functions from memory_mapping.c (and
> memory_mapping-stub.c does not help there), so build memory_mapping.c
> when CONFIG_HAVE_CORE_DUMP is set.
> 
>   dump.c:84: undefined reference to `memory_mapping_list_free'
>   dump.c:819: undefined reference to `memory_mapping_list_init'
>   dump.c:827: undefined reference to `memory_mapping_filter'
> 
> Allow memory_mapping-stub.c to instead be used for targets which do not
> set CONFIG_HAVE_GET_MEMORY_MAPPING.

The right fix is to add these to memory_mapping-stub.c.

Paolo

Patch

diff --git a/Makefile.target b/Makefile.target
index 2bd6d14..629f48a 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -115,8 +115,7 @@  obj-$(CONFIG_FDT) += device_tree.o
 obj-$(CONFIG_KVM) += kvm-all.o
 obj-$(CONFIG_NO_KVM) += kvm-stub.o
 obj-y += memory.o savevm.o cputlb.o
-obj-$(CONFIG_HAVE_GET_MEMORY_MAPPING) += memory_mapping.o
-obj-$(CONFIG_HAVE_CORE_DUMP) += dump.o
+obj-$(CONFIG_HAVE_CORE_DUMP) += dump.o memory_mapping.o
 obj-$(CONFIG_NO_GET_MEMORY_MAPPING) += memory_mapping-stub.o
 obj-$(CONFIG_NO_CORE_DUMP) += dump-stub.o
 LIBS+=-lz
diff --git a/memory_mapping-stub.c b/memory_mapping-stub.c
index 24d5d67..6dd9e36 100644
--- a/memory_mapping-stub.c
+++ b/memory_mapping-stub.c
@@ -15,11 +15,6 @@ 
 #include "exec/cpu-all.h"
 #include "sysemu/memory_mapping.h"
 
-int qemu_get_guest_memory_mapping(MemoryMappingList *list)
-{
-    return -2;
-}
-
 int cpu_get_memory_mapping(MemoryMappingList *list,
 					                                          CPUArchState *env)
 {