Skip to contentSkip to conversation

glog: updated libunwind look up function

PATCH In review Vyacheslav Yurkov 2 participants 3 messages Nov 5, 2018 – Nov 19, 2018

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 glog: updated libunwind look up function

From: Vyacheslav Yurkov <[email protected]>

Updated FindLinunwind cmake file to locate libunwind properly in the system. This includes settings all needed defines in config.h file, which are used for glog compilation. Changed unwind cmake target to interface, because in cross-compilation environment we could link against several libunwind shared libraries.

---
 ...0001-find-libunwind-during-configure.patch |  30 -----
 ...0002-Find-Libunwind-during-configure.patch | 113 ++++++++++++++++++
 meta-oe/recipes-support/glog/glog_0.3.5.bb    |   6 +-
 3 files changed, 115 insertions(+), 34 deletions(-)
 delete mode 100644 meta-oe/recipes-support/glog/glog/0001-find-libunwind-during-configure.patch
 create mode 100644 meta-oe/recipes-support/glog/glog/0002-Find-Libunwind-during-configure.patch
meta-oe/recipes-support/glog/glog/0001-find-libunwind-during-configure.patch deleted +0 -30
deleted file mode 100644
index 33dc9d38a..000000000
@@ -1,30 +0,0 @@
-diff -ur git/CMakeLists.txt ../0.3.5-r0.unwind/git/CMakeLists.txt
---- git/CMakeLists.txt	2018-10-08 08:54:15.118989400 +0200
-+++ ../0.3.5-r0.unwind/git/CMakeLists.txt	2018-10-05 16:26:59.745922318 +0200
-@@ -384,7 +384,9 @@
- set_target_properties (glog PROPERTIES POSITION_INDEPENDENT_CODE ON)
- 
- if (UNWIND_LIBRARY)
--  target_link_libraries (glog PUBLIC ${UNWIND_LIBRARY})
-+  add_library(unwind SHARED IMPORTED)
-+  set_target_properties(unwind PROPERTIES IMPORTED_LOCATION ${UNWIND_LIBRARY})
-+  target_link_libraries (glog PUBLIC unwind)
- endif (UNWIND_LIBRARY)
- 
- if (HAVE_PTHREAD)
-diff -ur git/glog-config.cmake.in ../0.3.5-r0.unwind/git/glog-config.cmake.in
---- git/glog-config.cmake.in	2018-10-08 08:54:15.122989699 +0200
-+++ ../0.3.5-r0.unwind/git/glog-config.cmake.in	2018-10-08 08:14:48.550745810 +0200
-@@ -4,4 +4,12 @@
- 
- @gflags_DEPENDENCY@
- 
-+find_library (UNWIND_LIBRARY NAMES unwind DOC "unwind library")
-+mark_as_advanced (UNWIND_LIBRARY)
-+
-+if (UNWIND_LIBRARY)
-+  add_library(unwind SHARED IMPORTED)
-+  set_target_properties(unwind PROPERTIES IMPORTED_LOCATION ${UNWIND_LIBRARY})
-+endif (UNWIND_LIBRARY)
-+
- include ("${CMAKE_CURRENT_LIST_DIR}/glog-targets.cmake")
meta-oe/recipes-support/glog/glog/0002-Find-Libunwind-during-configure.patch new file +113 -0

113 lines not on this page · raw message

meta-oe/recipes-support/glog/glog_0.3.5.bb +2 -4
index 4c1bce74e..5e58450c2 100644
@@ -10,8 +10,8 @@ DEPENDS = "libunwind"
 
 SRC_URI = " \
     git://github.com/google/glog.git;branch=v035 \
-    file://0001-find-libunwind-during-configure.patch \
     file://0001-Rework-CMake-glog-VERSION-management.patch \
+    file://0002-Find-Libunwind-during-configure.patch \
 "
 
 SRCREV = "a6a166db069520dbbd653c97c2e5b12e08a8bb26"
@@ -20,8 +20,6 @@ S = "${WORKDIR}/git"
 
 inherit cmake
 
