Commit da52a841 authored by sgjesse@chromium.org's avatar sgjesse@chromium.org

Add a V8 specific target architecture to the GYP file

The V8 GYP file now uses its own target architecture. It default to the standard target_arch, but can be set to a separate value. E.g. using

  export GYP_DEFINES="target_arch=ia32 v8_target_arch=arm"

makes it possible to have the V8 ARM simulator be used in a IA32 build.

Added some checking of supported host/target architecture combinations.
Review URL: http://codereview.chromium.org/1790001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4490 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent a3b551ab
...@@ -50,15 +50,32 @@ namespace internal { ...@@ -50,15 +50,32 @@ namespace internal {
#define V8_HOST_ARCH_MIPS 1 #define V8_HOST_ARCH_MIPS 1
#define V8_HOST_ARCH_32_BIT 1 #define V8_HOST_ARCH_32_BIT 1
#else #else
#error Your host architecture was not detected as supported by v8 #error Host architecture was not detected as supported by v8
#endif #endif
// Check for supported combinations of host and target architectures.
#if defined(V8_TARGET_ARCH_IA32) && !defined(V8_HOST_ARCH_IA32)
#error Target architecture ia32 is only supported on ia32 host
#endif
#if defined(V8_TARGET_ARCH_X64) && !defined(V8_HOST_ARCH_X64)
#error Target architecture x64 is only supported on x64 host
#endif
#if (defined(V8_TARGET_ARCH_ARM) && \
!(defined(V8_HOST_ARCH_IA32) || defined(V8_HOST_ARCH_ARM)))
#error Target architecture arm is only supported on arm and ia32 host
#endif
#if (defined(V8_TARGET_ARCH_MIPS) && \
!(defined(V8_HOST_ARCH_IA32) || defined(V8_HOST_ARCH_MIPS)))
#error Target architecture mips is only supported on mips and ia32 host
#endif
// Define unaligned read for the target architectures supporting it.
#if defined(V8_TARGET_ARCH_X64) || defined(V8_TARGET_ARCH_IA32) #if defined(V8_TARGET_ARCH_X64) || defined(V8_TARGET_ARCH_IA32)
#define V8_TARGET_CAN_READ_UNALIGNED 1 #define V8_TARGET_CAN_READ_UNALIGNED 1
#elif V8_TARGET_ARCH_ARM #elif V8_TARGET_ARCH_ARM
#elif V8_TARGET_ARCH_MIPS #elif V8_TARGET_ARCH_MIPS
#else #else
#error Your target architecture is not supported by v8 #error Target architecture is not supported by v8
#endif #endif
// Support for alternative bool type. This is only enabled if the code is // Support for alternative bool type. This is only enabled if the code is
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
'variables': { 'variables': {
'msvs_use_common_release': 0, 'msvs_use_common_release': 0,
'gcc_version%': 'unknown', 'gcc_version%': 'unknown',
'target_arch%': 'ia32', 'v8_target_arch%': '<(target_arch)',
'v8_use_snapshot%': 'true', 'v8_use_snapshot%': 'true',
}, },
'target_defaults': { 'target_defaults': {
...@@ -39,17 +39,17 @@ ...@@ -39,17 +39,17 @@
'ENABLE_VMSTATE_TRACKING', 'ENABLE_VMSTATE_TRACKING',
], ],
'conditions': [ 'conditions': [
['target_arch=="arm"', { ['v8_target_arch=="arm"', {
'defines': [ 'defines': [
'V8_TARGET_ARCH_ARM', 'V8_TARGET_ARCH_ARM',
], ],
}], }],
['target_arch=="ia32"', { ['v8_target_arch=="ia32"', {
'defines': [ 'defines': [
'V8_TARGET_ARCH_IA32', 'V8_TARGET_ARCH_IA32',
], ],
}], }],
['target_arch=="x64"', { ['v8_target_arch=="x64"', {
'defines': [ 'defines': [
'V8_TARGET_ARCH_X64', 'V8_TARGET_ARCH_X64',
], ],
...@@ -204,7 +204,7 @@ ...@@ -204,7 +204,7 @@
'conditions': [ 'conditions': [
# The ARM assembler assumes the host is 32 bits, so force building # The ARM assembler assumes the host is 32 bits, so force building
# 32-bit host tools. # 32-bit host tools.
['target_arch=="arm" and host_arch=="x64" and _toolset=="host"', { ['v8_target_arch=="arm" and host_arch=="x64" and _toolset=="host"', {
'cflags': ['-m32'], 'cflags': ['-m32'],
'ldflags': ['-m32'], 'ldflags': ['-m32'],
}] }]
...@@ -264,8 +264,8 @@ ...@@ -264,8 +264,8 @@
'../../src/cpu-profiler-inl.h', '../../src/cpu-profiler-inl.h',
'../../src/cpu-profiler.cc', '../../src/cpu-profiler.cc',
'../../src/cpu-profiler.h', '../../src/cpu-profiler.h',
'../../src/data-flow.cc', '../../src/data-flow.cc',
'../../src/data-flow.h', '../../src/data-flow.h',
'../../src/dateparser.cc', '../../src/dateparser.cc',
'../../src/dateparser.h', '../../src/dateparser.h',
'../../src/dateparser-inl.h', '../../src/dateparser-inl.h',
...@@ -396,8 +396,8 @@ ...@@ -396,8 +396,8 @@
'../../src/token.h', '../../src/token.h',
'../../src/top.cc', '../../src/top.cc',
'../../src/top.h', '../../src/top.h',
'../../src/type-info.cc', '../../src/type-info.cc',
'../../src/type-info.h', '../../src/type-info.h',
'../../src/unicode-inl.h', '../../src/unicode-inl.h',
'../../src/unicode.cc', '../../src/unicode.cc',
'../../src/unicode.h', '../../src/unicode.h',
...@@ -424,7 +424,7 @@ ...@@ -424,7 +424,7 @@
'../../src/zone.h', '../../src/zone.h',
], ],
'conditions': [ 'conditions': [
['target_arch=="arm"', { ['v8_target_arch=="arm"', {
'include_dirs+': [ 'include_dirs+': [
'../../src/arm', '../../src/arm',
], ],
...@@ -470,7 +470,7 @@ ...@@ -470,7 +470,7 @@
}] }]
] ]
}], }],
['target_arch=="ia32"', { ['v8_target_arch=="ia32"', {
'include_dirs+': [ 'include_dirs+': [
'../../src/ia32', '../../src/ia32',
], ],
...@@ -505,7 +505,7 @@ ...@@ -505,7 +505,7 @@
'../../src/ia32/virtual-frame-ia32.h', '../../src/ia32/virtual-frame-ia32.h',
], ],
}], }],
['target_arch=="x64"', { ['v8_target_arch=="x64"', {
'include_dirs+': [ 'include_dirs+': [
'../../src/x64', '../../src/x64',
], ],
...@@ -656,7 +656,7 @@ ...@@ -656,7 +656,7 @@
'conditions': [ 'conditions': [
# The ARM assembler assumes the host is 32 bits, so force building # The ARM assembler assumes the host is 32 bits, so force building
# 32-bit host tools. # 32-bit host tools.
['target_arch=="arm" and host_arch=="x64" and _toolset=="host"', { ['v8_target_arch=="arm" and host_arch=="x64" and _toolset=="host"', {
'cflags': ['-m32'], 'cflags': ['-m32'],
'ldflags': ['-m32'], 'ldflags': ['-m32'],
}] }]
......
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