Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Use -fno-strict-aliasing instead of -O1 for SmartOS

  • Loading branch information...
commit c98adce363bd2ccfd2469ca467801304374e1370 1 parent bab59f3
Isaac Z. Schlueter isaacs authored

Showing 2 changed files with 7 additions and 7 deletions. Show diff stats Hide diff stats

  1. +3 3 common.gypi
  2. +4 4 configure
6 common.gypi
@@ -38,11 +38,11 @@
38 38 [ 'OS!="solaris"', {
39 39 'cflags': [ '-O3','-fomit-frame-pointer', '-fdata-sections', '-ffunction-sections' ],
40 40 }],
41   - [ 'OS=="solaris" and gcc_optimize_level =="-O3"', {
  41 + [ 'OS=="solaris" and gcc_old =="no"', {
42 42 'cflags': [ '-O3', '-fdata-sections', '-ffunction-sections' ],
43 43 }],
44   - [ 'OS=="solaris" and gcc_optimize_level =="-O"', {
45   - 'cflags': [ '-O', '-fdata-sections', '-ffunction-sections' ], # For bug fix of #2830
  44 + [ 'OS=="solaris" and gcc_old =="yes"', {
  45 + 'cflags': [ '-O3', '-fno-strict-aliasing', '-fdata-sections', '-ffunction-sections' ],
46 46 }],
47 47 ['target_arch=="x64"', {
48 48 'msvs_configuration_platform': 'x64',
8 configure
@@ -200,7 +200,7 @@ def host_arch():
200 200 def target_arch():
201 201 return host_arch()
202 202
203   -def gcc_optimize_level():
  203 +def gcc_old():
204 204 cc = ['gcc']
205 205 cmd = cc + [ '-dumpversion' ]
206 206 p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
@@ -208,9 +208,9 @@ def gcc_optimize_level():
208 208 out = p.communicate()[0]
209 209 gcc_version = (str(out).split('\n'))[0]
210 210 if StrictVersion(gcc_version) >= '4.6.1':
211   - return '-O3'
  211 + return 'no'
212 212 else:
213   - return '-O'
  213 + return 'yes'
214 214
215 215 def configure_node(o):
216 216 # TODO add gdb
@@ -225,7 +225,7 @@ def configure_node(o):
225 225 # TODO move to node.gyp
226 226 if sys.platform == 'sunos5':
227 227 o['variables']['visibility'] = '' # FIXME -fvisibility=hidden, should be a gcc check
228   - o['variables']['gcc_optimize_level'] = gcc_optimize_level() # For bug fix of #2830
  228 + o['variables']['gcc_old'] = gcc_old() # For bug fix of #2830
229 229
230 230 def configure_libz(o):
231 231 o['variables']['node_shared_zlib'] = b(options.shared_zlib)

0 comments on commit c98adce

Please sign in to comment.
Something went wrong with that request. Please try again.