Land patch from Craig Schlenter to make V8 build and run when compiled
authorager@chromium.org <ager@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 22 May 2009 06:52:02 +0000 (06:52 +0000)
committerager@chromium.org <ager@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 22 May 2009 06:52:02 +0000 (06:52 +0000)
with -O3 on gcc 4.4.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2026 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

AUTHORS
SConstruct
tools/gyp/v8.gyp

diff --git a/AUTHORS b/AUTHORS
index 060393f..186a038 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -13,3 +13,4 @@ Paolo Giarrusso <p.giarrusso@gmail.com>
 Daniel Andersson <kodandersson@gmail.com>
 Alexander Botero-Lowry <alexbl@FreeBSD.org>
 Matt Hanselman <mjhanselman@gmail.com>
+Craig Schlenter <craig.schlenter@gmail.com>
index 83b36c8..a183caf 100644 (file)
@@ -43,6 +43,16 @@ ANDROID_TOP = os.environ.get('TOP')
 if ANDROID_TOP is None:
   ANDROID_TOP=""
 
+# TODO: Sort these issues out properly but as a temporary solution for gcc 4.4
+# on linux we need these compiler flags to avoid a mksnapshot segfault, avoid
+# crashes in the v8 test suite and avoid dtoa.c strict aliasing issues
+if os.environ.get('GCC_VERSION') == "44":
+    GCC_EXTRA_CCFLAGS = ['-fno-tree-vectorize', '-fno-tree-vrp']
+    GCC_DTOA_EXTRA_CCFLAGS = ['-fno-strict-aliasing']
+else:
+    GCC_EXTRA_CCFLAGS = []
+    GCC_DTOA_EXTRA_CCFLAGS = []
+
 ANDROID_FLAGS = ['-march=armv5te',
                  '-mtune=xscale',
                  '-msoft-float',
@@ -109,7 +119,7 @@ LIBRARY_FLAGS = {
       }
     },
     'os:linux': {
-      'CCFLAGS':      ['-ansi'],
+      'CCFLAGS':      ['-ansi'] + GCC_EXTRA_CCFLAGS,
       'library:shared': {
         'LIBS': ['pthread']
       }
@@ -278,7 +288,8 @@ MKSNAPSHOT_EXTRA_FLAGS = {
 DTOA_EXTRA_FLAGS = {
   'gcc': {
     'all': {
-      'WARNINGFLAGS': ['-Werror', '-Wno-uninitialized']
+      'WARNINGFLAGS': ['-Werror', '-Wno-uninitialized'],
+      'CCFLAGS': GCC_DTOA_EXTRA_CCFLAGS
     }
   },
   'msvc': {
index 1bae68b..050cb95 100644 (file)
@@ -29,6 +29,7 @@
   'variables': {
     'chromium_code': 1,
     'msvs_use_common_release': 0,
+    'gcc_version%': 'unknown',
     'base_source_files': [
       '../../src/arm/assembler-arm-inl.h',
       '../../src/arm/assembler-arm.cc',
               '-fomit-frame-pointer',
               '-O3',
             ],
+            'conditions': [
+              [ 'gcc_version=="44"', {
+                'cflags': [
+                    # Avoid gcc 4.4 strict aliasing issues in dtoa.c
+                    '-fno-strict-aliasing',
+                    # Avoid gcc 4.4 mksnapshot segfault.
+                    '-fno-tree-vectorize',
+                    # Avoid crashes with gcc 4.4 in the v8 test suite.
+                    '-fno-tree-vrp',
+                ],
+              }],
+            ],
             'cflags_cc': [
               '-fno-rtti',
             ],