Skip to content

Commit

Permalink
feat(bazel): enable symbolization
Browse files Browse the repository at this point in the history
Symbolization support on Linux and BSD requires link.h which is usually
provided by the GNU C Library (glibc). Assume the header to be present
at all times by unconditionally defining HAVE_SYMBOLIZE on the
corresponding platforms.
  • Loading branch information
hcoona authored and sergiud committed Aug 2, 2024
1 parent 570c7e4 commit f0f7d3c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bazel/glog.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,14 @@ def glog_library(with_gflags = 1, **kwargs):
# Enable declaration of _Unwind_Backtrace
"-D_GNU_SOURCE",
"-DHAVE_LINK_H",
"-DHAVE_SYMBOLIZE", # Supported by <link.h>
]

linux_only_copts = [
# For utilities.h.
"-DHAVE_EXECINFO_H",
"-DHAVE_LINK_H",
"-DHAVE_SYMBOLIZE", # Supported by <link.h>
]

darwin_only_copts = [
Expand Down
4 changes: 4 additions & 0 deletions src/symbolize.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@
# error "symbolize.h" was not included correctly.
#endif

// We prefer to let the build system detect the availability of certain features
// such as symbolization support. HAVE_SYMBOLIZE should therefore be defined by
// the build system in general unless there is a good reason to perform the
// detection using the preprocessor.
#ifndef GLOG_NO_SYMBOLIZE_DETECTION
# ifndef HAVE_SYMBOLIZE
// defined by gcc
Expand Down

0 comments on commit f0f7d3c

Please sign in to comment.