fuchsia: Centralize disabling of Wconversion

Because of the multiple-worlds building of the Crashpad code in the
Fuchsia tree (with the Fuchsia BUILDCONFIG.gn in particular) there's no
good location to globally disable Wconversion for all of crashpad.

This can be somewhat-improved by using a GN template
crashpad_static_library() similar to the existing crashpad_executable()
template.

Includes mini_chromium DEPS roll:
68da43e Fix a couple trucation warnings
88ce866 build: set include dirs

Bug: fuchsia:58162
Change-Id: I638fcf858c35b9a858ca2c410636f8c99603aed2
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2411131
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Scott Graham <scottmg@chromium.org>
This commit is contained in:
Scott Graham 2020-09-14 14:22:05 -07:00 committed by Commit Bot
parent a98ee20e57
commit 1c77abe909
7 changed files with 45 additions and 79 deletions

2
DEPS
View File

@ -42,7 +42,7 @@ deps = {
'7bde79cc274d06451bf65ae82c012a5d3e476b5a', '7bde79cc274d06451bf65ae82c012a5d3e476b5a',
'crashpad/third_party/mini_chromium/mini_chromium': 'crashpad/third_party/mini_chromium/mini_chromium':
Var('chromium_git') + '/chromium/mini_chromium@' + Var('chromium_git') + '/chromium/mini_chromium@' +
'3baa0e09ceaa071f6cbbd8fc718d6046533e1f1f', '68da43e59f7ebcf39625fcef3a5303fc06240b42',
'crashpad/third_party/libfuzzer/src': 'crashpad/third_party/libfuzzer/src':
Var('chromium_git') + '/chromium/llvm-project/compiler-rt/lib/fuzzer.git@' + Var('chromium_git') + '/chromium/llvm-project/compiler-rt/lib/fuzzer.git@' +
'fda403cf93ecb8792cb1d061564d89a6553ca020', 'fda403cf93ecb8792cb1d061564d89a6553ca020',

View File

@ -85,9 +85,10 @@ template("crashpad_executable") {
} }
if (crashpad_is_in_fuchsia) { if (crashpad_is_in_fuchsia) {
fdio_config = [ "//build/config/fuchsia:fdio_config" ] conversion_config = [ "//build/config:Wno-conversion" ]
if (configs + fdio_config - fdio_config == configs) { if (configs + conversion_config - conversion_config == configs) {
configs += fdio_config # TODO(https://fxbug.dev/58162): Decide if these are worth enabling.
configs += conversion_config
} }
} }
} }
@ -110,7 +111,37 @@ template("crashpad_loadable_module") {
} }
if (crashpad_is_in_fuchsia) { if (crashpad_is_in_fuchsia) {
configs += [ "//build/config/fuchsia:fdio_config" ] conversion_config = [ "//build/config:Wno-conversion" ]
if (configs + conversion_config - conversion_config == configs) {
# TODO(https://fxbug.dev/58162): Decide if these are worth enabling.
configs += conversion_config
}
}
}
}
template("crashpad_static_library") {
static_library(target_name) {
forward_variables_from(invoker,
"*",
[
"configs",
"remove_configs",
])
if (defined(invoker.remove_configs)) {
configs -= invoker.remove_configs
}
if (defined(invoker.configs)) {
configs += invoker.configs
}
if (crashpad_is_in_fuchsia) {
conversion_config = [ "//build/config:Wno-conversion" ]
if (configs + conversion_config - conversion_config == configs) {
# TODO(https://fxbug.dev/58162): Decide if these are worth enabling.
configs += conversion_config
}
} }
} }
} }

View File

