Add HOST_PREFER_32_BIT to support 32-bit-by-default multilib build

We already support pure 32-bit and 64-bit-by-default multilib build.
With HOST_PREFER_32_BIT we can build 32-bit-by-default multilib build.
This will be lest disruptive during the period we transition to
64-bit-by-default.

Bug: 13751317
Change-Id: I0d56ce4abbe4afeaacfd70d709f6a349791c0722
diff --git a/core/main.mk b/core/main.mk
index fa8e872..b07d5a1 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -647,6 +647,14 @@
       $(subst $(comma),$(space),$(lastword $(p))))))) \
   $(eval $(call add-required-deps,$(word 2,$(p)),$(r))))
 endif
+ifdef HOST_2ND_ARCH
+$(foreach m,$($(HOST_2ND_ARCH_VAR_PREFIX)HOST_DEPENDENCIES_ON_SHARED_LIBRARIES), \
+  $(eval p := $(subst :,$(space),$(m))) \
+  $(eval r := $(filter $(HOST_OUT_ROOT)/%,$(call module-installed-files,\
+    $(addsuffix $(HOST_2ND_ARCH_MODULE_SUFFIX), \
+      $(subst $(comma),$(space),$(lastword $(p))))))) \
+  $(eval $(call add-required-deps,$(word 2,$(p)),$(r))))
+endif
 
 m :=
 r :=