-RDEPENDS_${PN}-dev = ""
-RRECOMMENDS_${PN}-dev = "${PN}-staticdev"
-RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})"
+RDEPENDS_${PN} += "libunwind"
 
 EXTRA_OECMAKE += "-DBUILD_SHARED_LIBS=ON"
Signature · 1 line
2.19.1
#1 lore raw

Hi Vyacheslav

This is causing a regression building cesres-solver see
http://errors.yoctoproject.org/Errors/Details/201286/

Please look into it as soon as you can. I am inclined to revert this patch otherwise.

Quoted 205 lines · Vyacheslav Yurkov

From: Vyacheslav Yurkov <[email protected]>

Updated FindLinunwind cmake file to locate libunwind properly in the system. This includes settings all needed defines in config.h file, which are used for glog compilation. Changed unwind cmake target to interface, because in cross-compilation environment we could link against several libunwind shared libraries.

---
 ...0001-find-libunwind-during-configure.patch |  30 -----
 ...0002-Find-Libunwind-during-configure.patch | 113 ++++++++++++++++++
 meta-oe/recipes-support/glog/glog_0.3.5.bb    |   6 +-
 3 files changed, 115 insertions(+), 34 deletions(-)
 delete mode 100644 meta-oe/recipes-support/glog/glog/0001-find-libunwind-during-configure.patch
 create mode 100644 meta-oe/recipes-support/glog/glog/0002-Find-Libunwind-during-configure.patch
