Skip to content

Commit

Permalink
Use -fno-strict-aliasing instead of -O1 for SmartOS
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Feb 29, 2012
1 parent bab59f3 commit c98adce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@
[ 'OS!="solaris"', {
'cflags': [ '-O3','-fomit-frame-pointer', '-fdata-sections', '-ffunction-sections' ],
}],
[ 'OS=="solaris" and gcc_optimize_level =="-O3"', {
[ 'OS=="solaris" and gcc_old =="no"', {
'cflags': [ '-O3', '-fdata-sections', '-ffunction-sections' ],
}],
[ 'OS=="solaris" and gcc_optimize_level =="-O"', {
'cflags': [ '-O', '-fdata-sections', '-ffunction-sections' ], # For bug fix of #2830
[ 'OS=="solaris" and gcc_old =="yes"', {
'cflags': [ '-O3', '-fno-strict-aliasing', '-fdata-sections', '-ffunction-sections' ],
}],
['target_arch=="x64"', {
'msvs_configuration_platform': 'x64',
Expand Down
8 changes: 4 additions & 4 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -200,17 +200,17 @@ def host_arch():
def target_arch():
return host_arch()

def gcc_optimize_level():
def gcc_old():
cc = ['gcc']
cmd = cc + [ '-dumpversion' ]
p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
p.stdin.write('\n')
out = p.communicate()[0]
gcc_version = (str(out).split('\n'))[0]
if StrictVersion(gcc_version) >= '4.6.1':
return '-O3'
return 'no'
else:
return '-O'
return 'yes'

def configure_node(o):
# TODO add gdb
Expand All @@ -225,7 +225,7 @@ def configure_node(o):
# TODO move to node.gyp
if sys.platform == 'sunos5':
o['variables']['visibility'] = '' # FIXME -fvisibility=hidden, should be a gcc check
o['variables']['gcc_optimize_level'] = gcc_optimize_level() # For bug fix of #2830
o['variables']['gcc_old'] = gcc_old() # For bug fix of #2830

def configure_libz(o):
o['variables']['node_shared_zlib'] = b(options.shared_zlib)
Expand Down

0 comments on commit c98adce

Please sign in to comment.