diff options
author | Khem Raj <raj.khem@gmail.com> | 2021-03-08 14:58:40 -0800 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2021-03-08 16:24:25 -0800 |
commit | d1a74bad3667de31844d9ace739813c3dcdb82ab (patch) | |
tree | a0ee7834897c997cd52d34886080a6527b794b16 /meta-oe | |
parent | bbc3b9dd0ffc506e15f5d4e8ff39e483bfdec7a7 (diff) | |
download | meta-openembedded-d1a74bad3667de31844d9ace739813c3dcdb82ab.tar.gz |
glog: Link with libexecinfo on musl
some platforms e.g. riscv do not yet have libunwind ported so use
libexecinfo instead
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe')
-rw-r--r-- | meta-oe/recipes-support/glog/glog/libexecinfo.patch | 29 | ||||
-rw-r--r-- | meta-oe/recipes-support/glog/glog_0.4.0.bb | 4 |
2 files changed, 33 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/glog/glog/libexecinfo.patch b/meta-oe/recipes-support/glog/glog/libexecinfo.patch new file mode 100644 index 0000000000..ae46d3274f --- /dev/null +++ b/meta-oe/recipes-support/glog/glog/libexecinfo.patch | |||
@@ -0,0 +1,29 @@ | |||
1 | Link libexecinfo if its found, this is needed for musl based systems | ||
2 | |||
3 | Fixes | ||
4 | ld: libglog.so.0.4.0: undefined reference to `backtrace' | ||
5 | | collect2: error: ld returned 1 exit status | ||
6 | |||
7 | Upstream-Status: Pending | ||
8 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
9 | --- a/CMakeLists.txt | ||
10 | +++ b/CMakeLists.txt | ||
11 | @@ -115,6 +115,7 @@ check_cxx_compiler_flag (-Wunnamed-type- | ||
12 | check_symbol_exists (snprintf stdio.h HAVE_SNPRINTF) | ||
13 | |||
14 | check_library_exists (dbghelp UnDecorateSymbolName "" HAVE_DBGHELP) | ||
15 | +check_library_exists (execinfo backtrace "" HAVE_EXECINFO) | ||
16 | |||
17 | find_package(Libunwind) | ||
18 | |||
19 | @@ -471,6 +472,10 @@ if (Libunwind_FOUND) | ||
20 | target_link_libraries (glog PUBLIC unwind) | ||
21 | endif (Libunwind_FOUND) | ||
22 | |||
23 | +if (HAVE_EXECINFO) | ||
24 | + target_link_libraries (glog PUBLIC execinfo) | ||
25 | +endif (HAVE_EXECINFO) | ||
26 | + | ||
27 | if (HAVE_DBGHELP) | ||
28 | target_link_libraries (glog PUBLIC dbghelp) | ||
29 | endif (HAVE_DBGHELP) | ||
diff --git a/meta-oe/recipes-support/glog/glog_0.4.0.bb b/meta-oe/recipes-support/glog/glog_0.4.0.bb index 8dc84e4125..6b101ef676 100644 --- a/meta-oe/recipes-support/glog/glog_0.4.0.bb +++ b/meta-oe/recipes-support/glog/glog_0.4.0.bb | |||
@@ -9,6 +9,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=dc9db360e0bbd4e46672f3fd91dd6c4b" | |||
9 | SRC_URI = " \ | 9 | SRC_URI = " \ |
10 | git://github.com/google/glog.git;nobranch=1 \ | 10 | git://github.com/google/glog.git;nobranch=1 \ |
11 | file://0001-Find-Libunwind-during-configure.patch \ | 11 | file://0001-Find-Libunwind-during-configure.patch \ |
12 | file://libexecinfo.patch \ | ||
12 | " | 13 | " |
13 | 14 | ||
14 | SRCREV = "96a2f23dca4cc7180821ca5f32e526314395d26a" | 15 | SRCREV = "96a2f23dca4cc7180821ca5f32e526314395d26a" |
@@ -20,8 +21,11 @@ inherit cmake | |||
20 | PACKAGECONFIG ?= "shared unwind" | 21 | PACKAGECONFIG ?= "shared unwind" |
21 | PACKAGECONFIG_remove_riscv64 = "unwind" | 22 | PACKAGECONFIG_remove_riscv64 = "unwind" |
22 | PACKAGECONFIG_remove_riscv32 = "unwind" | 23 | PACKAGECONFIG_remove_riscv32 = "unwind" |
24 | PACKAGECONFIG_append_libc-musl_riscv64 = " execinfo" | ||
25 | PACKAGECONFIG_append_libc-musl_riscv32 = " execinfo" | ||
23 | 26 | ||
24 | PACKAGECONFIG[unwind] = "-DWITH_UNWIND=ON,-DWITH_UNWIND=OFF,libunwind,libunwind" | 27 | PACKAGECONFIG[unwind] = "-DWITH_UNWIND=ON,-DWITH_UNWIND=OFF,libunwind,libunwind" |
28 | PACKAGECONFIG[execinfo] = ",,libexecinfo" | ||
25 | PACKAGECONFIG[shared] = "-DBUILD_SHARED_LIBS=ON,-DBUILD_SHARED_LIBS=OFF,," | 29 | PACKAGECONFIG[shared] = "-DBUILD_SHARED_LIBS=ON,-DBUILD_SHARED_LIBS=OFF,," |
26 | 30 | ||
27 | do_configure_append() { | 31 | do_configure_append() { |