meta-oe/recipes-support/glog/glog/0001-find-libunwind-during-configure.patch deleted +0 -30
deleted file mode 100644
index 33dc9d38a..000000000
@@ -1,30 +0,0 @@
-diff -ur git/CMakeLists.txt ../0.3.5-r0.unwind/git/CMakeLists.txt
---- git/CMakeLists.txt 2018-10-08 08:54:15.118989400 +0200
-+++ ../0.3.5-r0.unwind/git/CMakeLists.txt      2018-10-05 16:26:59.745922318 +0200
-@@ -384,7 +384,9 @@
- set_target_properties (glog PROPERTIES POSITION_INDEPENDENT_CODE ON)
-
- if (UNWIND_LIBRARY)
--  target_link_libraries (glog PUBLIC ${UNWIND_LIBRARY})
-+  add_library(unwind SHARED IMPORTED)
-+  set_target_properties(unwind PROPERTIES IMPORTED_LOCATION ${UNWIND_LIBRARY})
-+  target_link_libraries (glog PUBLIC unwind)
- endif (UNWIND_LIBRARY)
-
- if (HAVE_PTHREAD)
-diff -ur git/glog-config.cmake.in ../0.3.5-r0.unwind/git/glog-config.cmake.in
---- git/glog-config.cmake.in   2018-10-08 08:54:15.122989699 +0200
-+++ ../0.3.5-r0.unwind/git/glog-config.cmake.in        2018-10-08 08:14:48.550745810 +0200
-@@ -4,4 +4,12 @@
-
- @gflags_DEPENDENCY@
-
-+find_library (UNWIND_LIBRARY NAMES unwind DOC "unwind library")
-+mark_as_advanced (UNWIND_LIBRARY)
-+
-+if (UNWIND_LIBRARY)
-+  add_library(unwind SHARED IMPORTED)
-+  set_target_properties(unwind PROPERTIES IMPORTED_LOCATION ${UNWIND_LIBRARY})
-+endif (UNWIND_LIBRARY)
-+
- include ("${CMAKE_CURRENT_LIST_DIR}/glog-targets.cmake")
meta-oe/recipes-support/glog/glog/0002-Find-Libunwind-during-configure.patch new file +113 -0
new file mode 100644
index 000000000..3a6f824ea
@@ -0,0 +1,113 @@
+diff -uNr a/cmake/FindLibunwind.cmake b/cmake/FindLibunwind.cmake
+--- a/cmake/FindLibunwind.cmake        1970-01-01 01:00:00.000000000 +0100
++++ b/cmake/FindLibunwind.cmake        2018-11-02 14:04:35.460437058 +0100
+@@ -0,0 +1,37 @@
++# - Try to find libunwind
++# Once done this will define
++#
++#  LIBUNWIND_FOUND - system has libunwind
++#  unwind - cmake target for libunwind
++
++find_library (UNWIND_LIBRARY NAMES unwind DOC "unwind library")
++include (CheckIncludeFile)
++check_include_file (libunwind.h HAVE_LIBUNWIND_H)
++check_include_file (unwind.h HAVE_UNWIND_H)
++
++if (CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
++    set(LIBUNWIND_ARCH "arm")
++elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR
++        CMAKE_SYSTEM_PROCESSOR STREQUAL "amd64")
++    set(LIBUNWIND_ARCH "x86_64")
++elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^i.86$")
++    set(LIBUNWIND_ARCH "x86")
++endif()
++
++find_library (UNWIND_LIBRARY_PLATFORM NAMES "unwind-${LIBUNWIND_ARCH}" DOC "unwind library platform")
++if (UNWIND_LIBRARY_PLATFORM)
++    set(HAVE_LIB_UNWIND "1")
++endif()
++
++include(FindPackageHandleStandardArgs)
++# handle the QUIETLY and REQUIRED arguments and set Libunwind_FOUND to TRUE
++# if all listed variables are TRUE
++find_package_handle_standard_args(Libunwind DEFAULT_MSG
++    UNWIND_LIBRARY HAVE_LIBUNWIND_H HAVE_UNWIND_H HAVE_LIB_UNWIND)
++
++mark_as_advanced (UNWIND_LIBRARY UNWIND_LIBRARY_PLATFORM)
++
++add_library(unwind INTERFACE IMPORTED)
++set_target_properties(unwind PROPERTIES
++    INTERFACE_LINK_LIBRARIES "${UNWIND_LIBRARY};${UNWIND_LIBRARY_PLATFORM}"
++)
+diff -uNr a/CMakeLists.txt b/CMakeLists.txt
+--- a/CMakeLists.txt   2018-11-02 14:02:21.784835854 +0100
++++ b/CMakeLists.txt   2018-11-02 14:03:16.796935594 +0100
+@@ -58,7 +58,6 @@
+ check_include_file (execinfo.h HAVE_EXECINFO_H)
+ check_include_file (glob.h HAVE_GLOB_H)
+ check_include_file (inttypes.h HAVE_INTTYPES_H)
+-check_include_file (libunwind.h HAVE_LIBUNWIND_H)
+ check_include_file (memory.h HAVE_MEMORY_H)
+ check_include_file (pwd.h HAVE_PWD_H)
+ check_include_file (stdint.h HAVE_STDINT_H)
+@@ -74,7 +73,6 @@
+ check_include_file (syslog.h HAVE_SYSLOG_H)
+ check_include_file (ucontext.h HAVE_UCONTEXT_H)
+ check_include_file (unistd.h HAVE_UNISTD_H)
+-check_include_file (unwind.h HAVE_UNWIND_H)
+
+ check_include_file_cxx ("ext/hash_map" HAVE_EXT_HASH_MAP)
+ check_include_file_cxx ("ext/hash_set" HAVE_EXT_HASH_SET)
+@@ -109,10 +107,7 @@
+ # snprintf as an inline function
+ check_symbol_exists (snprintf stdio.h HAVE_SNPRINTF)
+
+-check_library_exists (unwind get_static_proc_name "" HAVE_LIB_UNWIND)
+-
+-find_library (UNWIND_LIBRARY NAMES unwind DOC "unwind library")
+-mark_as_advanced (UNWIND_LIBRARY)
++find_package(Libunwind)
+
+ check_c_source_compiles ("
+ #include <stdlib.h>
+@@ -376,9 +371,9 @@
+
+ set_target_properties (glog PROPERTIES POSITION_INDEPENDENT_CODE ON)
+
+-if (UNWIND_LIBRARY)
+-  target_link_libraries (glog PUBLIC ${UNWIND_LIBRARY})
+-endif (UNWIND_LIBRARY)
++if (Libunwind_FOUND)
++  target_link_libraries (glog PUBLIC unwind)
++endif (Libunwind_FOUND)
+
+ if (HAVE_PTHREAD)
+   target_link_libraries (glog PUBLIC ${CMAKE_THREAD_LIBS_INIT})
+@@ -571,6 +566,7 @@
+ install (FILES
+   ${CMAKE_CURRENT_BINARY_DIR}/glog-config.cmake
+   ${CMAKE_CURRENT_BINARY_DIR}/glog-config-version.cmake
++  ${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindLibunwind.cmake
+   DESTINATION lib/cmake/glog)
+
+ install (EXPORT glog-targets NAMESPACE glog:: DESTINATION lib/cmake/glog)
+Binary files a/.git/index and b/.git/index differ
+diff -uNr a/glog-config.cmake.in b/glog-config.cmake.in
+--- a/glog-config.cmake.in     2018-11-02 14:02:21.784835854 +0100
++++ b/glog-config.cmake.in     2018-11-02 14:03:16.796935594 +0100
+@@ -4,4 +4,15 @@
+
+ @gflags_DEPENDENCY@
+
++# Record the state of the CMake module path when this script was
++# called so that we can ensure that we leave it in the same state on
++# exit as it was on entry, but modify it locally.
++set(UNWIND_CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH})
++
++set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
++find_dependency (Libunwind)
++
++# Restore original module path
++set(CMAKE_MODULE_PATH "${UNWIND_CMAKE_MODULE_PATH}")
++
+ include ("${CMAKE_CURRENT_LIST_DIR}/glog-targets.cmake")
meta-oe/recipes-support/glog/glog_0.3.5.bb +2 -5
index 4c1bce74e..5e58450c2 100644
@@ -10,8 +10,8 @@ DEPENDS = "libunwind"
 
 SRC_URI = " \
     git://github.com/google/glog.git;branch=v035 \
-    file://0001-find-libunwind-during-configure.patch \
     file://0001-Rework-CMake-glog-VERSION-management.patch \
+    file://0002-Find-Libunwind-during-configure.patch \
 "
 
 SRCREV = "a6a166db069520dbbd653c97c2e5b12e08a8bb26"
@@ -20,8 +20,6 @@ S = "${WORKDIR}/git"
 
 inherit cmake
 
-RDEPENDS_${PN}-dev = ""
-RRECOMMENDS_${PN}-dev = "${PN}-staticdev"
-RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})"
+RDEPENDS_${PN} += "libunwind"
 
 EXTRA_OECMAKE += "-DBUILD_SHARED_LIBS=ON"
