Stop using HOST_OS, whitelist windows modules

All clang host modules are whitelisted, since they all pass checkbuild.

Bug: 23566667
Change-Id: Idcd328323b2a2e9cc9c0acd29e583b6bb77e72b0
diff --git a/shared_clang.mk b/shared_clang.mk
index 151a626..8b81d16 100644
--- a/shared_clang.mk
+++ b/shared_clang.mk
@@ -1,5 +1,3 @@
-# Don't build the library unless forced to.
-ifeq (true,$(FORCE_BUILD_LLVM_COMPONENTS))
 # Don't build the library in unbundled branches.
 ifeq (,$(TARGET_BUILD_APPS))
 
@@ -33,17 +31,34 @@
 LOCAL_MODULE_TAGS := optional
 LOCAL_WHOLE_STATIC_LIBRARIES := $(clang_whole_static_libraries)
 
-ifeq ($(HOST_OS),windows)
-  LOCAL_SHARED_LIBRARIES := libLLVM
-  LOCAL_LDLIBS := -limagehlp -lpsapi
-else
-  LOCAL_SHARED_LIBRARIES := libLLVM libc++
-  LOCAL_LDLIBS := -ldl -lpthread
-endif
+LOCAL_SHARED_LIBRARIES := libLLVM
+
+LOCAL_LDLIBS_windows := -limagehlp -lpsapi
+
+LOCAL_SHARED_LIBRARIES_darwin := libc++
+LOCAL_SHARED_LIBRARIES_linux := libc++
+LOCAL_LDLIBS_darwin := -ldl -lpthread
+LOCAL_LDLIBS_linux := -ldl -lpthread
 
 include $(CLANG_HOST_BUILD_MK)
-include $(BUILD_HOST_SHARED_LIBRARY)
 
+# Don't build the library unless forced to. We don't
+# have prebuilts for windows.
+ifneq (true,$(FORCE_BUILD_LLVM_COMPONENTS))
+LOCAL_MODULE_HOST_OS := windows
+# BUILD_HOST_SHARED_LIBRARY can be moved out once
+# LOCAL_MODULE_HOST_OS is enforced.
+ifeq ($(HOST_OS),windows)
+include $(BUILD_HOST_SHARED_LIBRARY)
+endif
+else
+LOCAL_MODULE_HOST_OS := darwin linux windows
+include $(BUILD_HOST_SHARED_LIBRARY)
+endif
+
+
+# Don't build the library unless forced to.
+ifeq (true,$(FORCE_BUILD_LLVM_COMPONENTS))
 # device
 include $(CLEAR_VARS)
 
@@ -56,6 +71,6 @@
 
 include $(CLANG_DEVICE_BUILD_MK)
 include $(BUILD_SHARED_LIBRARY)
+endif # don't build unless forced to
 
 endif # don't build in unbundled branches
-endif # don't build unless forced to