Index: third_party/yasm/BUILD.gn |
diff --git a/third_party/yasm/BUILD.gn b/third_party/yasm/BUILD.gn |
index 9ed8e46d68ac25db90008e716bc9efb1a24039b2..f13799bef5e231fdfb46fabdd7dcafcdcd4b891d 100644 |
--- a/third_party/yasm/BUILD.gn |
+++ b/third_party/yasm/BUILD.gn |
@@ -55,6 +55,9 @@ if (current_toolchain == host_toolchain) { |
":yasm_config", |
"//build/config/compiler:no_chromium_code", |
] |
+ deps = [ |
+ "//build/config/sanitizers:deps", |
+ ] |
} |
executable("genmodule") { |
@@ -66,6 +69,9 @@ if (current_toolchain == host_toolchain) { |
":yasm_config", |
"//build/config/compiler:no_chromium_code", |
] |
+ deps = [ |
+ "//build/config/sanitizers:deps", |
+ ] |
} |
executable("genperf") { |
@@ -82,6 +88,7 @@ if (current_toolchain == host_toolchain) { |
deps = [ |
":yasm_utils", |
+ "//build/config/sanitizers:deps", |
] |
} |
@@ -109,6 +116,9 @@ if (current_toolchain == host_toolchain) { |
":yasm_config", |
"//build/config/compiler:no_chromium_code", |
] |
+ deps = [ |
+ "//build/config/sanitizers:deps", |
+ ] |
} |
executable("genversion") { |
@@ -120,6 +130,23 @@ if (current_toolchain == host_toolchain) { |
":yasm_config", |
"//build/config/compiler:no_chromium_code", |
] |
+ deps = [ |
+ "//build/config/sanitizers:deps", |
+ ] |
+ } |
+ |
+ config("re2c_warnings") { |
+ # re2c is missing CLOSEVOP from one switch. |
+ if (is_clang) { |
+ cflags = [ |
+ # re2c is missing CLOSEVOP from one switch. |
+ "-Wno-switch", |
+ |
+ # re2c contains many static functions in headers (because it's |
+ # a C library predating C99.) |
+ "-Wno-unused-function", |
+ ] |
+ } |
} |
executable("re2c") { |
@@ -139,11 +166,22 @@ if (current_toolchain == host_toolchain) { |
configs += [ |
":yasm_config", |
"//build/config/compiler:no_chromium_code", |
+ |
+ # Must be after no_chromium_code for warning flags to be ordered |
+ # correctly. |
+ ":re2c_warnings", |
+ ] |
+ deps = [ |
+ "//build/config/sanitizers:deps", |
] |
+ } |
- # re2c is missing CLOSEVOP from one switch. |
- if (is_posix) { |
- cflags = [ "-Wno-switch" ] |
+ config("yasm_warnings") { |
+ if (is_clang) { |
+ cflags = [ |
+ # reg3264type in x86expr.c is unused. |
+ "-Wno-unused-local-typedef", |
+ ] |
} |
} |
@@ -234,6 +272,11 @@ if (current_toolchain == host_toolchain) { |
configs += [ |
":yasm_config", |
"//build/config/compiler:no_chromium_code", |
+ "//build/config/compiler:no_incompatible_pointer_warnings", |
+ |
+ # Must be after no_chromium_code for warning flags to be ordered |
+ # correctly. |
+ ":yasm_warnings", |
] |
# Yasm generates a bunch of .c files which its source file #include. |
@@ -244,12 +287,9 @@ if (current_toolchain == host_toolchain) { |
if (!is_win) { |
cflags = [ |
- "-ansi", |
+ "-std=c89", |
"-pedantic", |
] |
- if (is_clang) { |
- cflags += [ "-Wno-incompatible-pointer-types" ] |
- } |
} |
# TODO(ajwong): This should take most of the generated output as |
@@ -259,14 +299,15 @@ if (current_toolchain == host_toolchain) { |
":compile_gperf_for_include", |
":compile_nasm_macros", |
":compile_nasm_version", |
+ ":compile_re2c", |
":compile_re2c_lc3b", |
":compile_win64_gas", |
":compile_win64_nasm", |
- ":compile_re2c", |
":generate_license", |
":generate_module", |
":generate_version", |
":yasm_utils", |
+ "//build/config/sanitizers:deps", |
] |
} |