From 1b7f24e9c8d6210b753cdec71736be208f2ade27 Mon Sep 17 00:00:00 2001 From: "jkummerow@chromium.org" Date: Wed, 9 Nov 2011 15:31:54 +0000 Subject: [PATCH] MIPS: Initial gyp infrastructure for MIPS architecture. BUG= TEST= Review URL: http://codereview.chromium.org/8505007 Patch from Gergely Kis . git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9940 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- build/common.gypi | 33 +++++++++++++++++++++++++++++++++ build/gyp_v8 | 5 +++++ build/mipsu.gypi | 33 +++++++++++++++++++++++++++++++++ build/standalone.gypi | 3 ++- tools/gyp/v8.gyp | 34 ++++++++++++++++++++++++++++++++++ 5 files changed, 107 insertions(+), 1 deletion(-) create mode 100644 build/mipsu.gypi diff --git a/build/common.gypi b/build/common.gypi index 230b1fd..1597644 100644 --- a/build/common.gypi +++ b/build/common.gypi @@ -50,12 +50,18 @@ # probing when running on the target. '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 # EABI calling convention where double arguments are passed in VFP # registers. Note that the GCC flag '-mfloat-abi=hard' should be used as # well when compiling for the ARM target. '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_disassembler%': 0, @@ -154,6 +160,33 @@ 'defines': [ '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"', { 'defines': [ diff --git a/build/gyp_v8 b/build/gyp_v8 index dfdbe3f..4293e76 100755 --- a/build/gyp_v8 +++ b/build/gyp_v8 @@ -171,3 +171,8 @@ if __name__ == '__main__': gyp_args.append('-I' + v8_root + '/build/armu.gypi') gyp_args.append('-S-armu') 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) diff --git a/build/mipsu.gypi b/build/mipsu.gypi new file mode 100644 index 0000000..8dfea74 --- /dev/null +++ b/build/mipsu.gypi @@ -0,0 +1,33 @@ +# 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', + }, +} diff --git a/build/standalone.gypi b/build/standalone.gypi index f24d9f8..4297f5c 100644 --- a/build/standalone.gypi +++ b/build/standalone.gypi @@ -42,7 +42,7 @@ # else gets passed through, which probably won't work very well; such # hosts should pass an explicit target_arch to gyp. 'host_arch%': - '