From 5754f608cb571de0e51313ec0d5a1ddefa3997b2 Mon Sep 17 00:00:00 2001 From: Joshua Peraza Date: Mon, 26 Mar 2018 17:26:08 -0700 Subject: [PATCH] android: unset source filters to use linux files Also disable testing reading AT_ENTRY on Android. Bug: crashpad:30 Change-Id: I10353bbbb3ff28721a2c05d69463df5eac4df281 Reviewed-on: https://chromium-review.googlesource.com/980811 Reviewed-by: Mark Mentovai --- client/BUILD.gn | 1 + handler/BUILD.gn | 1 + snapshot/BUILD.gn | 1 + test/BUILD.gn | 1 + util/BUILD.gn | 2 ++ util/linux/auxiliary_vector_test.cc | 7 +++++++ 6 files changed, 13 insertions(+) diff --git a/client/BUILD.gn b/client/BUILD.gn index cb4161f5..ddd521f2 100644 --- a/client/BUILD.gn +++ b/client/BUILD.gn @@ -44,6 +44,7 @@ static_library("client") { } if (crashpad_is_linux || crashpad_is_android) { + set_sources_assignment_filter([]) sources += [ "crashpad_client_linux.cc", "simulate_crash_linux.h", diff --git a/handler/BUILD.gn b/handler/BUILD.gn index ccbb0b55..78a4b092 100644 --- a/handler/BUILD.gn +++ b/handler/BUILD.gn @@ -40,6 +40,7 @@ static_library("handler") { } if (crashpad_is_linux || crashpad_is_android) { + set_sources_assignment_filter([]) sources += [ "linux/crash_report_exception_handler.cc", "linux/crash_report_exception_handler.h", diff --git a/snapshot/BUILD.gn b/snapshot/BUILD.gn index e12cc6d6..27758890 100644 --- a/snapshot/BUILD.gn +++ b/snapshot/BUILD.gn @@ -104,6 +104,7 @@ static_library("snapshot") { } if (crashpad_is_linux || crashpad_is_android) { + set_sources_assignment_filter([]) sources += [ "linux/cpu_context_linux.cc", "linux/cpu_context_linux.h", diff --git a/test/BUILD.gn b/test/BUILD.gn index 2c894603..dc2e2a75 100644 --- a/test/BUILD.gn +++ b/test/BUILD.gn @@ -69,6 +69,7 @@ static_library("test") { } if (crashpad_is_linux || crashpad_is_android) { + set_sources_assignment_filter([]) sources += [ "linux/fake_ptrace_connection.cc", "linux/fake_ptrace_connection.h", diff --git a/util/BUILD.gn b/util/BUILD.gn index ea071afd..a7034924 100644 --- a/util/BUILD.gn +++ b/util/BUILD.gn @@ -260,6 +260,7 @@ static_library("util") { } if (crashpad_is_linux || crashpad_is_android) { + set_sources_assignment_filter([]) sources += [ "linux/address_types.h", "linux/auxiliary_vector.cc", @@ -548,6 +549,7 @@ source_set("util_test") { } if (crashpad_is_linux || crashpad_is_android) { + set_sources_assignment_filter([]) sources += [ "linux/auxiliary_vector_test.cc", "linux/memory_map_test.cc", diff --git a/util/linux/auxiliary_vector_test.cc b/util/linux/auxiliary_vector_test.cc index e3bad3fc..382cb67b 100644 --- a/util/linux/auxiliary_vector_test.cc +++ b/util/linux/auxiliary_vector_test.cc @@ -22,6 +22,7 @@ #include "base/bit_cast.h" #include "base/macros.h" +#include "build/build_config.h" #include "gtest/gtest.h" #include "test/errors.h" #include "test/multiprocess.h" @@ -31,9 +32,13 @@ #include "util/numeric/int128.h" #include "util/process/process_memory_linux.h" +#if !defined(OS_ANDROID) +// TODO(jperaza): This symbol isn't defined when building in chromium for +// Android. There may be another symbol to use. extern "C" { extern void _start(); } // extern "C" +#endif namespace crashpad { namespace test { @@ -63,9 +68,11 @@ void TestAgainstCloneOrSelf(pid_t pid) { ASSERT_TRUE(aux.GetValue(AT_BASE, &interp_base)); EXPECT_TRUE(mappings.FindMapping(interp_base)); +#if !defined(OS_ANDROID) LinuxVMAddress entry_addr; ASSERT_TRUE(aux.GetValue(AT_ENTRY, &entry_addr)); EXPECT_EQ(entry_addr, FromPointerCast(_start)); +#endif uid_t uid; ASSERT_TRUE(aux.GetValue(AT_UID, &uid));