diff --git a/common.gypi b/common.gypi index e091082c9fe..6a35d2285b8 100644 --- a/common.gypi +++ b/common.gypi @@ -489,7 +489,12 @@ }], [ 'OS in "linux freebsd openbsd solaris android aix os400 cloudabi"', { 'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ], - 'cflags_cc': [ '-fno-rtti', '-fno-exceptions', '-std=gnu++20' ], + 'cflags_cc': [ + '-fno-rtti', + '-fno-exceptions', + '-fno-strict-aliasing', + '-std=gnu++20', + ], 'defines': [ '__STDC_FORMAT_MACROS' ], 'ldflags': [ '-rdynamic' ], 'target_conditions': [ @@ -620,12 +625,10 @@ 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings + 'GCC_STRICT_ALIASING': 'NO', # -fno-strict-aliasing 'PREBINDING': 'NO', # No -Wl,-prebind 'MACOSX_DEPLOYMENT_TARGET': '11.0', # -mmacosx-version-min=11.0 'USE_HEADERMAP': 'NO', - 'OTHER_CFLAGS': [ - '-fno-strict-aliasing', - ], 'WARNING_CFLAGS': [ '-Wall', '-Wendif-labels', diff --git a/configure.py b/configure.py index 22ea9d01512..a4222691cb4 100755 --- a/configure.py +++ b/configure.py @@ -1636,7 +1636,6 @@ def configure_v8(o, configs): o['variables']['v8_enable_javascript_promise_hooks'] = 1 o['variables']['v8_enable_lite_mode'] = 1 if options.v8_lite_mode else 0 o['variables']['v8_enable_gdbjit'] = 1 if options.gdb else 0 - o['variables']['v8_no_strict_aliasing'] = 1 # Work around compiler bugs. o['variables']['v8_optimized_debug'] = 0 if options.v8_non_optimized_debug else 1 o['variables']['dcheck_always_on'] = 1 if options.v8_with_dchecks else 0 o['variables']['v8_enable_object_print'] = 0 if options.v8_disable_object_print else 1 diff --git a/doc/api/process.md b/doc/api/process.md index 989b0b51355..72955500a9f 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -1101,7 +1101,6 @@ An example of the possible output looks like: node_shared_zlib: 'false', node_use_openssl: 'true', node_shared_openssl: 'false', - strict_aliasing: 'true', target_arch: 'x64', v8_use_snapshot: 1 } diff --git a/tools/v8_gypfiles/toolchain.gypi b/tools/v8_gypfiles/toolchain.gypi index 067673b9829..e75ccf52a57 100644 --- a/tools/v8_gypfiles/toolchain.gypi +++ b/tools/v8_gypfiles/toolchain.gypi @@ -69,9 +69,6 @@ # 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 gypfiles/standalone.gypi. 'want_separate_host_toolset%': 1, @@ -666,14 +663,6 @@ 'V8_ANDROID_LOG_STDOUT', ], }], - ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \ - or OS=="netbsd" or OS=="qnx" or OS=="aix" or OS=="os400"', { - 'conditions': [ - [ 'v8_no_strict_aliasing==1', { - 'cflags': [ '-fno-strict-aliasing' ], - }], - ], # conditions - }], ['OS=="solaris"', { 'defines': [ '__C99FEATURES__=1' ], # isinf() etc. }], @@ -830,7 +819,6 @@ ['OS=="mac"', { 'xcode_settings': { 'GCC_OPTIMIZATION_LEVEL': '3', # -O3 - 'GCC_STRICT_ALIASING': 'YES', }, }], ['v8_enable_slow_dchecks==1', { @@ -889,12 +877,6 @@ ['OS=="mac"', { 'xcode_settings': { 'GCC_OPTIMIZATION_LEVEL': '3', # -O3 - - # -fstrict-aliasing. Mainline gcc - # enables this at -O2 and above, - # but Apple gcc does not unless it - # is specified explicitly. - 'GCC_STRICT_ALIASING': 'YES', }, }], # OS=="mac" ['OS=="win"', {