Skip to contentSkip to conversation

glog: fixed the build for mips and other platforms

PATCH Superseded Vyacheslav Yurkov 2 participants 3 messages Nov 19, 2018 – Nov 20, 2018

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 glog: fixed the build for mips and other platforms

From: Vyacheslav Yurkov <[email protected]>

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

---
 ...0002-Find-Libunwind-during-configure.patch | 34 ++++++++++++++-----
 1 file changed, 25 insertions(+), 9 deletions(-)
meta-oe/recipes-support/glog/glog/0002-Find-Libunwind-during-configure.patch +25 -9
index 3a6f824ea..4ad302cbe 100644
@@ -1,11 +1,11 @@
 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 @@
++++ b/cmake/FindLibunwind.cmake	2018-11-19 16:07:17.652031645 +0100
+@@ -0,0 +1,54 @@
 +# - Try to find libunwind
 +# Once done this will define
 +#
-+#  LIBUNWIND_FOUND - system has libunwind
++#  Libunwind_FOUND - system has libunwind
 +#  unwind - cmake target for libunwind
 +
 +find_library (UNWIND_LIBRARY NAMES unwind DOC "unwind library")
@@ -15,11 +15,24 @@ diff -uNr a/cmake/FindLibunwind.cmake b/cmake/FindLibunwind.cmake
 +
 +if (CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
 +    set(LIBUNWIND_ARCH "arm")
++elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^aarch64")
++    set(LIBUNWIND_ARCH "aarch64")
 +elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR
-+        CMAKE_SYSTEM_PROCESSOR STREQUAL "amd64")
++        CMAKE_SYSTEM_PROCESSOR STREQUAL "amd64" OR
++        CMAKE_SYSTEM_PROCESSOR STREQUAL "corei7-64")
 +    set(LIBUNWIND_ARCH "x86_64")
 +elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^i.86$")
 +    set(LIBUNWIND_ARCH "x86")
++elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^ppc64")
++    set(LIBUNWIND_ARCH "ppc64")
++elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^ppc")
++    set(LIBUNWIND_ARCH "ppc32")
++elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^mips")
++    set(LIBUNWIND_ARCH "mips")
++elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^hppa")
++    set(LIBUNWIND_ARCH "hppa")
++elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^ia64")
++    set(LIBUNWIND_ARCH "ia64")
 +endif()
 +
 +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
 +
 +mark_as_advanced (UNWIND_LIBRARY UNWIND_LIBRARY_PLATFORM)
 +
++if (NOT Libunwind_FOUND)
++    message(FATAL_ERROR "Can't find libunwind library")
++endif()
++
 +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
+--- a/CMakeLists.txt	2018-11-19 15:55:05.293665965 +0100
++++ b/CMakeLists.txt	2018-11-19 15:57:37.828381535 +0100
 @@ -58,7 +58,6 @@
  check_include_file (execinfo.h HAVE_EXECINFO_H)
  check_include_file (glob.h HAVE_GLOB_H)
@@ -91,10 +108,9 @@ diff -uNr a/CMakeLists.txt b/CMakeLists.txt
    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
+--- a/glog-config.cmake.in	2018-11-19 15:55:05.293665965 +0100
++++ b/glog-config.cmake.in	2018-11-19 15:57:37.828381535 +0100
 @@ -4,4 +4,15 @@
  
  @gflags_DEPENDENCY@
Signature · 1 line
2.19.1
#1 lore raw
Quoted 7 lines · Vyacheslav Yurkov

From: Vyacheslav Yurkov <[email protected]>

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

It would be good to add riscv64 and arc to this list as well.

Quoted 92 lines
---
 ...0002-Find-Libunwind-during-configure.patch | 34 ++++++++++++++-----
 1 file changed, 25 insertions(+), 9 deletions(-)
meta-oe/recipes-support/glog/glog/0002-Find-Libunwind-during-configure.patch +25 -10
index 3a6f824ea..4ad302cbe 100644
@@ -1,11 +1,11 @@
 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 @@
++++ b/cmake/FindLibunwind.cmake        2018-11-19 16:07:17.652031645 +0100
+@@ -0,0 +1,54 @@
 +# - Try to find libunwind
 +# Once done this will define
 +#
-+#  LIBUNWIND_FOUND - system has libunwind
++#  Libunwind_FOUND - system has libunwind
 +#  unwind - cmake target for libunwind
 +
 +find_library (UNWIND_LIBRARY NAMES unwind DOC "unwind library")
