ART: Wire up a valgrind-wrapped dex2oat run

Extend build-art-executable to understand multilib=both, in which
case a stem is necessary. Use name32 for the 32b version, and name
for the 64b version (or only version).

Create both 32b and 64b dex2oat on the host.

Extend the core generation rules to allow a wrapper. Create rules
to run with valgrind: valgrind-test-art-host-dex2oat.

Currently this is not wired up to valgrind-test-art-host, as valgrind
reports an error on exit.

Note: this takes a long time, as by default the debug version of
dex2oat is used. The author has seen runs of about 6 minutes.

Bug: 18605772
Change-Id: I32c270d2cf8a104f154bdf91875670b03d3f5d3b
diff --git a/build/Android.executable.mk b/build/Android.executable.mk
index 86f445f..ae42136 100644
--- a/build/Android.executable.mk
+++ b/build/Android.executable.mk
@@ -99,7 +99,18 @@
   ifeq ($$(art_target_or_host),target)
     LOCAL_MODULE_TARGET_ARCH := $(ART_SUPPORTED_ARCH)
   endif
+
+  # If multilib, need to provide stem.
   LOCAL_MULTILIB := $$(art_multilib)
+  ifeq ($$(art_multilib),both)
+    ifeq ($$(art_ndebug_or_debug),ndebug)
+      LOCAL_MODULE_STEM_32 := $$(art_executable)32
+      LOCAL_MODULE_STEM_64 := $$(art_executable)
+    else #debug
+      LOCAL_MODULE_STEM_32 := $$(art_executable)d32
+      LOCAL_MODULE_STEM_64 := $$(art_executable)d
+    endif
+  endif
 
   include external/libcxx/libcxx.mk
   ifeq ($$(art_target_or_host),target)