Skip to content

Commit c640a2f

Browse files
targosRafaelGSS
authored andcommitted
build: always disable strict aliasing
V8 relies on it. PR-URL: #54339 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent df428ad commit c640a2f

File tree

4 files changed

+7
-24
lines changed

4 files changed

+7
-24
lines changed

Diff for: common.gypi

+7-4
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,12 @@
489489
}],
490490
[ 'OS in "linux freebsd openbsd solaris android aix os400 cloudabi"', {
491491
'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ],
492-
'cflags_cc': [ '-fno-rtti', '-fno-exceptions', '-std=gnu++17' ],
492+
'cflags_cc': [
493+
'-fno-rtti',
494+
'-fno-exceptions',
495+
'-fno-strict-aliasing',
496+
'-std=gnu++17',
497+
],
493498
'defines': [ '__STDC_FORMAT_MACROS' ],
494499
'ldflags': [ '-rdynamic' ],
495500
'target_conditions': [
@@ -620,12 +625,10 @@
620625
'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
621626
'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
622627
'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
628+
'GCC_STRICT_ALIASING': 'NO', # -fno-strict-aliasing
623629
'PREBINDING': 'NO', # No -Wl,-prebind
624630
'MACOSX_DEPLOYMENT_TARGET': '11.0', # -mmacosx-version-min=11.0
625631
'USE_HEADERMAP': 'NO',
626-
'OTHER_CFLAGS': [
627-
'-fno-strict-aliasing',
628-
],
629632
'WARNING_CFLAGS': [
630633
'-Wall',
631634
'-Wendif-labels',

Diff for: configure.py

-1
Original file line numberDiff line numberDiff line change
@@ -1637,7 +1637,6 @@ def configure_v8(o, configs):
16371637
o['variables']['v8_enable_javascript_promise_hooks'] = 1
16381638
o['variables']['v8_enable_lite_mode'] = 1 if options.v8_lite_mode else 0
16391639
o['variables']['v8_enable_gdbjit'] = 1 if options.gdb else 0
1640-
o['variables']['v8_no_strict_aliasing'] = 1 # Work around compiler bugs.
16411640
o['variables']['v8_optimized_debug'] = 0 if options.v8_non_optimized_debug else 1
16421641
o['variables']['dcheck_always_on'] = 1 if options.v8_with_dchecks else 0
16431642
o['variables']['v8_enable_object_print'] = 0 if options.v8_disable_object_print else 1

Diff for: doc/api/process.md

-1
Original file line numberDiff line numberDiff line change
@@ -1097,7 +1097,6 @@ An example of the possible output looks like:
10971097
node_shared_zlib: 'false',
10981098
node_use_openssl: 'true',
10991099
node_shared_openssl: 'false',
1100-
strict_aliasing: 'true',
11011100
target_arch: 'x64',
11021101
v8_use_snapshot: 1
11031102
}

Diff for: tools/v8_gypfiles/toolchain.gypi

-18
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,6 @@
6969
# Enable profiling support. Only required on Windows.
7070
'v8_enable_prof%': 0,
7171

72-
# Some versions of GCC 4.5 seem to need -fno-strict-aliasing.
73-
'v8_no_strict_aliasing%': 0,
74-
7572
# Chrome needs this definition unconditionally. For standalone V8 builds,
7673
# it's handled in gypfiles/standalone.gypi.
7774
'want_separate_host_toolset%': 1,
@@ -674,14 +671,6 @@
674671
'V8_ANDROID_LOG_STDOUT',
675672
],
676673
}],
677-
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \
678-
or OS=="netbsd" or OS=="qnx" or OS=="aix" or OS=="os400"', {
679-
'conditions': [
680-
[ 'v8_no_strict_aliasing==1', {
681-
'cflags': [ '-fno-strict-aliasing' ],
682-
}],
683-
], # conditions
684-
}],
685674
['OS=="solaris"', {
686675
'defines': [ '__C99FEATURES__=1' ], # isinf() etc.
687676
}],
@@ -838,7 +827,6 @@
838827
['OS=="mac"', {
839828
'xcode_settings': {
840829
'GCC_OPTIMIZATION_LEVEL': '3', # -O3
841-
'GCC_STRICT_ALIASING': 'YES',
842830
},
843831
}],
844832
['v8_enable_slow_dchecks==1', {
@@ -897,12 +885,6 @@
897885
['OS=="mac"', {
898886
'xcode_settings': {
899887
'GCC_OPTIMIZATION_LEVEL': '3', # -O3
900-
901-
# -fstrict-aliasing. Mainline gcc
902-
# enables this at -O2 and above,
903-
# but Apple gcc does not unless it
904-
# is specified explicitly.
905-
'GCC_STRICT_ALIASING': 'YES',
906888
},
907889
}], # OS=="mac"
908890
['OS=="win"', {

0 commit comments

Comments
 (0)