Skip to content

Commit

Permalink
Add LibUnwind as a dependency of glog::glog
Browse files Browse the repository at this point in the history
Summary:
X-link: facebookincubator/zstrong#738

X-link: facebook/folly#1916

X-link: facebook/folly#1857

X-link: facebook/hhvm#9179

X-link: facebook/fboss#119

X-link: facebook/fb303#32

X-link: facebook/openr#141

X-link: facebook/fbthrift#524

X-link: facebook/wangle#209

X-link: facebook/proxygen#429

X-link: #128

X-link: facebookexperimental/rust-shed#35

X-link: facebook/watchman#1058

X-link: facebookincubator/reindeer#5

X-link: facebookarchive/sapling-staging#8

X-link: facebookexperimental/edencommon#5

X-link: facebookincubator/fizz#82

X-link: facebookincubator/velox#2487

X-link: facebookincubator/hsthrift#101

X-link: facebookincubator/katran#172

X-link: facebook/mvfst#273

X-link: https://github.com/fairinternal/AIRStore/pull/38

`LibUnwind` is a dependency of `glog` according to [objdump](https://www.internalfb.com/intern/skycastle/run/117093590319624253/artifact/actionlog.117093590478433674.stdout). This diff adds ${LIBUNWIND_LIBRARY} to the CMake imported library `glog::glog` as an element in the `IMPORTED_LINK_INTERFACE_LIBRARIES` property.

Without this diff, there will be a linker error like this:
```
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libglog.so: undefined reference to symbol '_Ux86_64_getcontext'
//usr/lib/x86_64-linux-gnu/libunwind.so.8: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
```

Reviewed By: Wilfred

Differential Revision: D42509278

fbshipit-source-id: ea80449ccc6b91d658bbe9cee954fc8a4a17926f
  • Loading branch information
yfeldblum authored and facebook-github-bot committed Mar 25, 2024
1 parent 74f49fa commit f08da4e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion build/fbcode_builder/CMake/FindGlog.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ if (NOT TARGET glog::glog)
find_package(Gflags)
if(GFLAGS_FOUND)
message(STATUS "Found gflags as a dependency of glog::glog, include=${LIBGFLAGS_INCLUDE_DIR}, libs=${LIBGFLAGS_LIBRARY}")
set_target_properties(glog::glog PROPERTIES IMPORTED_LINK_INTERFACE_LIBRARIES ${LIBGFLAGS_LIBRARY})
set_property(TARGET glog::glog APPEND PROPERTY IMPORTED_LINK_INTERFACE_LIBRARIES ${LIBGFLAGS_LIBRARY})
endif()

find_package(LibUnwind)
if(LIBUNWIND_FOUND)
message(STATUS "Found LibUnwind as a dependency of glog::glog, include=${LIBUNWIND_INCLUDE_DIR}, libs=${LIBUNWIND_LIBRARY}")
set_property(TARGET glog::glog APPEND PROPERTY IMPORTED_LINK_INTERFACE_LIBRARIES ${LIBUNWIND_LIBRARY})
endif()
endif()

0 comments on commit f08da4e

Please sign in to comment.