summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVyacheslav Yurkov <Vyacheslav.Yurkov@bruker.com>2018-12-09 09:24:01 +0000
committerArmin Kuster <akuster808@gmail.com>2018-12-22 08:12:48 -0800
commit52c8df149ed141af120c6779f0a32afe7184b8d1 (patch)
tree56223f739807504c530f2b1dd6484f121f855bd6
parenta15d7f6ebcb0ed76c83c28f854d55e3f9d5b3677 (diff)
downloadmeta-openembedded-52c8df149ed141af120c6779f0a32afe7184b8d1.tar.gz
glog: fixed the build for mips and other platforms
According to build log http://errors.yoctoproject.org/Errors/Details/201286/ FindLibunwind wokred only for x86, arm, and x86_64. This patch extends the cmake module to work with mips, ia64, ppc(64) and other architectures supported by libunwind Signed-off-by: Vyacheslav Yurkov <Vyacheslav.Yurkov@bruker.com> Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--meta-oe/recipes-support/glog/glog/0002-Find-Libunwind-during-configure.patch53
1 files changed, 30 insertions, 23 deletions
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
index 3a6f824ea..15cf67fd2 100644
--- 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
@@ -1,11 +1,11 @@
1diff -uNr a/cmake/FindLibunwind.cmake b/cmake/FindLibunwind.cmake 1diff -uNr a/cmake/FindLibunwind.cmake b/cmake/FindLibunwind.cmake
2--- a/cmake/FindLibunwind.cmake 1970-01-01 01:00:00.000000000 +0100 2--- a/cmake/FindLibunwind.cmake 1970-01-01 01:00:00.000000000 +0100
3+++ b/cmake/FindLibunwind.cmake 2018-11-02 14:04:35.460437058 +0100 3+++ b/cmake/FindLibunwind.cmake 2018-11-20 15:53:48.799078114 +0100
4@@ -0,0 +1,37 @@ 4@@ -0,0 +1,54 @@
5+# - Try to find libunwind 5+# - Try to find libunwind
6+# Once done this will define 6+# Once done this will define
7+# 7+#
8+# LIBUNWIND_FOUND - system has libunwind 8+# Libunwind_FOUND - system has libunwind
9+# unwind - cmake target for libunwind 9+# unwind - cmake target for libunwind
10+ 10+
11+find_library (UNWIND_LIBRARY NAMES unwind DOC "unwind library") 11+find_library (UNWIND_LIBRARY NAMES unwind DOC "unwind library")
@@ -15,11 +15,24 @@ diff -uNr a/cmake/FindLibunwind.cmake b/cmake/FindLibunwind.cmake
15+ 15+
16+if (CMAKE_SYSTEM_PROCESSOR MATCHES "^arm") 16+if (CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
17+ set(LIBUNWIND_ARCH "arm") 17+ set(LIBUNWIND_ARCH "arm")
18+elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^aarch64")
19+ set(LIBUNWIND_ARCH "aarch64")
18+elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR 20+elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR
19+ CMAKE_SYSTEM_PROCESSOR STREQUAL "amd64") 21+ CMAKE_SYSTEM_PROCESSOR STREQUAL "amd64" OR
22+ CMAKE_SYSTEM_PROCESSOR STREQUAL "corei7-64")
20+ set(LIBUNWIND_ARCH "x86_64") 23+ set(LIBUNWIND_ARCH "x86_64")
21+elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^i.86$") 24+elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^i.86$")
22+ set(LIBUNWIND_ARCH "x86") 25+ set(LIBUNWIND_ARCH "x86")
26+elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^ppc64")
27+ set(LIBUNWIND_ARCH "ppc64")
28+elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^ppc")
29+ set(LIBUNWIND_ARCH "ppc32")
30+elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^mips")
31+ set(LIBUNWIND_ARCH "mips")
32+elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^hppa")
33+ set(LIBUNWIND_ARCH "hppa")
34+elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^ia64")
35+ set(LIBUNWIND_ARCH "ia64")
23+endif() 36+endif()
24+ 37+
25+find_library (UNWIND_LIBRARY_PLATFORM NAMES "unwind-${LIBUNWIND_ARCH}" DOC "unwind library platform") 38+find_library (UNWIND_LIBRARY_PLATFORM NAMES "unwind-${LIBUNWIND_ARCH}" DOC "unwind library platform")
@@ -35,13 +48,17 @@ diff -uNr a/cmake/FindLibunwind.cmake b/cmake/FindLibunwind.cmake
35+ 48+
36+mark_as_advanced (UNWIND_LIBRARY UNWIND_LIBRARY_PLATFORM) 49+mark_as_advanced (UNWIND_LIBRARY UNWIND_LIBRARY_PLATFORM)
37+ 50+
38+add_library(unwind INTERFACE IMPORTED) 51+if (Libunwind_FOUND)
39+set_target_properties(unwind PROPERTIES 52+ add_library(unwind INTERFACE IMPORTED)
40+ INTERFACE_LINK_LIBRARIES "${UNWIND_LIBRARY};${UNWIND_LIBRARY_PLATFORM}" 53+ set_target_properties(unwind PROPERTIES
41+) 54+ INTERFACE_LINK_LIBRARIES "${UNWIND_LIBRARY};${UNWIND_LIBRARY_PLATFORM}"
55+ )
56+else()
57+ message("Can't find libunwind library")
58+endif()
42diff -uNr a/CMakeLists.txt b/CMakeLists.txt 59diff -uNr a/CMakeLists.txt b/CMakeLists.txt
43--- a/CMakeLists.txt 2018-11-02 14:02:21.784835854 +0100 60--- a/CMakeLists.txt 2018-11-20 15:49:07.576278417 +0100
44+++ b/CMakeLists.txt 2018-11-02 14:03:16.796935594 +0100 61+++ b/CMakeLists.txt 2018-11-20 15:49:32.106819928 +0100
45@@ -58,7 +58,6 @@ 62@@ -58,7 +58,6 @@
46 check_include_file (execinfo.h HAVE_EXECINFO_H) 63 check_include_file (execinfo.h HAVE_EXECINFO_H)
47 check_include_file (glob.h HAVE_GLOB_H) 64 check_include_file (glob.h HAVE_GLOB_H)
@@ -91,23 +108,13 @@ diff -uNr a/CMakeLists.txt b/CMakeLists.txt
91 DESTINATION lib/cmake/glog) 108 DESTINATION lib/cmake/glog)
92 109
93 install (EXPORT glog-targets NAMESPACE glog:: DESTINATION lib/cmake/glog) 110 install (EXPORT glog-targets NAMESPACE glog:: DESTINATION lib/cmake/glog)
94Binary files a/.git/index and b/.git/index differ
95diff -uNr a/glog-config.cmake.in b/glog-config.cmake.in 111diff -uNr a/glog-config.cmake.in b/glog-config.cmake.in
96--- a/glog-config.cmake.in 2018-11-02 14:02:21.784835854 +0100 112--- a/glog-config.cmake.in 2018-11-20 15:49:07.576278417 +0100
97+++ b/glog-config.cmake.in 2018-11-02 14:03:16.796935594 +0100 113+++ b/glog-config.cmake.in 2018-11-20 15:52:32.330418489 +0100
98@@ -4,4 +4,15 @@ 114@@ -4,4 +4,6 @@
99 115
100 @gflags_DEPENDENCY@ 116 @gflags_DEPENDENCY@
101 117
102+# Record the state of the CMake module path when this script was
103+# called so that we can ensure that we leave it in the same state on
104+# exit as it was on entry, but modify it locally.
105+set(UNWIND_CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH})
106+
107+set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
108+find_dependency (Libunwind) 118+find_dependency (Libunwind)
109+ 119+
110+# Restore original module path
111+set(CMAKE_MODULE_PATH "${UNWIND_CMAKE_MODULE_PATH}")
112+
113 include ("${CMAKE_CURRENT_LIST_DIR}/glog-targets.cmake") 120 include ("${CMAKE_CURRENT_LIST_DIR}/glog-targets.cmake")