aboutsummaryrefslogtreecommitdiff
path: root/BUILD.gn
diff options
context:
space:
mode:
authorJamie Madill <jmadill@chromium.org>2019-06-03 15:21:47 -0400
committerCommit Bot <commit-bot@chromium.org>2019-06-03 20:24:03 +0000
commit20d380fa5be9169893c4a4bf6646ff25965e294f (patch)
tree72883ca2c81cfef12ead73e6c7abf727239c0584 /BUILD.gn
parent5993d899e3722a2e376045017c28ce7e2ed17a2c (diff)
downloadangle-20d380fa5be9169893c4a4bf6646ff25965e294f.tar.gz
Print stack backtrace on critical failure.
We reuse code from Skia to walk the stack on Posix platforms. See: https://github.com/google/skia/blob/master/tools/CrashHandler.cpp On Windows we use a BSD-licensed tool called StackWalker. See: https://github.com/JochenKalmbach/StackWalker This allows us to get high quality stack traces on Win/Linux/Mac. Bug: angleproject:3162 Change-Id: I9c50ede2c6a41ed0ee85a0507372df42a487bcef Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1632950 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Diffstat (limited to 'BUILD.gn')
-rw-r--r--BUILD.gn42
1 files changed, 33 insertions, 9 deletions
diff --git a/BUILD.gn b/BUILD.gn
index c686048502..fa9782c272 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -3,7 +3,6 @@
# found in the LICENSE file.
# import the use_x11 variable
-import("//build/config/dcheck_always_on.gni")
import("//build/config/linux/pkg_config.gni")
import("//build/config/ui.gni")
import("//testing/libfuzzer/fuzzer_test.gni")
@@ -145,6 +144,13 @@ config("build_id_config") {
ldflags = [ "-Wl,--build-id" ]
}
+# Useful for more informative stack traces.
+config("better_linux_stack_traces") {
+ if (angle_better_stack_traces) {
+ ldflags = [ "-Wl,--export-dynamic" ]
+ }
+}
+
# Windows ARM64 is available since 10.0.16299 so no need to copy
# d3dcompiler_47.dll because this file is available as inbox.
if (is_win && target_cpu != "arm64") {
@@ -210,6 +216,25 @@ config("angle_common_config") {
}
}
+if (is_win) {
+ angle_source_set("angle_stack_walker") {
+ sources = [
+ "util/windows/third_party/StackWalker/src/StackWalker.cpp",
+ "util/windows/third_party/StackWalker/src/StackWalker.h",
+ ]
+
+ if (is_clang) {
+ cflags_cc = [
+ "-Wno-c++98-compat-extra-semi",
+ "-Wno-missing-declarations",
+ "-Wno-switch",
+ ]
+ } else {
+ cflags_cc = [ "/wd4740" ]
+ }
+ }
+}
+
angle_source_set("angle_system_utils") {
sources = angle_system_utils_sources
}
@@ -921,12 +946,18 @@ foreach(is_shared_library,
target(library_type, library_name) {
sources = util_sources
+ deps = [
+ ":angle_common",
+ ":angle_util_loader_headers",
+ ]
+ public_deps = []
+ libs = []
if (is_win) {
sources += util_win_sources
+ deps += [ ":angle_stack_walker" ]
}
- libs = []
if (is_linux) {
sources += util_linux_sources
libs += [
@@ -950,7 +981,6 @@ foreach(is_shared_library,
if (is_android) {
# To prevent linux sources filtering on android
set_sources_assignment_filter([])
- sources += util_linux_sources
sources += util_android_sources
libs += [
"android",
@@ -962,12 +992,6 @@ foreach(is_shared_library,
public_configs += [ ":angle_util_config" ]
- deps = [
- ":angle_common",
- ":angle_util_loader_headers",
- ]
-
- public_deps = []
if (is_fuchsia) {
sources += util_fuchsia_sources
public_deps += [