summaryrefslogtreecommitdiff
path: root/meta-openembedded/meta-oe/recipes-support/glog/glog/libexecinfo.patch
blob: ae46d3274f50bf24792eb7aa07b1ba58aa85f864 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Link libexecinfo if its found, this is needed for musl based systems

Fixes
ld: libglog.so.0.4.0: undefined reference to `backtrace'
| collect2: error: ld returned 1 exit status

Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -115,6 +115,7 @@ check_cxx_compiler_flag (-Wunnamed-type-
 check_symbol_exists (snprintf stdio.h HAVE_SNPRINTF)
 
 check_library_exists (dbghelp UnDecorateSymbolName "" HAVE_DBGHELP)
+check_library_exists (execinfo backtrace "" HAVE_EXECINFO)
 
 find_package(Libunwind)
 
@@ -471,6 +472,10 @@ if (Libunwind_FOUND)
   target_link_libraries (glog PUBLIC unwind)
 endif (Libunwind_FOUND)
 
+if (HAVE_EXECINFO)
+  target_link_libraries (glog PUBLIC execinfo)
+endif (HAVE_EXECINFO)
+
 if (HAVE_DBGHELP)
    target_link_libraries (glog PUBLIC dbghelp)
 endif (HAVE_DBGHELP)