Skip to content

Commit

Permalink
GLOG depends on libunwind. Sometimes libunwind symbols were missing.
Browse files Browse the repository at this point in the history
This commit adds libunwind explicitly to the linking command.
  • Loading branch information
bmyerz committed Mar 26, 2016
1 parent ec4fa53 commit c9bc0dd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,12 @@ list(APPEND GRAPPA_ENV
GLOG_v=1
)

# libunwind must go after GLOG library in the linking list to resolve its references.
# We force find_library to use static library because we are putting all dynamics before statics
find_library(UNWIND_FOUND NAMES libunwind.a REQUIRED)
message("UNWIND_FOUND: ${UNWIND_FOUND}")
list(APPEND GRAPPA_STATIC_LIBS ${UNWIND_FOUND})

######################################################################
# Google flags
# in theory, it may come from third-party or from system directories,
Expand Down

1 comment on commit c9bc0dd

@nelsonje
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably possible to tell glog to use frame pointers instead of libunwind, which would have the additional benefit of working better with the profiler. We might want to check if libunwind can be found, and if not, enable frame pointers.

I also thought about redistributing libunwind in third-party to make the profiler easier to build. The only thing to watch out for there is that gperftools prefers a particular version of libunwind, which I think doesn't have great C++11 support.

Please sign in to comment.