Remove base dependency from no_cfi_icall

crashpad_handler_trampoline needs to use NoCfiIcall, but does not link
libstdc++ in order to remain small. A dependency on base causes link
errors in ASAN builds:

https://ci.chromium.org/p/chromium/builders/ci/android-asan/7791?

This CL depends on
https://chromium-review.googlesource.com/c/chromium/mini_chromium/+/2405651
in order to include "build/build_config.h".

Change-Id: Ie0344b7ead9c019cdda8a6e37ea8ec9cd5bf72b0
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2405650
Commit-Queue: Joshua Peraza <jperaza@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
This commit is contained in:
Joshua Peraza 2020-09-21 13:42:59 -07:00 committed by Commit Bot
parent 1c77abe909
commit 36d4bb83b3
5 changed files with 36 additions and 6 deletions

2
DEPS
View File

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

View File

@ -164,6 +164,10 @@ compat_target("compat") {
"..:crashpad_config",
]
if (!crashpad_is_win) {
public_deps = [ "../third_party/mini_chromium:base" ]
}
deps = [ "../util:no_cfi_icall" ]
if (!crashpad_is_mac) {

View File

@ -33,3 +33,15 @@ group("base_test_support") {
public_deps = [ "//base/test:test_support" ]
}
}
group("build") {
if (crashpad_is_in_chromium) {
# Chromium has no build target.
} else if (crashpad_is_standalone || crashpad_is_in_fuchsia) {
public_deps = [ "mini_chromium/build" ]
} else if (crashpad_is_external) {
public_deps = [ "../../../../mini_chromium/mini_chromium/build" ]
} else if (crashpad_is_in_dart) {
public_deps = [ "//third_party/mini_chromium/mini_chromium/build" ]
}
}

View File

@ -669,8 +669,8 @@ if (!crashpad_is_android && !crashpad_is_ios) {
# without cycles.
source_set("no_cfi_icall") {
sources = [ "misc/no_cfi_icall.h" ]
public_deps = [ "../third_party/mini_chromium:base" ]
public_configs = [ "..:crashpad_config" ]
public_deps = [ "../third_party/mini_chromium:build" ]
}
source_set("util_test") {

View File

@ -18,8 +18,6 @@
#include <type_traits>
#include <utility>
#include "base/compiler_specific.h"
#include "base/macros.h"
#include "build/build_config.h"
#if defined(OS_WIN)
@ -30,6 +28,24 @@ namespace crashpad {
namespace {
// Sanitizers annotations.
#if defined(__has_attribute)
#if __has_attribute(no_sanitize)
#define NO_SANITIZE(what) __attribute__((no_sanitize(what)))
#endif
#endif
#if !defined(NO_SANITIZE)
#define NO_SANITIZE(what)
#endif
// DISABLE_CFI_ICALL -- Disable Control Flow Integrity indirect call checks.
#if defined(OS_WIN)
// Windows also needs __declspec(guard(nocf)).
#define DISABLE_CFI_ICALL NO_SANITIZE("cfi-icall") __declspec(guard(nocf))
#else
#define DISABLE_CFI_ICALL NO_SANITIZE("cfi-icall")
#endif
template <typename Functor>
struct FunctorTraits;
@ -116,8 +132,6 @@ class NoCfiIcall {
private:
Functor function_;
DISALLOW_COPY_AND_ASSIGN(NoCfiIcall);
};
} // namespace crashpad