Skip to content

Commit f0f7d3c

Browse files
hcoonasergiud
authored andcommitted
feat(bazel): enable symbolization
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.
1 parent 570c7e4 commit f0f7d3c

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

bazel/glog.bzl

+2
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,14 @@ def glog_library(with_gflags = 1, **kwargs):
9191
# Enable declaration of _Unwind_Backtrace
9292
"-D_GNU_SOURCE",
9393
"-DHAVE_LINK_H",
94+
"-DHAVE_SYMBOLIZE", # Supported by <link.h>
9495
]
9596

9697
linux_only_copts = [
9798
# For utilities.h.
9899
"-DHAVE_EXECINFO_H",
99100
"-DHAVE_LINK_H",
101+
"-DHAVE_SYMBOLIZE", # Supported by <link.h>
100102
]
101103

102104
darwin_only_copts = [

src/symbolize.h

+4
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@
7777
# error "symbolize.h" was not included correctly.
7878
#endif
7979

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

0 commit comments

Comments
 (0)