Don't build windows modules with clang, fix flags
shamu checkbuilds set USE_CLANG_PLATFORM_BUILD, which shouldn't apply to
modules built for windows. Also fix some flags that were being set
improperly.
Bug: 23566667
Change-Id: Id4c5b7cc59966328483d90f2b7be3f35e439ecee
diff --git a/core/binary.mk b/core/binary.mk
index e18ccea..4bf31ad 100644
--- a/core/binary.mk
+++ b/core/binary.mk
@@ -191,6 +191,15 @@
my_clang := true
endif
endif
+# Add option to make clang the default for device build
+else ifeq ($(USE_CLANG_PLATFORM_BUILD),true)
+ ifeq ($(my_clang),)
+ my_clang := true
+ endif
+endif
+
+ifeq ($(strip $($(LOCAL_2ND_ARCH_VAR_PREFIX)WITHOUT_$(my_prefix)CLANG)),true)
+ my_clang :=
endif
my_cpp_std_version := -std=gnu++14
@@ -209,12 +218,6 @@
my_cppflags := $(my_cpp_std_version) $(my_cppflags)
-# Add option to make clang the default for device build
-ifeq ($(USE_CLANG_PLATFORM_BUILD),true)
- ifeq ($(my_clang),)
- my_clang := true
- endif
-endif
# arch-specific static libraries go first so that generic ones can depend on them
my_static_libraries := $(LOCAL_STATIC_LIBRARIES_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) $(LOCAL_STATIC_LIBRARIES_$(my_32_64_bit_suffix)) $(my_static_libraries)
@@ -235,10 +238,6 @@
include $(BUILD_SYSTEM)/config_sanitizers.mk
-ifeq ($(strip $($(LOCAL_2ND_ARCH_VAR_PREFIX)WITHOUT_$(my_prefix)CLANG)),true)
- my_clang :=
-endif
-
# Add in libcompiler_rt for all regular device builds
ifeq (,$(LOCAL_SDK_VERSION)$(WITHOUT_LIBCOMPILER_RT))
my_static_libraries += $(COMPILER_RT_CONFIG_EXTRA_STATIC_LIBRARIES)
diff --git a/core/combo/HOST_CROSS_windows-x86.mk b/core/combo/HOST_CROSS_windows-x86.mk
index e4d8593..f509594 100644
--- a/core/combo/HOST_CROSS_windows-x86.mk
+++ b/core/combo/HOST_CROSS_windows-x86.mk
@@ -33,15 +33,15 @@
# Use C99-compliant printf functions (%zd).
$(combo_var_prefix)GLOBAL_CFLAGS += -D__USE_MINGW_ANSI_STDIO=1
# Admit to using >= Win2K.
-$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -D_WIN32_WINNT=0x0500
+$(combo_var_prefix)GLOBAL_CFLAGS += -D_WIN32_WINNT=0x0500
# Get 64-bit off_t and related functions.
-$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -D_FILE_OFFSET_BITS=64
+$(combo_var_prefix)GLOBAL_CFLAGS += -D_FILE_OFFSET_BITS=64
$(combo_var_prefix)CC := $(TOOLS_PREFIX)gcc
$(combo_var_prefix)CXX := $(TOOLS_PREFIX)g++
$(combo_var_prefix)AR := $(TOOLS_PREFIX)ar
-$(combo_var_prefix)HOST_GLOBAL_LDFLAGS += \
+$(combo_var_prefix)GLOBAL_LDFLAGS += \
--enable-stdcall-fixup
ifneq ($(strip $(BUILD_HOST_static)),)