@ -19,7 +19,7 @@ if (crashpad_is_in_chromium) {
set_sources_assignment_filter([]) set_sources_assignment_filter([])
} }
static_library("client") { crashpad_static_library("client") {
sources = [ sources = [
"annotation.cc", "annotation.cc",
"annotation.h", "annotation.h",
@ -116,7 +116,6 @@ static_library("client") {
deps += [ "../third_party/fuchsia" ] deps += [ "../third_party/fuchsia" ]
if (crashpad_is_in_fuchsia) { if (crashpad_is_in_fuchsia) {
deps += [ "//sdk/lib/fdio" ] deps += [ "//sdk/lib/fdio" ]
configs += [ "//build/config:Wno-conversion" ]
} }
} }
} }
@ -175,12 +174,6 @@ source_set("client_test") {
if (crashpad_is_win) { if (crashpad_is_win) {
data_deps += [ "../handler:crashpad_handler_console" ] data_deps += [ "../handler:crashpad_handler_console" ]
} }
if (crashpad_is_in_fuchsia) {
# TODO(https://bugs.fuchsia.dev/p/fuchsia/issues/detail?id=58162):
# Delete the below and fix compiler warnings
configs += [ "//build/config:Wno-conversion" ]
}
} }
if (crashpad_is_linux || crashpad_is_android) { if (crashpad_is_linux || crashpad_is_android) {

View File

@ -60,7 +60,7 @@ template("compat_target") {
not_needed([ "configs" ]) not_needed([ "configs" ])
} }
} else { } else {
static_library(target_name) { crashpad_static_library(target_name) {
forward_variables_from(invoker, "*", [ "configs" ]) forward_variables_from(invoker, "*", [ "configs" ])
if (!defined(configs)) { if (!defined(configs)) {
configs = [] configs = []
@ -177,8 +177,4 @@ compat_target("compat") {
if (!crashpad_is_linux && !crashpad_is_android && !crashpad_is_fuchsia) { if (!crashpad_is_linux && !crashpad_is_android && !crashpad_is_fuchsia) {
deps += [ "../third_party/glibc" ] deps += [ "../third_party/glibc" ]
} }
if (crashpad_is_in_fuchsia) {
configs = [ "//build/config:Wno-conversion" ]
}
} }

View File

@ -19,7 +19,7 @@ if (crashpad_is_in_chromium) {
set_sources_assignment_filter([]) set_sources_assignment_filter([])
} }
static_library("minidump") { crashpad_static_library("minidump") {
sources = [ sources = [
"minidump_annotation_writer.cc", "minidump_annotation_writer.cc",
"minidump_annotation_writer.h", "minidump_annotation_writer.h",
@ -90,12 +90,6 @@ static_library("minidump") {
"/wd4324", # 'struct' : structure was padded due to __declspec(align()) "/wd4324", # 'struct' : structure was padded due to __declspec(align())
] ]
} }
if (crashpad_is_in_fuchsia) {
# TODO(https://bugs.fuchsia.dev/p/fuchsia/issues/detail?id=58162):
# Delete the below and fix compiler warnings
configs += [ "//build/config:Wno-conversion" ]
}
} }
# :format is the only part of minidump that snapshot may depend on. # :format is the only part of minidump that snapshot may depend on.
@ -154,12 +148,6 @@ static_library("test_support") {
if (crashpad_is_win) { if (crashpad_is_win) {
cflags = [ "/wd4201" ] # nonstandard extension used : nameless struct/union cflags = [ "/wd4201" ] # nonstandard extension used : nameless struct/union
} }
if (crashpad_is_in_fuchsia) {
# TODO(https://bugs.fuchsia.dev/p/fuchsia/issues/detail?id=58162):
# Delete the below and fix compiler warnings
configs += [ "//build/config:Wno-conversion" ]
}
} }
source_set("minidump_test") { source_set("minidump_test") {
@ -205,10 +193,4 @@ source_set("minidump_test") {
} }
configs += [ "..:disable_ubsan" ] configs += [ "..:disable_ubsan" ]
if (crashpad_is_in_fuchsia) {
# TODO(https://bugs.fuchsia.dev/p/fuchsia/issues/detail?id=58162):
# Delete the below and fix compiler warnings
configs += [ "//build/config:Wno-conversion" ]
}
} }

View File

