Add MIPS to v8 makefiles.
Provides Android build support for the working mips code already
in v8 3.9.x.
Change-Id: Id28d09a2a9f08535484fda9aabbb15b6a02690f2
Signed-off-by: Paul Lind <plind@mips.com>
diff --git a/Android.libv8.mk b/Android.libv8.mk
index 81d8296..cd32be6 100644
--- a/Android.libv8.mk
+++ b/Android.libv8.mk
@@ -6,6 +6,10 @@
include external/stlport/libstlport.mk
+ifeq ($(TARGET_ARCH),mips)
+ LOCAL_MIPS_MODE=mips
+endif
+
# Set up the target identity
LOCAL_MODULE := libv8
LOCAL_MODULE_CLASS := STATIC_LIBRARIES
@@ -92,6 +96,13 @@
LOCAL_CFLAGS += -DARM -DV8_TARGET_ARCH_ARM
endif
+ifeq ($(TARGET_ARCH),mips)
+ LOCAL_CFLAGS += -DV8_TARGET_ARCH_MIPS
+ LOCAL_CFLAGS += -Umips
+ LOCAL_CFLAGS += -finline-limit=64
+ LOCAL_CFLAGS += -fno-strict-aliasing
+endif
+
ifeq ($(TARGET_ARCH),x86)
LOCAL_CFLAGS += -DV8_TARGET_ARCH_IA32
endif
diff --git a/Android.mk b/Android.mk
index ff42934..c98c57c 100644
--- a/Android.mk
+++ b/Android.mk
@@ -24,7 +24,7 @@
endif
# Build libv8 and v8shell
-ifneq ($(filter $(TARGET_ARCH),x86 arm),)
+ifneq ($(filter $(TARGET_ARCH),x86 arm mips),)
ENABLE_V8_SNAPSHOT = true
include $(BASE_PATH)/Android.mksnapshot.mk
include $(BASE_PATH)/Android.libv8.mk
diff --git a/Android.mksnapshot.mk b/Android.mksnapshot.mk
index f73549b..9ab80b4 100644
--- a/Android.mksnapshot.mk
+++ b/Android.mksnapshot.mk
@@ -24,6 +24,11 @@
V8_LOCAL_SRC_FILES += src/arm/simulator-arm.cc
endif
+ifeq ($(TARGET_ARCH),mips)
+V8_LOCAL_SRC_FILES += src/mips/simulator-mips.cc
+
+endif
+
ifeq ($(HOST_ARCH),x86)
V8_LOCAL_SRC_FILES += src/atomicops_internals_x86_gcc.cc
endif
@@ -90,6 +95,14 @@
endif
endif
+ifeq ($(TARGET_ARCH),mips)
+ LOCAL_CFLAGS += -DV8_TARGET_ARCH_MIPS
+ LOCAL_CFLAGS += -DCAN_USE_FPU_INSTRUCTIONS
+ LOCAL_CFLAGS += -Umips
+ LOCAL_CFLAGS += -finline-limit=64
+ LOCAL_CFLAGS += -fno-strict-aliasing
+endif
+
ifeq ($(TARGET_ARCH),x86)
LOCAL_CFLAGS += -DV8_TARGET_ARCH_IA32
endif
diff --git a/Android.v8common.mk b/Android.v8common.mk
index 71ffe57..4c77a90 100644
--- a/Android.v8common.mk
+++ b/Android.v8common.mk
@@ -122,6 +122,28 @@
src/arm/stub-cache-arm.cc
endif
+ifeq ($(TARGET_ARCH),mips)
+ V8_LOCAL_SRC_FILES += \
+ src/mips/assembler-mips.cc \
+ src/mips/builtins-mips.cc \
+ src/mips/codegen-mips.cc \
+ src/mips/code-stubs-mips.cc \
+ src/mips/constants-mips.cc \
+ src/mips/cpu-mips.cc \
+ src/mips/debug-mips.cc \
+ src/mips/deoptimizer-mips.cc \
+ src/mips/disasm-mips.cc \
+ src/mips/frames-mips.cc \
+ src/mips/full-codegen-mips.cc \
+ src/mips/ic-mips.cc \
+ src/mips/lithium-mips.cc \
+ src/mips/lithium-codegen-mips.cc \
+ src/mips/lithium-gap-resolver-mips.cc \
+ src/mips/macro-assembler-mips.cc \
+ src/mips/regexp-macro-assembler-mips.cc \
+ src/mips/stub-cache-mips.cc
+endif
+
ifeq ($(TARGET_ARCH),x86)
V8_LOCAL_SRC_FILES += \
src/ia32/assembler-ia32.cc \