Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: always disable strict aliasing #54339

Merged
merged 1 commit into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -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': [
Expand Down Expand Up @@ -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',
Expand Down
1 change: 0 additions & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion doc/api/process.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
18 changes: 0 additions & 18 deletions tools/v8_gypfiles/toolchain.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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.
}],
Expand Down Expand Up @@ -830,7 +819,6 @@
['OS=="mac"', {
'xcode_settings': {
'GCC_OPTIMIZATION_LEVEL': '3', # -O3
'GCC_STRICT_ALIASING': 'YES',
},
}],
['v8_enable_slow_dchecks==1', {
Expand Down Expand Up @@ -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"', {
Expand Down
Loading