@@ -15,11 +15,24 @@ diff -uNr a/cmake/FindLibunwind.cmake b/cmake/FindLibunwind.cmake
 +
 +if (CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
 +    set(LIBUNWIND_ARCH "arm")
++elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^aarch64")
++    set(LIBUNWIND_ARCH "aarch64")
 +elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR
-+        CMAKE_SYSTEM_PROCESSOR STREQUAL "amd64")
++        CMAKE_SYSTEM_PROCESSOR STREQUAL "amd64" OR
++        CMAKE_SYSTEM_PROCESSOR STREQUAL "corei7-64")
 +    set(LIBUNWIND_ARCH "x86_64")
 +elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^i.86$")
 +    set(LIBUNWIND_ARCH "x86")
++elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^ppc64")
++    set(LIBUNWIND_ARCH "ppc64")
++elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^ppc")
++    set(LIBUNWIND_ARCH "ppc32")
++elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^mips")
++    set(LIBUNWIND_ARCH "mips")
++elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^hppa")
++    set(LIBUNWIND_ARCH "hppa")
++elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^ia64")
++    set(LIBUNWIND_ARCH "ia64")
 +endif()
 +
 +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
 +
 +mark_as_advanced (UNWIND_LIBRARY UNWIND_LIBRARY_PLATFORM)
 +
++if (NOT Libunwind_FOUND)
++    message(FATAL_ERROR "Can't find libunwind library")
++endif()
++
 +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
+--- a/CMakeLists.txt   2018-11-19 15:55:05.293665965 +0100
++++ b/CMakeLists.txt   2018-11-19 15:57:37.828381535 +0100
 @@ -58,7 +58,6 @@
  check_include_file (execinfo.h HAVE_EXECINFO_H)
  check_include_file (glob.h HAVE_GLOB_H)
@@ -91,10 +108,9 @@ diff -uNr a/CMakeLists.txt b/CMakeLists.txt
    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
+--- a/glog-config.cmake.in     2018-11-19 15:55:05.293665965 +0100
++++ b/glog-config.cmake.in     2018-11-19 15:57:37.828381535 +0100
 @@ -4,4 +4,15 @@
 
  @gflags_DEPENDENCY@
--

2.19.1

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

#2 lore raw

I don't see that it would be supported on these architectures. At lease this is what first paragraph on https://github.com/libunwind/libunwind says:

This library supports several architecture/operating-system combinations:

Linux/x86-64: Works well. Linux/x86: Works well. Linux/ARM: Works well. Linux/IA-64: Works well. Linux/PARISC: Works well, but C library missing unwind-info. HP-UX/IA-64: Mostly works but known to have some serious limitations. MIPS: Newly added. Linux/AArch64: Works well. Linux/PPC64:
Newly added. Linux/SuperH: Newly added. FreeBSD/i386: Works well. FreeBSD/x86-64: Newly added (FreeBSD architecture is known as amd64). Linux/Tilegx: Newly added (64-bit mode only).

I guess if someone wants to use glog on those, glog has to be compiled without libunwind support. In that case the libunwind check needs to fall through without fatal message. I will change that part.

Vyacheslav

Quoted 120 lines · Khem Raj
Quoted 4 lines · Vyacheslav Yurkov

From: Vyacheslav Yurkov <[email protected]>

According to build log

http://errors.yoctoproject.org/Errors/Details/201286/

Quoted 1 line

FindLibunwind wokred only for x86, arm, and x86_64. This patch extends

the

Quoted 1 line

cmake module to work with mips, ia64, ppc(64) and other architectures

supported

Quoted 1 line

by libunwind

It would be good to add riscv64 and arc to this list as well.

Quoted 7 lines
---
 ...0002-Find-Libunwind-during-configure.patch | 34 ++++++++++++++-----
 1 file changed, 25 insertions(+), 9 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

Quoted 2 lines

index 3a6f824ea..4ad302cbe 100644
---

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

Quoted 1 line

+++

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

Review line 2

Quoted 3 lines
(quoted diff) +0 -0
@@ -1,11 +1,11 @@
 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) +0 -1
-+++ b/cmake/FindLibunwind.cmake        2018-11-02 14:04:35.460437058

+0100

Review line 3

Quoted 2 lines
(quoted diff) +1 -1
-@@ -0,0 +1,37 @@
++++ b/cmake/FindLibunwind.cmake        2018-11-19 16:07:17.652031645

+0100

meta-oe/recipes-support/glog/glog/0002-Find-Libunwind-during-configure.patch diff -uNr a/cmake/FindLibunwind.cmake

