force dex2oat target executables to be compiled for 32-bit

64-bit dex2oat doesn't support 32-bit targets yet, force dex2oat
target executables to compile 32-bit for now by passing in a
value for LOCAL_MULTILIB to build-art-executable.

Bug: 13764385
Change-Id: I41adba1e64f373e4b61a3c13af2592ed4f7d0b57
diff --git a/build/Android.executable.mk b/build/Android.executable.mk
index 88ca47e..27d687c 100644
--- a/build/Android.executable.mk
+++ b/build/Android.executable.mk
@@ -30,6 +30,7 @@
 # $(4): extra include directories
 # $(5): target or host
 # $(6): ndebug or debug
+# $(7): value for LOCAL_MULTILIB (empty means default)
 define build-art-executable
   ifneq ($(5),target)
     ifneq ($(5),host)
@@ -48,6 +49,7 @@
   art_c_includes := $(4)
   art_target_or_host := $(5)
   art_ndebug_or_debug := $(6)
+  art_multilib := $(7)
 
   include $(CLEAR_VARS)
   ifeq ($$(art_target_or_host),target)
@@ -98,6 +100,7 @@
 
   ifeq ($$(art_target_or_host),target)
     LOCAL_MODULE_TARGET_ARCH := $(ART_SUPPORTED_ARCH)
+    LOCAL_MULTILIB := $$(art_multilib)
   endif
 
   ifeq ($$(art_target_or_host),target)
diff --git a/dex2oat/Android.mk b/dex2oat/Android.mk
index 6cd0538..038f0a7 100644
--- a/dex2oat/Android.mk
+++ b/dex2oat/Android.mk
@@ -22,10 +22,10 @@
 	dex2oat.cc
 
 ifeq ($(ART_BUILD_TARGET_NDEBUG),true)
-  $(eval $(call build-art-executable,dex2oat,$(DEX2OAT_SRC_FILES),libcutils libart-compiler,art/compiler,target,ndebug))
+  $(eval $(call build-art-executable,dex2oat,$(DEX2OAT_SRC_FILES),libcutils libart-compiler,art/compiler,target,ndebug,32))
 endif
 ifeq ($(ART_BUILD_TARGET_DEBUG),true)
-  $(eval $(call build-art-executable,dex2oat,$(DEX2OAT_SRC_FILES),libcutils libartd-compiler,art/compiler,target,debug))
+  $(eval $(call build-art-executable,dex2oat,$(DEX2OAT_SRC_FILES),libcutils libartd-compiler,art/compiler,target,debug,32))
 endif
 
 ifeq ($(WITH_HOST_DALVIK),true)