Commit 976a9025 authored by lrn@chromium.org's avatar lrn@chromium.org

Fix .gyp file and avoid adding -m32 on 32 bit systems.

Fix SConstruct to only add -m32 if the compiler needs it.

Review URL: http://codereview.chromium.org/100160


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1820 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 774d0d50
......@@ -35,6 +35,7 @@ root_dir = dirname(File('SConstruct').rfile().abspath)
sys.path.append(join(root_dir, 'tools'))
import js2c, utils
# ANDROID_TOP is the top of the Android checkout, fetched from the environment
# variable 'TOP'. You will also need to set the CXX, CC, AR and RANLIB
# environment variables to the cross-compiling tools.
......@@ -132,23 +133,29 @@ LIBRARY_FLAGS = {
'CPPPATH': ANDROID_INCLUDES,
},
'wordsize:32': {
'CCFLAGS': ['-m32'],
'CPPDEFINES': ['ILP32'],
'LINKFLAGS': ['-m32']
'arch:x64': {
'CCFLAGS': ['-m64'],
'LINKFLAGS': ['-m64']
}
},
'wordsize:64': {
'CCFLAGS': ['-m64'],
'CPPDEFINES': ['LP64'],
'LINKFLAGS': ['-m64']
'arch:ia32': {
'CCFLAGS': ['-m32'],
'LINKFLAGS': ['-m32']
},
'arch:arm': {
'CCFLAGS': ['-m32'],
'LINKFLAGS': ['-m32']
}
},
'arch:ia32': {
'CPPDEFINES': ['V8_ARCH_IA32']
'CPPDEFINES': ['V8_ARCH_IA32', 'ILP32']
},
'arch:arm': {
'CPPDEFINES': ['V8_ARCH_ARM']
'CPPDEFINES': ['V8_ARCH_ARM', 'ILP32']
},
'arch:x64': {
'CPPDEFINES': ['V8_ARCH_X64']
'CPPDEFINES': ['V8_ARCH_X64', 'LP64']
},
'prof:oprofile': {
'CPPDEFINES': ['ENABLE_OPROFILE_AGENT']
......@@ -311,15 +318,21 @@ CCTEST_EXTRA_FLAGS = {
}
},
'wordsize:32': {
'CCFLAGS': ['-m32'],
'CPPDEFINES': ['ILP32'],
'LINKFLAGS': ['-m32']
'arch:x64': {
'CCFLAGS': ['-m64'],
'LINKFLAGS': ['-m64']
}
},
'wordsize:64': {
'CCFLAGS': ['-m64'],
'CPPDEFINES': ['LP64'],
'LINKFLAGS': ['-m64']
},
'arch:ia32': {
'CCFLAGS': ['-m32'],
'LINKFLAGS': ['-m32']
},
'arch:arm': {
'CCFLAGS': ['-m32'],
'LINKFLAGS': ['-m32']
}
}
},
'msvc': {
'all': {
......@@ -368,14 +381,20 @@ SAMPLE_FLAGS = {
}
},
'wordsize:32': {
'CCFLAGS': ['-m32'],
'CPPDEFINES': ['ILP32'],
'LINKFLAGS': ['-m32']
'arch:x64': {
'CCFLAGS': ['-m64'],
'LINKFLAGS': ['-m64']
}
},
'wordsize:64': {
'CCFLAGS': ['-m64'],
'CPPDEFINES': ['LP64'],
'LINKFLAGS': ['-m64']
'arch:ia32': {
'CCFLAGS': ['-m32'],
'LINKFLAGS': ['-m32']
},
'arch:arm': {
'CCFLAGS': ['-m32'],
'LINKFLAGS': ['-m32']
}
},
'mode:release': {
'CCFLAGS': ['-O2']
......@@ -529,7 +548,7 @@ SIMPLE_OPTIONS = {
},
'wordsize': {
'values': ['64', '32'],
'default': '32', # WORDSIZE_GUESS,
'default': WORDSIZE_GUESS,
'help': 'the word size'
},
'simulator': {
......@@ -589,8 +608,8 @@ def VerifyOptions(env):
Abort("Profiling on windows only supported for static library.")
if env['prof'] == 'oprofile' and env['os'] != 'linux':
Abort("OProfile is only supported on Linux.")
if env['wordsize'] == '64' and (env['os'] != 'linux' or env['arch'] != 'x64'):
Abort("64 bit compilation only allowed on Linux OS and x64 architecture.")
if env['arch'] == 'x64' and env['os'] != 'linux':
Abort("X64 compilation only allowed on Linux OS.")
for (name, option) in SIMPLE_OPTIONS.iteritems():
if (not option.get('default')) and (name not in ARGUMENTS):
message = ("A value for option %s must be specified (%s)." %
......
......@@ -400,6 +400,9 @@
{
'target_name': 'v8_base',
'type': '<(library)',
'defines': [
'V8_ARCH_IA32'
],
'include_dirs+': [
'../../src',
'../../src/ia32',
......@@ -455,6 +458,9 @@
{
'target_name': 'v8_nosnapshot',
'type': '<(library)',
'defines': [
'V8_ARCH_IA32'
],
'dependencies': [
'js2c',
'v8_base',
......@@ -484,6 +490,9 @@
{
'target_name': 'v8',
'type': '<(library)',
'defines': [
'V8_ARCH_IA32'
],
'dependencies': [
'js2c',
'mksnapshot',
......@@ -521,6 +530,9 @@
{
'target_name': 'v8_shell',
'type': 'executable',
'defines': [
'V8_ARCH_IA32'
],
'dependencies': [
'v8',
],
......@@ -548,6 +560,9 @@
'd8_js2c',
'v8',
],
'defines': [
'V8_ARCH_IA32'
],
'include_dirs': [
'../../src',
],
......@@ -585,7 +600,7 @@
'js2c',
],
'defines': [
'ARM',
'V8_ARCH_ARM',
],
'include_dirs+': [
'../../src',
......@@ -643,7 +658,7 @@
'v8_arm',
],
'defines': [
'ARM',
'V8_ARCH_ARM',
],
'sources': [
'../../samples/shell.cc',
......@@ -663,7 +678,7 @@
'v8_arm',
],
'defines': [
'ARM',
'V8_ARCH_ARM',
],
'include_dirs': [
'../../src',
......
......@@ -2,7 +2,7 @@
<VisualStudioPropertySheet
ProjectType="Visual C++"
Version="8.00"
Name="arm"
Name="ia32"
>
<Tool
Name="VCCLCompilerTool"
......
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