diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2012-03-02 05:14:27 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2012-03-02 21:26:35 +0400 |
commit | 30b29d8f8745263475d67576c4b81ff164482676 (patch) | |
tree | b036ffb5b1f418fe17c3d9d4e34bcb741515c5d2 /common.gypi | |
parent | 0613af0a20cdc845a0a9a1971d93e6e66ddd7268 (diff) |
build: disable -fstrict-aliasing if gcc < 4.6.0
A compiler bug in older versions of gcc makes it do unsafe optimizations at -O1
and higher. This manifested itself with (at least) gcc 4.5.2 on SmartOS because
it made V8 hang in a busy loop.
See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45883
Diffstat (limited to 'common.gypi')
-rw-r--r-- | common.gypi | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/common.gypi b/common.gypi index 699230ac337..6e13b6091ad 100644 --- a/common.gypi +++ b/common.gypi @@ -1,5 +1,6 @@ { 'variables': { + 'strict_aliasing%': 'false', # turn on/off -fstrict-aliasing 'visibility%': 'hidden', # V8's visibility setting 'target_arch%': 'ia32', # set v8's target architecture 'host_arch%': 'ia32', # set v8's host architecture @@ -34,19 +35,17 @@ }, }, 'Release': { + 'cflags': [ '-O3', '-fdata-sections', '-ffunction-sections' ], 'conditions': [ - [ 'OS!="solaris"', { - 'cflags': [ '-O3','-fomit-frame-pointer', '-fdata-sections', '-ffunction-sections' ], - }], - [ 'OS=="solaris" and gcc_optimize_level =="-O3"', { - 'cflags': [ '-O3', '-fdata-sections', '-ffunction-sections' ], - }], - [ 'OS=="solaris" and gcc_optimize_level =="-O"', { - 'cflags': [ '-O', '-fdata-sections', '-ffunction-sections' ], # For bug fix of #2830 - }], ['target_arch=="x64"', { 'msvs_configuration_platform': 'x64', }], + ['OS=="solaris"', { + 'cflags': [ '-fno-omit-frame-pointer' ], + }], + ['strict_aliasing!="true"', { + 'cflags': [ '-fno-strict-aliasing' ], + }], ], 'msvs_settings': { 'VCCLCompilerTool': { |