Switch to 32-bit-by-default host multilib build.

Also we don't need to force LLVM built from source, for we already force
LLVM to be built as 32-bit.

Bug: 13751317
Change-Id: Ifadf1988d28b60cb06316de50f5bdc1834f1acc0
diff --git a/CleanSpec.mk b/CleanSpec.mk
index a3b1a2c..c764204 100644
--- a/CleanSpec.mk
+++ b/CleanSpec.mk
@@ -233,6 +233,9 @@
 # Switching PRODUCT_RUNTIMES default for some devices
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/build.prop)
 
+# Switching to 32-bit-by-default host multilib build
+$(call add-clean-step, rm -rf $(HOST_OUT_INTERMEDIATES))
+
 # ************************************************
 # NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
 # ************************************************
diff --git a/core/Makefile b/core/Makefile
index bd2f9a0..46b23f8 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -1473,7 +1473,7 @@
   INTERNAL_SDK_HOST_OS_NAME := $(HOST_OS)
 endif
 ifneq ($(HOST_OS),windows)
-  INTERNAL_SDK_HOST_OS_NAME := $(INTERNAL_SDK_HOST_OS_NAME)-$(HOST_ARCH)
+  INTERNAL_SDK_HOST_OS_NAME := $(INTERNAL_SDK_HOST_OS_NAME)-$(SDK_HOST_ARCH)
 endif
 sdk_name := $(sdk_name)_$(INTERNAL_SDK_HOST_OS_NAME)
 
@@ -1500,7 +1500,7 @@
 sdk_atree_files := \
 	$(atree_dir)/sdk.exclude.atree \
 	$(atree_dir)/sdk.atree \
-	$(atree_dir)/sdk-$(HOST_OS)-$(HOST_ARCH).atree
+	$(atree_dir)/sdk-$(HOST_OS)-$(SDK_HOST_ARCH).atree
 
 # development/build/sdk-android-<abi>.atree is used to differentiate
 # between architecture models (e.g. ARMv5TE versus ARMv7) when copying
diff --git a/core/clang/config.mk b/core/clang/config.mk
index 10b4d72..e751d79 100644
--- a/core/clang/config.mk
+++ b/core/clang/config.mk
@@ -6,11 +6,6 @@
 WITHOUT_HOST_CLANG := true
 endif
 
-# We don't have 64-bit host prebuilts yet.
-ifeq (true,$(HOST_IS_64_BIT))
-FORCE_BUILD_LLVM_COMPONENTS := true
-endif
-
 LLVM_PREBUILTS_PATH := prebuilts/clang/$(BUILD_OS)-x86/host/3.5/bin
 LLVM_PREBUILTS_HEADER_PATH := prebuilts/clang/$(BUILD_OS)-x86/host/3.5/lib/clang/3.5/include/
 
diff --git a/core/envsetup.mk b/core/envsetup.mk
index a228fc7..8013e18 100644
--- a/core/envsetup.mk
+++ b/core/envsetup.mk
@@ -67,28 +67,32 @@
 $(error Unable to determine HOST_OS from uname -sm: $(UNAME)!)
 endif
 
+# TODO: Replace BUILD_HOST_64bit with a flag that forces 32-bit build,
+# after we default to 64-bit host build.
+ifeq (,$(BUILD_HOST_64bit))
+# Default to 32-bit-by-default multilib host build.
+HOST_PREFER_32_BIT := true
 ifeq ($(HOST_PREFER_32_BIT),true)
-# User asks for multilib build, but use 32-bit as preferred arch.
 BUILD_HOST_64bit := true
 endif
+endif
 
 # HOST_ARCH
 ifneq (,$(findstring x86_64,$(UNAME)))
-  # TODO: Replace BUILD_HOST_64bit with a flag that forces 32-bit build,
-  # after we default to 64-bit host build.
-  ifeq (,$(BUILD_HOST_64bit))
-    HOST_ARCH := x86
-    HOST_2ND_ARCH :=
-  else
-    HOST_ARCH := x86_64
-    HOST_2ND_ARCH := x86
-  endif
+  HOST_ARCH := x86_64
+  HOST_2ND_ARCH := x86
 else ifneq (,$(findstring 86,$(UNAME)))
   # It's not officially supported!
   HOST_ARCH := x86
   HOST_2ND_ARCH :=
 endif
 
+ifeq ($(HOST_PREFER_32_BIT),true)
+SDK_HOST_ARCH := x86
+else
+SDK_HOST_ARCH := $(HOST_ARCH)
+endif
+
 BUILD_ARCH := $(HOST_ARCH)
 BUILD_2ND_ARCH := $(HOST_2ND_ARCH)
 
diff --git a/core/product_config.mk b/core/product_config.mk
index 290dec4..f32a596 100644
--- a/core/product_config.mk
+++ b/core/product_config.mk
@@ -164,13 +164,11 @@
 
 # Default to building dalvikvm on hosts that support it...
 ifeq ($(HOST_OS),linux)
-ifneq ($(HOST_ARCH),x86_64)
 # ... or if the if the option is already set
 ifeq ($(WITH_HOST_DALVIK),)
   WITH_HOST_DALVIK := true
 endif
 endif
-endif
 
 # ---------------------------------------------------------------
 # Include the product definitions.