Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
build: compile with -fno-tree-vrp when gcc >= 4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bnoordhuis committed Aug 13, 2012
1 parent 9f26130 commit 100e163
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion common.gypi
Expand Up @@ -7,6 +7,8 @@
'library%': 'static_library', # allow override to 'shared_library' for DLL/.so builds
'component%': 'static_library', # NB. these names match with what V8 expects
'msvs_multi_core_compile': '0', # we do enable multicore compiles, but not using the V8 way
'gcc_version%': 'unknown',
'clang%': 0,

# Turn on optimizations that may trigger compiler bugs.
# Use at your own risk. Do *NOT* report bugs if this option is enabled.
Expand Down Expand Up @@ -53,7 +55,7 @@
'cflags': [ '-O3', '-ffunction-sections', '-fdata-sections' ],
'ldflags': [ '-Wl,--gc-sections' ],
}, {
'cflags': [ '-O2', '-fno-strict-aliasing', '-fno-tree-vrp' ],
'cflags': [ '-O2', '-fno-strict-aliasing' ],
'cflags!': [ '-O3', '-fstrict-aliasing' ],
'conditions': [
# Required by the dtrace post-processor. Unfortunately,
Expand All @@ -64,6 +66,9 @@
}, {
'cflags!': [ '-ffunction-sections', '-fdata-sections' ],
}],
['clang==1 or gcc_version >= 40', {
'cflags': [ '-fno-tree-vrp' ],
}],
],
}],
['OS=="solaris"', {
Expand Down
7 changes: 6 additions & 1 deletion configure
Expand Up @@ -339,8 +339,13 @@ def configure_node(o):
o['variables']['v8_use_arm_eabi_hardfloat'] = b(hard_float)
o['variables']['armv7'] = 1 if is_arch_armv7() else 0

# clang has always supported -fvisibility=hidden, right?
cc_version, is_clang = compiler_version()
o['variables']['clang'] = 1 if is_clang else 0

if not is_clang:
o['variables']['gcc_version'] = 10 * cc_version[0] + cc_version[1]

# clang has always supported -fvisibility=hidden, right?
if not is_clang and cc_version < (4,0,0):
o['variables']['visibility'] = ''

Expand Down

0 comments on commit 100e163

Please sign in to comment.