Fix windows build for compiler-rt.
Bug: 14416410
Don't build enable_execute_stack.c on Windows, since it can't be used.
Remove unnecessary linker options for Windows.
Change-Id: I775057bfd8a24912ff57e118fbbd2c12a9233827
diff --git a/Android.mk b/Android.mk
index b7289a4..2aef29e 100644
--- a/Android.mk
+++ b/Android.mk
@@ -59,7 +59,6 @@
lib/builtins/divsi3.c \
lib/builtins/divti3.c \
lib/builtins/divxc3.c \
- lib/builtins/enable_execute_stack.c \
lib/builtins/eprintf.c \
lib/builtins/extendsfdf2.c \
lib/builtins/ffsdi2.c \
@@ -154,6 +153,12 @@
lib/builtins/umodsi3.c \
lib/builtins/umodti3.c
+# Only build enable_execute_stack.c on non-Windows hosts.
+ifneq ($(HOST_OS),windows)
+libcompiler_rt_common_SRC_FILES += \
+ lib/builtins/enable_execute_stack.c
+endif
+
# ARM-specific runtimes
libcompiler_rt_arm_SRC_FILES := \
lib/builtins/arm/aeabi_dcmp.S \
@@ -384,8 +389,10 @@
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_WHOLE_STATIC_LIBRARIES := libcompiler_rt
LOCAL_CPPFLAGS := -nostdinc++
+ifneq ($(HOST_OS),windows)
LOCAL_LDFLAGS := -nodefaultlibs
LOCAL_LDLIBS := -lc -lm
+endif
LOCAL_MULTILIB := both
include $(BUILD_HOST_SHARED_LIBRARY)