--

2.19.1

--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

#2 lore raw

Hi Khem,
I see where it fails. Looking into it.

Vyacheslav

Quoted 241 lines · Khem Raj

Hi Vyacheslav

This is causing a regression building cesres-solver see
http://errors.yoctoproject.org/Errors/Details/201286/

Please look into it as soon as you can. I am inclined to revert this patch otherwise.

Quoted 4 lines · Vyacheslav Yurkov

From: Vyacheslav Yurkov <[email protected]>

Updated FindLinunwind cmake file to locate libunwind properly in the

system.

Quoted 1 line

This includes settings all needed defines in config.h file, which are

used

Quoted 1 line

for glog compilation. Changed unwind cmake target to interface, because

in

Quoted 1 line

cross-compilation environment we could link against several libunwind

shared

Quoted 9 lines

libraries.

---
 ...0001-find-libunwind-during-configure.patch |  30 -----
 ...0002-Find-Libunwind-during-configure.patch | 113 ++++++++++++++++++
 meta-oe/recipes-support/glog/glog_0.3.5.bb    |   6 +-
 3 files changed, 115 insertions(+), 34 deletions(-)
 delete mode 100644

meta-oe/recipes-support/glog/glog/0001-find-libunwind-during-configure.patch

Quoted 1 line
 create mode 100644

meta-oe/recipes-support/glog/glog/0002-Find-Libunwind-during-configure.patch

Quoted 2 lines

diff --git

a/meta-oe/recipes-support/glog/glog/0001-find-libunwind-during-configure.patch b/meta-oe/recipes-support/glog/glog/0001-find-libunwind-during-configure.patch

Quoted 3 lines

