diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2017-10-20 12:56:48 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2018-01-10 14:17:37 +0000 |
commit | 44b6c003b1e3ab8ef4ce9d516fd24d7a8eefb2ff (patch) | |
tree | 37ba2b5e5a7b9a485436ec0d0a260b10d6f5b640 | |
parent | 5fd3b698402be9712f8b2056b898d4d5828263c9 (diff) | |
download | qtwebengine-chromium-44b6c003b1e3ab8ef4ce9d516fd24d7a8eefb2ff.tar.gz |
Adapt sanitizer rules to Qt WebEngine build
Task-number: QTBUG-64726
Change-Id: Ia4c3f535a43212b01a93f879b7585339b356b732
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
-rw-r--r-- | chromium/build/config/sanitizers/BUILD.gn | 33 | ||||
-rw-r--r-- | chromium/chrome/BUILD.gn | 2 |
2 files changed, 21 insertions, 14 deletions
diff --git a/chromium/build/config/sanitizers/BUILD.gn b/chromium/build/config/sanitizers/BUILD.gn index ff0e60b6cb8..035d931d0b3 100644 --- a/chromium/build/config/sanitizers/BUILD.gn +++ b/chromium/build/config/sanitizers/BUILD.gn @@ -9,6 +9,9 @@ import("//build/config/clang/clang.gni") import("//build/config/sanitizers/sanitizers.gni") import("//build/toolchain/toolchain.gni") +# Import features.gni for the "use_qt" argument to be available. +import("//build/config/features.gni") + if (is_ios) { import("//build/config/ios/ios_sdk.gni") } @@ -52,12 +55,12 @@ group("deps") { # ASAN is supported on iOS but the runtime library depends on the compiler # used (Chromium version of clang versus Xcode version of clang). Only copy # the ASAN runtime on iOS if building with Chromium clang. - if (is_win || is_mac || (is_ios && !use_xcode_clang)) { + if ((is_win || is_mac || (is_ios && !use_xcode_clang)) && !use_qt) { data_deps = [ ":copy_asan_runtime", ] } - if (is_mac || (is_ios && !use_xcode_clang)) { + if ((is_mac || (is_ios && !use_xcode_clang)) && !use_qt) { public_deps = [ ":asan_runtime_bundle_data", ] @@ -65,7 +68,7 @@ group("deps") { } } -if ((is_mac || is_win || (is_ios && !use_xcode_clang)) && using_sanitizer) { +if ((is_mac || is_win || (is_ios && !use_xcode_clang)) && using_sanitizer && !use_qt) { if (is_mac) { _clang_rt_dso_path = "darwin/libclang_rt.asan_osx_dynamic.dylib" } else if (is_ios) { @@ -179,11 +182,13 @@ config("default_sanitizer_ldflags") { ldflags = [] if (is_asan) { ldflags += [ "-fsanitize=address" ] - if (is_mac) { - # https://crbug.com/708707 - ldflags += [ "-fno-sanitize-address-use-after-scope" ] - } else { - ldflags += [ "-fsanitize-address-use-after-scope" ] + if (!use_qt) { + if (is_mac) { + # https://crbug.com/708707 + ldflags += [ "-fno-sanitize-address-use-after-scope" ] + } else { + ldflags += [ "-fsanitize-address-use-after-scope" ] + } } } if (is_lsan) { @@ -285,11 +290,13 @@ config("asan_flags") { cflags = [] if (is_asan) { cflags += [ "-fsanitize=address" ] - if (!is_mac) { - cflags += [ "-fsanitize-address-use-after-scope" ] - } else { - # https://crbug.com/708707 - cflags += [ "-fno-sanitize-address-use-after-scope" ] + if (!use_qt) { + if (!is_mac) { + cflags += [ "-fsanitize-address-use-after-scope" ] + } else { + # https://crbug.com/708707 + cflags += [ "-fno-sanitize-address-use-after-scope" ] + } } if (!asan_globals) { cflags += [ diff --git a/chromium/chrome/BUILD.gn b/chromium/chrome/BUILD.gn index aa906c539f3..59188e8d539 100644 --- a/chromium/chrome/BUILD.gn +++ b/chromium/chrome/BUILD.gn @@ -852,7 +852,7 @@ if (is_win) { "//third_party/crashpad/crashpad/handler:crashpad_handler", ] - if (using_sanitizer) { + if (using_sanitizer && !use_qt) { # crashpad_handler requires the ASan runtime at its @executable_path. sources += [ "$root_out_dir/libclang_rt.asan_osx_dynamic.dylib" ] public_deps += [ "//build/config/sanitizers:copy_asan_runtime" ] |