Skip to content

Commit 4573231

Browse files
committed
build: sync V8 warning cflags with BUILD.gn
PR-URL: #52873 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Mohammed Keyvanzadeh <[email protected]>
1 parent 6e0a2bb commit 4573231

File tree

3 files changed

+12
-15
lines changed

3 files changed

+12
-15
lines changed

common.gypi

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
'configuring_node%': 0,
44
'asan%': 0,
55
'ubsan%': 0,
6-
'werror': '', # Turn off -Werror in V8 build.
76
'visibility%': 'hidden', # V8's visibility setting
87
'target_arch%': 'ia32', # set v8's target architecture
98
'host_arch%': 'ia32', # set v8's host architecture

tools/v8_gypfiles/toolchain.gypi

+12-8
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@
8282
'v8_toolset_for_shell%': 'target',
8383

8484
'host_os%': '<(OS)',
85-
'werror%': '-Werror',
8685
# For a shared library build, results in "libv8-<(soname_version).so".
8786
'soname_version%': '',
8887

@@ -133,13 +132,21 @@
133132
'<(V8_ROOT)',
134133
'<(V8_ROOT)/include',
135134
],
135+
'cflags!': ['-Wall', '-Wextra'],
136136
'conditions': [
137-
['clang==1', {
138-
'cflags': [ '-Werror', '-Wno-unknown-pragmas' ],
139-
},{
140-
'cflags!': [ '-Wall', '-Wextra' ],
137+
['clang==0 and OS!="win"', {
141138
'cflags': [
139+
# In deps/v8/BUILD.gn: if (!is_clang && !is_win) { cflags += [...] }
140+
'-Wno-strict-overflow',
142141
'-Wno-return-type',
142+
'-Wno-int-in-bool-context',
143+
'-Wno-deprecated',
144+
'-Wno-stringop-overflow',
145+
'-Wno-stringop-overread',
146+
'-Wno-restrict',
147+
'-Wno-array-bounds',
148+
'-Wno-nonnull',
149+
'-Wno-dangling-pointer',
143150
# On by default in Clang and V8 requires it at least for arm64.
144151
'-flax-vector-conversions',
145152
],
@@ -428,9 +435,6 @@
428435
['_toolset=="target"', {
429436
'conditions': [
430437
['v8_target_arch==target_arch', {
431-
'cflags': [
432-
'-Wno-error=array-bounds', # Workaround https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56273
433-
],
434438
'conditions': [
435439
['v8_target_arch=="mips64el"', {
436440
'cflags': ['-EL'],

tools/v8_gypfiles/v8.gyp

-6
Original file line numberDiff line numberDiff line change
@@ -1981,12 +1981,6 @@
19811981
]
19821982
}],
19831983
],
1984-
# -Wno-invalid-offsetof flag is not valid for C.
1985-
# The flag is initially set in `toolchain.gypi` for all targets.
1986-
'cflags!': [ '-Wno-invalid-offsetof' ],
1987-
'xcode_settings': {
1988-
'WARNING_CFLAGS!': ['-Wno-invalid-offsetof']
1989-
},
19901984
'direct_dependent_settings': {
19911985
'include_dirs': [
19921986
'<(V8_ROOT)/third_party/zlib',

0 commit comments

Comments
 (0)