deleted file mode 100644
index 33dc9d38a..000000000
---

a/meta-oe/recipes-support/glog/glog/0001-find-libunwind-during-configure.patch

meta-oe/recipes-support/glog/glog/0001-find-libunwind-during-configure.patch line 3

Quoted 5 lines

+++ /dev/null

meta-oe/recipes-support/glog/glog/0001-find-libunwind-during-configure.patch deleted +0 -3
@@ -1,30 +0,0 @@
-diff -ur git/CMakeLists.txt ../0.3.5-r0.unwind/git/CMakeLists.txt
---- git/CMakeLists.txt 2018-10-08 08:54:15.118989400 +0200
-+++ ../0.3.5-r0.unwind/git/CMakeLists.txt      2018-10-05

16:26:59.745922318 +0200

meta-oe/recipes-support/glog/glog/0001-find-libunwind-during-configure.patch

Quoted 7 lines
meta-oe/recipes-support/glog/glog/0001-find-libunwind-during-configure.patch deleted +0 -7
-@@ -384,7 +384,9 @@
- set_target_properties (glog PROPERTIES POSITION_INDEPENDENT_CODE ON)
-
- if (UNWIND_LIBRARY)
--  target_link_libraries (glog PUBLIC ${UNWIND_LIBRARY})
-+  add_library(unwind SHARED IMPORTED)
-+  set_target_properties(unwind PROPERTIES IMPORTED_LOCATION

${UNWIND_LIBRARY})

meta-oe/recipes-support/glog/glog/0001-find-libunwind-during-configure.patch

Quoted 5 lines
meta-oe/recipes-support/glog/glog/0001-find-libunwind-during-configure.patch deleted +0 -5
-+  target_link_libraries (glog PUBLIC unwind)
- endif (UNWIND_LIBRARY)
-
- if (HAVE_PTHREAD)
-diff -ur git/glog-config.cmake.in ../0.3.5-r0.unwind/git/

glog-config.cmake.in

Review line 17

Quoted 2 lines
(quoted diff) +0 -2
---- git/glog-config.cmake.in   2018-10-08 08:54:15.122989699 +0200
-+++ ../0.3.5-r0.unwind/git/glog-config.cmake.in        2018-10-08

08:14:48.550745810 +0200

meta-oe/recipes-support/glog/glog/0001-find-libunwind-during-configure.patch

Quoted 10 lines
meta-oe/recipes-support/glog/glog/0001-find-libunwind-during-configure.patch deleted +0 -10
-@@ -4,4 +4,12 @@
-
- @gflags_DEPENDENCY@
-
-+find_library (UNWIND_LIBRARY NAMES unwind DOC "unwind library")
-+mark_as_advanced (UNWIND_LIBRARY)
-+
-+if (UNWIND_LIBRARY)
-+  add_library(unwind SHARED IMPORTED)
-+  set_target_properties(unwind PROPERTIES IMPORTED_LOCATION

${UNWIND_LIBRARY})

Quoted 4 lines
meta-oe/recipes-support/glog/glog/0001-find-libunwind-during-configure.patch deleted +0 -3
-+endif (UNWIND_LIBRARY)
-+
- include ("${CMAKE_CURRENT_LIST_DIR}/glog-targets.cmake")

diff --git

a/meta-oe/recipes-support/glog/glog/0002-Find-Libunwind-during-configure.patch b/meta-oe/recipes-support/glog/glog/0002-Find-Libunwind-during-configure.patch

Quoted 4 lines

new file mode 100644
index 000000000..3a6f824ea
--- /dev/null
+++

b/meta-oe/recipes-support/glog/glog/0002-Find-Libunwind-during-configure.patch

Review line 2

Quoted 3 lines
(quoted diff) +2 -0
@@ -0,0 +1,113 @@
+diff -uNr a/cmake/FindLibunwind.cmake b/cmake/FindLibunwind.cmake
+--- a/cmake/FindLibunwind.cmake        1970-01-01 01:00:00.000000000

+0100

Review line 3

Quoted 1 line
(quoted diff) +1 -0
++++ b/cmake/FindLibunwind.cmake        2018-11-02 14:04:35.460437058

