MIPS: Initial gyp infrastructure for MIPS architecture.

BUG=
TEST=

Review URL: http://codereview.chromium.org/8505007
Patch from Gergely Kis <gergely@homejinni.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9940 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 8dcfcdd7
...@@ -50,12 +50,18 @@ ...@@ -50,12 +50,18 @@
# probing when running on the target. # probing when running on the target.
'v8_can_use_vfp_instructions%': 'false', 'v8_can_use_vfp_instructions%': 'false',
# Similar to vfp but on MIPS.
'v8_can_use_fpu_instructions%': 'true',
# Setting v8_use_arm_eabi_hardfloat to true will turn on V8 support for ARM # Setting v8_use_arm_eabi_hardfloat to true will turn on V8 support for ARM
# EABI calling convention where double arguments are passed in VFP # EABI calling convention where double arguments are passed in VFP
# registers. Note that the GCC flag '-mfloat-abi=hard' should be used as # registers. Note that the GCC flag '-mfloat-abi=hard' should be used as
# well when compiling for the ARM target. # well when compiling for the ARM target.
'v8_use_arm_eabi_hardfloat%': 'false', 'v8_use_arm_eabi_hardfloat%': 'false',
# Similar to the ARM hard float ABI but on MIPS.
'v8_use_mips_abi_hardfloat%': 'true',
'v8_enable_debugger_support%': 1, 'v8_enable_debugger_support%': 1,
'v8_enable_disassembler%': 0, 'v8_enable_disassembler%': 0,
...@@ -154,6 +160,33 @@ ...@@ -154,6 +160,33 @@
'defines': [ 'defines': [
'V8_TARGET_ARCH_MIPS', 'V8_TARGET_ARCH_MIPS',
], ],
'conditions': [
[ 'v8_can_use_fpu_instructions=="true"', {
'defines': [
'CAN_USE_FPU_INSTRUCTIONS',
],
}],
[ 'v8_use_mips_abi_hardfloat=="true"', {
'defines': [
'__mips_hard_float=1',
'CAN_USE_FPU_INSTRUCTIONS',
],
}, {
'defines': [
'__mips_soft_float=1'
],
}],
# The MIPS assembler assumes the host is 32 bits,
# so force building 32-bit host tools.
['host_arch=="x64"', {
'target_conditions': [
['_toolset=="host"', {
'cflags': ['-m32'],
'ldflags': ['-m32'],
}],
],
}],
],
}], }],
['v8_target_arch=="x64"', { ['v8_target_arch=="x64"', {
'defines': [ 'defines': [
......
...@@ -171,3 +171,8 @@ if __name__ == '__main__': ...@@ -171,3 +171,8 @@ if __name__ == '__main__':
gyp_args.append('-I' + v8_root + '/build/armu.gypi') gyp_args.append('-I' + v8_root + '/build/armu.gypi')
gyp_args.append('-S-armu') gyp_args.append('-S-armu')
run_gyp(gyp_args) run_gyp(gyp_args)
gyp_args = list(args)
gyp_args.append('-I' + v8_root + '/build/mipsu.gypi')
gyp_args.append('-S-mipsu')
run_gyp(gyp_args)
# Copyright 2011 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
{
'variables': {
'target_arch': 'ia32',
'v8_target_arch': 'mips',
},
}
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
# else gets passed through, which probably won't work very well; such # else gets passed through, which probably won't work very well; such
# hosts should pass an explicit target_arch to gyp. # hosts should pass an explicit target_arch to gyp.
'host_arch%': 'host_arch%':
'<!(uname -m | sed -e "s/i.86/ia32/;s/x86_64/x64/;s/amd64/x64/;s/arm.*/arm/")', '<!(uname -m | sed -e "s/i.86/ia32/;s/x86_64/x64/;s/amd64/x64/;s/arm.*/arm/;s/mips.*/mips/")',
}, { # OS!="linux" and OS!="freebsd" and OS!="openbsd" }, { # OS!="linux" and OS!="freebsd" and OS!="openbsd"
'host_arch%': 'ia32', 'host_arch%': 'ia32',
}], }],
...@@ -61,6 +61,7 @@ ...@@ -61,6 +61,7 @@
'werror%': '-Werror', 'werror%': '-Werror',
'conditions': [ 'conditions': [
['(v8_target_arch=="arm" and host_arch!="arm") or \ ['(v8_target_arch=="arm" and host_arch!="arm") or \
(v8_target_arch=="mips" and host_arch!="mips") or \
(v8_target_arch=="x64" and host_arch!="x64")', { (v8_target_arch=="x64" and host_arch!="x64")', {
'want_separate_host_toolset': 1, 'want_separate_host_toolset': 1,
}, { }, {
......
...@@ -559,6 +559,40 @@ ...@@ -559,6 +559,40 @@
'../../src/ia32/stub-cache-ia32.cc', '../../src/ia32/stub-cache-ia32.cc',
], ],
}], }],
['v8_target_arch=="mips"', {
'sources': [
'../../src/mips/assembler-mips.cc',
'../../src/mips/assembler-mips.h',
'../../src/mips/assembler-mips-inl.h',
'../../src/mips/builtins-mips.cc',
'../../src/mips/codegen-mips.cc',
'../../src/mips/codegen-mips.h',
'../../src/mips/code-stubs-mips.cc',
'../../src/mips/code-stubs-mips.h',
'../../src/mips/constants-mips.cc',
'../../src/mips/constants-mips.h',
'../../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/frames-mips.h',
'../../src/mips/full-codegen-mips.cc',
'../../src/mips/ic-mips.cc',
'../../src/mips/lithium-codegen-mips.cc',
'../../src/mips/lithium-codegen-mips.h',
'../../src/mips/lithium-gap-resolver-mips.cc',
'../../src/mips/lithium-gap-resolver-mips.h',
'../../src/mips/lithium-mips.cc',
'../../src/mips/lithium-mips.h',
'../../src/mips/macro-assembler-mips.cc',
'../../src/mips/macro-assembler-mips.h',
'../../src/mips/regexp-macro-assembler-mips.cc',
'../../src/mips/regexp-macro-assembler-mips.h',
'../../src/mips/simulator-mips.cc',
'../../src/mips/stub-cache-mips.cc',
],
}],
['v8_target_arch=="x64" or v8_target_arch=="mac" or OS=="mac"', { ['v8_target_arch=="x64" or v8_target_arch=="mac" or OS=="mac"', {
'sources': [ 'sources': [
'../../src/x64/assembler-x64-inl.h', '../../src/x64/assembler-x64-inl.h',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment