Fix imgdiag build rules.

Adjust build rules to avoid building a 64-bit imgdiag
executable on host when HOST_PREFER_32_BIT is true.

This CL addresses an imgdiag related build issue that
appeared on the ART Buildbot after system/core was unpinned
from the master-art manifest
(https://android-review.googlesource.com/#/c/185580), used
by some of our Buildbot configurations:

  ninja: error: 'out/host/linux-x86/obj/SHARED_LIBRARIES/libbacktrace_intermediates/export_includes', needed by 'out/host/linux-x86/obj/EXECUTABLES/imgdiag_intermediates/import_includes', missing and no known rule to make it

Bug: 26051370
Change-Id: I8f3b3c89fb8da0c37a1ffb21b6d835e7ede1e71a
diff --git a/dex2oat/Android.mk b/dex2oat/Android.mk
index e252765..f10acf9 100644
--- a/dex2oat/Android.mk
+++ b/dex2oat/Android.mk
@@ -38,9 +38,10 @@
   dex2oat_target_arch := 32
 endif
 
-# We need to explcitly give the arch, as giving 'both' will make the
-# build-art-executable rule compile dex2oat for 64bits.
 ifeq ($(HOST_PREFER_32_BIT),true)
+  # We need to explicitly restrict the host arch to 32-bit only, as
+  # giving 'both' would make build-art-executable generate a build
+  # rule for a 64-bit dex2oat executable too.
   dex2oat_host_arch := 32
 else
   dex2oat_host_arch := both
@@ -71,4 +72,8 @@
   endif
 endif
 
+# Clear locals now they've served their purpose.
+dex2oat_target_arch :=
+dex2oat_host_arch :=
+
 endif