From 001dea475f2c6cbe535ba7a18f9085fa6990f778 Mon Sep 17 00:00:00 2001 From: "jkummerow@chromium.org" Date: Wed, 18 Jan 2012 10:17:03 +0000 Subject: [PATCH] Provide a switch to specify -fno-strict-aliasing BUG=v8:1887 Review URL: https://chromiumcodereview.appspot.com/9231019 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10427 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- Makefile | 4 ++++ build/common.gypi | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 833c875..73e8421 100644 --- a/Makefile +++ b/Makefile @@ -87,6 +87,10 @@ endif ifeq ($(presubmit), no) TESTFLAGS += --no-presubmit endif +# strictaliasing=off (workaround for GCC-4.5) +ifeq ($(strictaliasing), off) + GYPFLAGS += -Dv8_no_strict_aliasing=1 +endif # ----------------- available targets: -------------------- # - "dependencies": pulls in external dependencies (currently: GYP) diff --git a/build/common.gypi b/build/common.gypi index e372af6..c1c2b42 100644 --- a/build/common.gypi +++ b/build/common.gypi @@ -73,6 +73,9 @@ # Enable profiling support. Only required on Windows. 'v8_enable_prof%': 0, + # Some versions of GCC 4.5 seem to need -fno-strict-aliasing. + 'v8_no_strict_aliasing%': 0, + # Chrome needs this definition unconditionally. For standalone V8 builds, # it's handled in build/standalone.gypi. 'want_separate_host_toolset%': 1, @@ -227,7 +230,10 @@ 'cflags': [ '-m32' ], 'ldflags': [ '-m32' ], }], - ], + [ 'v8_no_strict_aliasing==1', { + 'cflags': [ '-fno-strict-aliasing' ], + }], + ], # conditions }], ['OS=="solaris"', { 'defines': [ '__C99FEATURES__=1' ], # isinf() etc. -- 2.7.4