From 0c20aeabd37aa57f3fbbfa2b346169b5a6e46346 Mon Sep 17 00:00:00 2001 From: Leonard Chan Date: Fri, 21 Feb 2020 11:33:02 -0800 Subject: [PATCH] [UBSan] Temporarily disable UBSan for snapshot and minidump UBSan was reporting reference binding to a misaligned address in Fuchsia. Disable UBSan for this target for now just to silence the runtime warnings, then come back and fix them. Bug: fuchsia:46805 Change-Id: Ic5d9b35161b6d998f1ff50eb8e978c44aff9b4ef Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2068051 Reviewed-by: Scott Graham Commit-Queue: Scott Graham --- BUILD.gn | 11 +++++++++++ minidump/BUILD.gn | 2 ++ snapshot/BUILD.gn | 2 ++ 3 files changed, 15 insertions(+) diff --git a/BUILD.gn b/BUILD.gn index 2f39e5ae..31c90918 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -20,6 +20,17 @@ config("crashpad_config") { include_dirs = [ "." ] } +# TODO(fuchsia:46805): Remove this once instances of UB have been cleaned up. +config("disable_ubsan") { + if (crashpad_is_in_fuchsia) { + cflags = [ "-fno-sanitize=undefined" ] + } + visibility = [ + "snapshot:snapshot", + "minidump:minidump_test", + ] +} + if (crashpad_is_in_chromium || crashpad_is_in_fuchsia) { test("crashpad_tests") { deps = [ diff --git a/minidump/BUILD.gn b/minidump/BUILD.gn index eb9f780d..35b19172 100644 --- a/minidump/BUILD.gn +++ b/minidump/BUILD.gn @@ -164,4 +164,6 @@ source_set("minidump_test") { if (crashpad_is_win) { cflags = [ "/wd4201" ] # nonstandard extension used : nameless struct/union } + + configs += [ "..:disable_ubsan" ] } diff --git a/snapshot/BUILD.gn b/snapshot/BUILD.gn index 150b8017..d3f51128 100644 --- a/snapshot/BUILD.gn +++ b/snapshot/BUILD.gn @@ -234,6 +234,8 @@ static_library("snapshot") { cflags = [ "/wd4201" ] # nonstandard extension used : nameless struct/union libs = [ "powrprof.lib" ] } + + configs += [ "..:disable_ubsan" ] } if (crashpad_is_linux) {