+0100

Quoted 12 lines
meta-oe/recipes-support/glog/glog/0002-Find-Libunwind-during-configure.patch new file +12 -0
+@@ -0,0 +1,37 @@
++# - Try to find libunwind
++# Once done this will define
++#
++#  LIBUNWIND_FOUND - system has libunwind
++#  unwind - cmake target for libunwind
++
++find_library (UNWIND_LIBRARY NAMES unwind DOC "unwind library")
++include (CheckIncludeFile)
++check_include_file (libunwind.h HAVE_LIBUNWIND_H)
++check_include_file (unwind.h HAVE_UNWIND_H)
++

meta-oe/recipes-support/glog/glog/0002-Find-Libunwind-during-configure.patch

Quoted 10 lines
meta-oe/recipes-support/glog/glog/0002-Find-Libunwind-during-configure.patch new file +10 -0
++if (CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
++    set(LIBUNWIND_ARCH "arm")
++elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR
++        CMAKE_SYSTEM_PROCESSOR STREQUAL "amd64")
++    set(LIBUNWIND_ARCH "x86_64")
++elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^i.86$")
++    set(LIBUNWIND_ARCH "x86")
++endif()
++
++find_library (UNWIND_LIBRARY_PLATFORM NAMES "unwind-${LIBUNWIND_ARCH}"

DOC "unwind library platform")

meta-oe/recipes-support/glog/glog/0002-Find-Libunwind-during-configure.patch

Quoted 6 lines
meta-oe/recipes-support/glog/glog/0002-Find-Libunwind-during-configure.patch new file +6 -0
++if (UNWIND_LIBRARY_PLATFORM)
++    set(HAVE_LIB_UNWIND "1")
++endif()
++
++include(FindPackageHandleStandardArgs)
++# handle the QUIETLY and REQUIRED arguments and set Libunwind_FOUND to

TRUE

meta-oe/recipes-support/glog/glog/0002-Find-Libunwind-during-configure.patch

