Skip to content

Commit

Permalink
Add LibUnwind as a dependency of glog::glog (facebook#1916)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: facebook#1916

Pull Request resolved: facebook#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: facebook/sapling#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: 79aa2e3d06b0d4f3b60ab4e9f46e51de214e8041
  • Loading branch information
yfeldblum authored and facebook-github-bot committed May 17, 2023
1 parent 48ab4c7 commit f52c625
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 f52c625

Please sign in to comment.