Allow to build native tests for translation arch only.

- To build a native test for translation arch only, use:
  LOCAL_MODULE_TARGET_ARCH := <translation arch>
- Also disable building .odex for translation arch for Java libraries.

Bug: 27526885
Change-Id: I063e8876781c4424da7abebf1b9b7cb842ce205f
(cherry-pick from commit d90eb21cd79fef3cc9566524d823cdf210799fcd)
diff --git a/core/executable.mk b/core/executable.mk
index 1bd9db1..27c033d 100644
--- a/core/executable.mk
+++ b/core/executable.mk
@@ -18,8 +18,13 @@
 ifneq (true,$(my_skip_this_target))
 
 ifeq ($(TARGET_TRANSLATE_2ND_ARCH),true)
+# If a native test explicity specifies to build only for the translation arch,
+# we'll still need LOCAL_MULTILIB=both and let module_arch_supported.mk choose
+# to build only for TARGET_2ND_ARCH.
+ifneq (1,$(words $(LOCAL_MODULE_TARGET_ARCH)))
 LOCAL_MULTILIB := first
 endif
+endif
 
 my_prefix := TARGET_
 include $(BUILD_SYSTEM)/multilib.mk