Quoted 10 lines
meta-oe/recipes-support/glog/glog/0002-Find-Libunwind-during-configure.patch +2 -1
+@@ -0,0 +1,54 @@
 +# - Try to find libunwind
 +# Once done this will define
 +#
-+#  LIBUNWIND_FOUND - system has libunwind
++#  Libunwind_FOUND - system has libunwind
 +#  unwind - cmake target for libunwind
 +
 +find_library (UNWIND_LIBRARY NAMES unwind DOC "unwind library")
@@ -15,11 +15,24 @@ diff -uNr a/cmake/FindLibunwind.cmake

b/cmake/FindLibunwind.cmake

Quoted 15 lines
meta-oe/recipes-support/glog/glog/0002-Find-Libunwind-during-configure.patch +7 -1
 +
 +if (CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
 +    set(LIBUNWIND_ARCH "arm")
++elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^aarch64")
++    set(LIBUNWIND_ARCH "aarch64")
 +elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR
-+        CMAKE_SYSTEM_PROCESSOR STREQUAL "amd64")
++        CMAKE_SYSTEM_PROCESSOR STREQUAL "amd64" OR
++        CMAKE_SYSTEM_PROCESSOR STREQUAL "corei7-64")
 +    set(LIBUNWIND_ARCH "x86_64")
 +elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^i.86$")
 +    set(LIBUNWIND_ARCH "x86")
++elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^ppc64")
++    set(LIBUNWIND_ARCH "ppc64")
++elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^ppc")

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

Quoted 10 lines
meta-oe/recipes-support/glog/glog/0002-Find-Libunwind-during-configure.patch +7 -0
++    set(LIBUNWIND_ARCH "ppc32")
++elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^mips")
++    set(LIBUNWIND_ARCH "mips")
++elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^hppa")
++    set(LIBUNWIND_ARCH "hppa")
++elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^ia64")
++    set(LIBUNWIND_ARCH "ia64")
 +endif()
 +
 +find_library (UNWIND_LIBRARY_PLATFORM NAMES "unwind-${LIBUNWIND_ARCH}"

DOC "unwind library platform")

Review diff -uNr a/cmake/FindLibunwind.cmake

Quoted 1 line
(quoted diff) +0 -0
@@ -35,13 +48,17 @@ diff -uNr a/cmake/FindLibunwind.cmake

b/cmake/FindLibunwind.cmake

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

Quoted 10 lines
meta-oe/recipes-support/glog/glog/0002-Find-Libunwind-during-configure.patch +4 -0
 +
 +mark_as_advanced (UNWIND_LIBRARY UNWIND_LIBRARY_PLATFORM)
 +
++if (NOT Libunwind_FOUND)
++    message(FATAL_ERROR "Can't find libunwind library")
++endif()
++
 +add_library(unwind INTERFACE IMPORTED)
 +set_target_properties(unwind PROPERTIES
 +    INTERFACE_LINK_LIBRARIES

"${UNWIND_LIBRARY};${UNWIND_LIBRARY_PLATFORM}"

meta-oe/recipes-support/glog/glog/0002-Find-Libunwind-during-configure.patch diff -uNr a/CMakeLists.txt b/CMakeLists.txt · line 110

Quoted 13 lines
meta-oe/recipes-support/glog/glog/0002-Find-Libunwind-during-configure.patch +2 -2
 +)
 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
+--- a/CMakeLists.txt   2018-11-19 15:55:05.293665965 +0100
++++ b/CMakeLists.txt   2018-11-19 15:57:37.828381535 +0100
 @@ -58,7 +58,6 @@
  check_include_file (execinfo.h HAVE_EXECINFO_H)
  check_include_file (glob.h HAVE_GLOB_H)
@@ -91,10 +108,9 @@ diff -uNr a/CMakeLists.txt b/CMakeLists.txt
    DESTINATION lib/cmake/glog)
 
  install (EXPORT glog-targets NAMESPACE glog:: DESTINATION

lib/cmake/glog)

Quoted 17 lines
meta-oe/recipes-support/glog/glog/0002-Find-Libunwind-during-configure.patch +2 -4
-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
+--- a/glog-config.cmake.in     2018-11-19 15:55:05.293665965 +0100
++++ b/glog-config.cmake.in     2018-11-19 15:57:37.828381535 +0100
 @@ -4,4 +4,15 @@
 
  @gflags_DEPENDENCY@
--

2.19.1

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