memcheck: Remove feature entirely

This patch removes the memcheck feature from the Android emulator
code base. This is for several reasons:

- Supporting the feature impacts many QEMU-specific emulation files
  in subtle ways, that make it difficult to refactor this code to
  integrate upstream changes.

- The feature only works for ARM (32-bit), has no unit tests, and
  generates massive amounts of false positive messages coming
  from the platform.

- Barely anyone uses it.

This feature might make a comeback in the future, but this will be
under a different life-form that will have adapted to the new state
of the code.

+ As a bonus, fix the build!

Change-Id: Idd19a3bc7923379cb1e82850f14499549b6a991b
diff --git a/Makefile.target b/Makefile.target
index 0377cdd..e2d2871 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -177,7 +177,6 @@
     target-arm/iwmmxt_helper.c \
     target-arm/neon_helper.c \
     target-arm/helper.c \
-    target-arm/helper-android.c \
     target-arm/translate.c \
     target-arm/machine.c \
     hw/arm/armv7m.c \
@@ -233,25 +232,6 @@
         kvm-android.c
 endif
 
-##############################################################################
-# Memory-access checking support.
-# Memory access checker uses information collected by instrumented code in
-# libc.so in order to keep track of memory blocks allocated from heap. Memory
-# checker then uses this information to make sure that every access to allocated
-# memory is within allocated block. This information also allows detecting
-# memory leaks and attempts to free/realloc invalid pointers.
-#
-common_LOCAL_CFLAGS += $(ELFF_CFLAGS)
-
-MCHK_SOURCES := \
-    memcheck.c \
-    memcheck_proc_management.c \
-    memcheck_malloc_map.c \
-    memcheck_mmrange_map.c \
-    memcheck_util.c
-
-common_LOCAL_SRC_FILES += $(MCHK_SOURCES:%=android/qemu/memcheck/%)
-
 common_LOCAL_SRC_FILES += \
     cpus.c \
     arch_init.c
@@ -296,7 +276,6 @@
     emulator-libui \
     emulator-libqemu \
     emulator-target-$(EMULATOR_TARGET_CPU) \
-    emulator-libelff \
     emulator-common \
     emulator-zlib
 
@@ -345,6 +324,8 @@
 common_LOCAL_SRC_FILES += $(BLOCK_SOURCES)
 common_LOCAL_CFLAGS    += $(BLOCK_CFLAGS)
 
+common_LOCAL_LDLIBS += -lstdc++
+
 # Generate a completely static executable if needed.
 # Note that this means no sound and graphics on Linux.
 #
@@ -360,7 +341,6 @@
     emulator-libqemu \
     emulator-target-$(EMULATOR_TARGET_CPU) \
     emulator-libjpeg \
-    emulator-libelff \
     emulator-common \
     emulator-libext4_utils \
     emulator-libsparse \
@@ -392,7 +372,6 @@
     emulator64-libqemu \
     emulator64-target-$(EMULATOR_TARGET_CPU) \
     emulator64-libjpeg \
-    emulator64-libelff \
     emulator64-common \
     emulator64-libext4_utils \
     emulator64-libsparse \