@ -22,7 +22,7 @@ if (crashpad_is_in_chromium) {
set_sources_assignment_filter([]) set_sources_assignment_filter([])
} }
static_library("snapshot") { crashpad_static_library("snapshot") {
sources = [ sources = [
"annotation_snapshot.cc", "annotation_snapshot.cc",
"annotation_snapshot.h", "annotation_snapshot.h",
@ -242,6 +242,8 @@ static_library("snapshot") {
public_configs = [ "..:crashpad_config" ] public_configs = [ "..:crashpad_config" ]
configs = [ "..:disable_ubsan" ]
public_deps = [ ":context" ] public_deps = [ ":context" ]
deps = [ deps = [
@ -260,14 +262,6 @@ static_library("snapshot") {
cflags = [ "/wd4201" ] # nonstandard extension used : nameless struct/union cflags = [ "/wd4201" ] # nonstandard extension used : nameless struct/union
libs = [ "powrprof.lib" ] libs = [ "powrprof.lib" ]
} }
configs += [ "..:disable_ubsan" ]
if (crashpad_is_in_fuchsia) {
# TODO(https://bugs.fuchsia.dev/p/fuchsia/issues/detail?id=58162):
# Delete the below and fix compiler warnings
configs += [ "//build/config:Wno-conversion" ]
}
} }
# :context is the only part of snapshot that minidump may depend on. # :context is the only part of snapshot that minidump may depend on.
@ -288,12 +282,6 @@ static_library("context") {
if (crashpad_is_win) { if (crashpad_is_win) {
cflags = [ "/wd4201" ] # nonstandard extension used : nameless struct/union cflags = [ "/wd4201" ] # nonstandard extension used : nameless struct/union
} }
if (crashpad_is_in_fuchsia) {
# TODO(https://bugs.fuchsia.dev/p/fuchsia/issues/detail?id=58162):
# Delete the below and fix compiler warnings
configs += [ "//build/config:Wno-conversion" ]
}
} }
if (crashpad_is_linux) { if (crashpad_is_linux) {
@ -482,12 +470,6 @@ source_set("snapshot_test") {
":crashpad_snapshot_test_image_reader_module", ":crashpad_snapshot_test_image_reader_module",
] ]
} }
if (crashpad_is_in_fuchsia) {
# TODO(https://bugs.fuchsia.dev/p/fuchsia/issues/detail?id=58162):
# Delete the below and fix compiler warnings
configs += [ "//build/config:Wno-conversion" ]
}
} }
crashpad_loadable_module("crashpad_snapshot_test_module") { crashpad_loadable_module("crashpad_snapshot_test_module") {

View File

@ -155,7 +155,7 @@ if (crashpad_is_mac || crashpad_is_ios) {
} }
} }
static_library("util") { crashpad_static_library("util") {
sources = [ sources = [
"file/delimited_file_reader.cc", "file/delimited_file_reader.cc",
"file/delimited_file_reader.h", "file/delimited_file_reader.h",
@ -567,6 +567,8 @@ static_library("util") {
public_configs = [ "..:crashpad_config" ] public_configs = [ "..:crashpad_config" ]
configs = [ "..:disable_ubsan" ]
# Include generated files starting with "util". # Include generated files starting with "util".
if (crashpad_is_in_fuchsia) { if (crashpad_is_in_fuchsia) {
include_dirs = [ "$root_gen_dir/third_party/crashpad" ] include_dirs = [ "$root_gen_dir/third_party/crashpad" ]
@ -622,14 +624,6 @@ static_library("util") {
if (crashpad_is_android || crashpad_is_linux) { if (crashpad_is_android || crashpad_is_linux) {
deps += [ "../third_party/lss" ] deps += [ "../third_party/lss" ]
} }
configs += [ "..:disable_ubsan" ]
if (crashpad_is_in_fuchsia) {
# TODO(https://bugs.fuchsia.dev/p/fuchsia/issues/detail?id=58162):
# Delete the below and fix compiler warnings
configs += [ "//build/config:Wno-conversion" ]
}
} }
if (!crashpad_is_android && !crashpad_is_ios) { if (!crashpad_is_android && !crashpad_is_ios) {
@ -668,12 +662,6 @@ if (!crashpad_is_android && !crashpad_is_ios) {
] ]
} }
} }
if (crashpad_is_in_fuchsia) {
# TODO(https://bugs.fuchsia.dev/p/fuchsia/issues/detail?id=58162):
# Delete the below and fix compiler warnings
configs = [ "//build/config:Wno-conversion" ]
}
} }
} }
@ -889,12 +877,6 @@ source_set("util_test") {
":crashpad_util_test_safe_terminate_process_test_child", ":crashpad_util_test_safe_terminate_process_test_child",
] ]
} }
if (crashpad_is_in_fuchsia) {
# TODO(https://bugs.fuchsia.dev/p/fuchsia/issues/detail?id=58162):
# Delete the below and fix compiler warnings
configs += [ "//build/config:Wno-conversion" ]
}
} }
if (crashpad_is_ios) { if (crashpad_is_ios) {