Author: [email protected]
Date: Wed Apr 29 08:20:37 2009
New Revision: 1820

Modified:
    branches/bleeding_edge/SConstruct
    branches/bleeding_edge/tools/gyp/v8.gyp
    branches/bleeding_edge/tools/visual_studio/ia32.vsprops

Log:
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


Modified: branches/bleeding_edge/SConstruct
==============================================================================
--- branches/bleeding_edge/SConstruct   (original)
+++ branches/bleeding_edge/SConstruct   Wed Apr 29 08:20:37 2009
@@ -35,6 +35,7 @@
  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 @@
        '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 @@
        }
      },
      '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 @@
        }
      },
      '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 @@
    },
    'wordsize': {
      'values': ['64', '32'],
-    'default': '32',   # WORDSIZE_GUESS,
+    'default': WORDSIZE_GUESS,
      'help': 'the word size'
    },
    'simulator': {
@@ -589,8 +608,8 @@
      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)." %

Modified: branches/bleeding_edge/tools/gyp/v8.gyp
==============================================================================
--- branches/bleeding_edge/tools/gyp/v8.gyp     (original)
+++ branches/bleeding_edge/tools/gyp/v8.gyp     Wed Apr 29 08:20:37 2009
@@ -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',

Modified: branches/bleeding_edge/tools/visual_studio/ia32.vsprops
==============================================================================
--- branches/bleeding_edge/tools/visual_studio/ia32.vsprops     (original)
+++ branches/bleeding_edge/tools/visual_studio/ia32.vsprops     Wed Apr 29  
08:20:37 2009
@@ -2,7 +2,7 @@
  <VisualStudioPropertySheet
        ProjectType="Visual C++"
        Version="8.00"
-       Name="arm"
+       Name="ia32"
        >
        <Tool
                Name="VCCLCompilerTool"

--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to