Quoted 9 lines
meta-oe/recipes-support/glog/glog/0002-Find-Libunwind-during-configure.patch new file +9 -0
++# if all listed variables are TRUE
++find_package_handle_standard_args(Libunwind DEFAULT_MSG
++    UNWIND_LIBRARY HAVE_LIBUNWIND_H HAVE_UNWIND_H HAVE_LIB_UNWIND)
++
++mark_as_advanced (UNWIND_LIBRARY UNWIND_LIBRARY_PLATFORM)
++
++add_library(unwind INTERFACE IMPORTED)
++set_target_properties(unwind PROPERTIES
++    INTERFACE_LINK_LIBRARIES

"${UNWIND_LIBRARY};${UNWIND_LIBRARY_PLATFORM}"

Quoted 43 lines
meta-oe/recipes-support/glog/glog/0002-Find-Libunwind-during-configure.patch new file +43 -0
++)
+diff -uNr a/CMakeLists.txt b/CMakeLists.txt
+--- a/CMakeLists.txt   2018-11-02 14:02:21.784835854 +0100
++++ b/CMakeLists.txt   2018-11-02 14:03:16.796935594 +0100
+@@ -58,7 +58,6 @@
+ check_include_file (execinfo.h HAVE_EXECINFO_H)
+ check_include_file (glob.h HAVE_GLOB_H)
+ check_include_file (inttypes.h HAVE_INTTYPES_H)
+-check_include_file (libunwind.h HAVE_LIBUNWIND_H)
+ check_include_file (memory.h HAVE_MEMORY_H)
+ check_include_file (pwd.h HAVE_PWD_H)
+ check_include_file (stdint.h HAVE_STDINT_H)
+@@ -74,7 +73,6 @@
+ check_include_file (syslog.h HAVE_SYSLOG_H)
+ check_include_file (ucontext.h HAVE_UCONTEXT_H)
+ check_include_file (unistd.h HAVE_UNISTD_H)
+-check_include_file (unwind.h HAVE_UNWIND_H)
+
+ check_include_file_cxx ("ext/hash_map" HAVE_EXT_HASH_MAP)
+ check_include_file_cxx ("ext/hash_set" HAVE_EXT_HASH_SET)
+@@ -109,10 +107,7 @@
+ # snprintf as an inline function
+ check_symbol_exists (snprintf stdio.h HAVE_SNPRINTF)
+
+-check_library_exists (unwind get_static_proc_name "" HAVE_LIB_UNWIND)
+-
+-find_library (UNWIND_LIBRARY NAMES unwind DOC "unwind library")
+-mark_as_advanced (UNWIND_LIBRARY)
++find_package(Libunwind)
+
+ check_c_source_compiles ("
+ #include <stdlib.h>
+@@ -376,9 +371,9 @@
+
+ set_target_properties (glog PROPERTIES POSITION_INDEPENDENT_CODE ON)
+
+-if (UNWIND_LIBRARY)
+-  target_link_libraries (glog PUBLIC ${UNWIND_LIBRARY})
+-endif (UNWIND_LIBRARY)
++if (Libunwind_FOUND)
++  target_link_libraries (glog PUBLIC unwind)
++endif (Libunwind_FOUND)
+

meta-oe/recipes-support/glog/glog/0002-Find-Libunwind-during-configure.patch

Quoted 10 lines
meta-oe/recipes-support/glog/glog/0002-Find-Libunwind-during-configure.patch new file +10 -0
+ if (HAVE_PTHREAD)
+   target_link_libraries (glog PUBLIC ${CMAKE_THREAD_LIBS_INIT})
+@@ -571,6 +566,7 @@
+ install (FILES
+   ${CMAKE_CURRENT_BINARY_DIR}/glog-config.cmake
+   ${CMAKE_CURRENT_BINARY_DIR}/glog-config-version.cmake
++  ${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindLibunwind.cmake
+   DESTINATION lib/cmake/glog)
+
+ install (EXPORT glog-targets NAMESPACE glog:: DESTINATION

lib/cmake/glog)

Review

Quoted 21 lines
meta-oe/recipes-support/glog/glog/0002-Find-Libunwind-during-configure.patch new file +20 -0
+Binary files a/.git/index and b/.git/index differ
+diff -uNr a/glog-config.cmake.in b/glog-config.cmake.in
+--- a/glog-config.cmake.in     2018-11-02 14:02:21.784835854 +0100
++++ b/glog-config.cmake.in     2018-11-02 14:03:16.796935594 +0100
+@@ -4,4 +4,15 @@
+
+ @gflags_DEPENDENCY@
+
++# Record the state of the CMake module path when this script was
++# called so that we can ensure that we leave it in the same state on
++# exit as it was on entry, but modify it locally.
++set(UNWIND_CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH})
++
++set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
++find_dependency (Libunwind)
++
++# Restore original module path
++set(CMAKE_MODULE_PATH "${UNWIND_CMAKE_MODULE_PATH}")
++
+ include ("${CMAKE_CURRENT_LIST_DIR}/glog-targets.cmake")
(quoted diff) +0 -0

b/meta-oe/recipes-support/glog/glog_0.3.5.bb

Quoted 31 lines

index 4c1bce74e..5e58450c2 100644

meta-oe/recipes-support/glog/glog_0.3.5.bb +2 -5
@@ -10,8 +10,8 @@ DEPENDS = "libunwind"
 
 SRC_URI = " \
     git://github.com/google/glog.git;branch=v035 \
-    file://0001-find-libunwind-during-configure.patch \
     file://0001-Rework-CMake-glog-VERSION-management.patch \
+    file://0002-Find-Libunwind-during-configure.patch \
 "
 
 SRCREV = "a6a166db069520dbbd653c97c2e5b12e08a8bb26"
@@ -20,8 +20,6 @@ S = "${WORKDIR}/git"
 
 inherit cmake
 
-RDEPENDS_${PN}-dev = ""
-RRECOMMENDS_${PN}-dev = "${PN}-staticdev"
-RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})"
+RDEPENDS_${PN} += "libunwind"
 
 EXTRA_OECMAKE += "-DBUILD_SHARED_LIBS=ON"
--

2.19.1

--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel