Skip to content

Commit

Permalink
Fix stacktrace on bazel build. (#347)
Browse files Browse the repository at this point in the history
We need at least following defs to be set to print stacktrace in
failure signal handler.

- HAVE_UNWIND_H: on Linux and macOS. unwind.h is usually present
  by default on those OSes.
- HAVE_DLADDR: on macOS.

Windows is not cared because glog can not be built with bazel
on Windows today.
  • Loading branch information
nya3jp authored and ukai committed Apr 12, 2019
1 parent 96a2f23 commit 6ca3d3c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion bazel/glog.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,16 @@ def glog_library(namespace='google', with_gflags=1, **kwargs):

# Include generated header files.
'-I%s/glog_internal' % gendir,
] + ([
] + select({
# For stacktrace.
'@bazel_tools//src/conditions:darwin': [
'-DHAVE_UNWIND_H',
'-DHAVE_DLADDR',
],
'//conditions:default': [
'-DHAVE_UNWIND_H',
],
}) + ([
# Use gflags to parse CLI arguments.
'-DHAVE_LIB_GFLAGS',
] if with_gflags else []),
Expand Down

0 comments on commit 6ca3d3c

Please sign in to comment.