glog: upgrade 0.3.4 -> 0.3.5
PATCH 1/1 glog: upgrade 0.3.4 -> 0.3.5
Upgraded glog recipe to a new stable version in favor of cmake configuration Old configure.ac patch is removed.
Another cmake patch is added. When UNWIND_LIBRARY is used directly as a public dependency then absolute path is stored in cmake config file. This is an issue when glog is used as part of generated SDK, which was built on another machine. When SDK is installed on developer's machine, cmake config contains a full path to non-existent location.
The solution is to find libunwind during configure stage and store target name as a dependency, not a full path
---
...gure.ac-Allow-user-to-disable-gflags.patch | 35 -------------------
...0001-find-libunwind-during-configure.patch | 30 ++++++++++++++++
.../glog/{glog_0.3.4.bb => glog_0.3.5.bb} | 13 +++----
3 files changed, 37 insertions(+), 41 deletions(-)
delete mode 100644 meta-oe/recipes-support/glog/glog/0001-configure.ac-Allow-user-to-disable-gflags.patch
create mode 100644 meta-oe/recipes-support/glog/glog/0001-find-libunwind-during-configure.patch
rename meta-oe/recipes-support/glog/{glog_0.3.4.bb => glog_0.3.5.bb} (55%)meta-oe/recipes-support/glog/glog/0001-configure.ac-Allow-user-to-disable-gflags.patch deleted +0 -35
@@ -1,35 +0,0 @@ -From 0fabde0515e180c53961c27346dd7a79cffa4c1f Mon Sep 17 00:00:00 2001 -From: Ricardo Ribalda Delgado <[email protected]> -Date: Thu, 11 Aug 2016 11:49:36 +0200 -Subject: [PATCH] configure.ac: Allow user to disable gflags - -Under some circumstances like cross-compilation, the user might not want -to enable support for gflags. - -This patch allows support for --without-gflags - -Signed-off-by: Ricardo Ribalda Delgado <[email protected]> ---- - configure.ac | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index 7b4d21e7ae8a..eba5e5cda1ea 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -136,7 +136,11 @@ AC_ARG_WITH(gflags, AS_HELP_STRING[--with-gflags=GFLAGS_DIR], - CFLAGS="$CFLAGS $GFLAGS_CFLAGS" - LIBS="$LIBS $GFLAGS_LIBS" - ) --AC_CHECK_LIB(gflags, main, ac_cv_have_libgflags=1, ac_cv_have_libgflags=0) -+if test x"$with_gflags" = x"no"; then -+ ac_cv_have_libgflags=0 -+else -+ AC_CHECK_LIB(gflags, main, ac_cv_have_libgflags=1, ac_cv_have_libgflags=0) -+fi - if test x"$ac_cv_have_libgflags" = x"1"; then - AC_DEFINE(HAVE_LIB_GFLAGS, 1, [define if you have google gflags library]) - if test x"$GFLAGS_LIBS" = x""; then --- -2.8.1 -
meta-oe/recipes-support/glog/glog/0001-find-libunwind-during-configure.patch new file +30 -0
@@ -0,0 +1,30 @@ +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_0.3.5.bb renamed from meta-oe/recipes-support/glog/glog_0.3.4.bb +7 -6
@@ -9,15 +9,16 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=dc9db360e0bbd4e46672f3fd91dd6c4b" DEPENDS = "libunwind" SRC_URI = " \ - git://github.com/google/glog.git \ - file://0001-configure.ac-Allow-user-to-disable-gflags.patch \ + git://github.com/google/glog.git;branch=v035 \ + file://0001-find-libunwind-during-configure.patch \ " -SRCREV = "d8cb47f77d1c31779f3ff890e1a5748483778d6a" +SRCREV = "a6a166db069520dbbd653c97c2e5b12e08a8bb26" S = "${WORKDIR}/git" -PACKAGECONFIG ??= "" -PACKAGECONFIG[gflags] = ",--without-gflags,gflags," +inherit cmake -inherit autotools pkgconfig +RDEPENDS_${PN}-dev = "" +RRECOMMENDS_${PN}-dev = "${PN}-staticdev" +RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})"
Signature · 1 line
2.19.0
Quoted 119 lines · Vyacheslav Yurkov
Upgraded glog recipe to a new stable version in favor of cmake configuration Old configure.ac patch is removed.
Another cmake patch is added. When
UNWIND_LIBRARYis used directly as a public dependency then absolute path is stored in cmake config file. This is an issue when glog is used as part of generated SDK, which was built on another machine. When SDK is installed on developer's machine, cmake config contains a full path to non-existent location.
The solution is to find libunwind during configure stage and store target name as a dependency, not a full pathSigned-off-by Vyacheslav Yurkov <[email protected]>--- ...gure.ac-Allow-user-to-disable-gflags.patch | 35 ------------------- ...0001-find-libunwind-during-configure.patch | 30 ++++++++++++++++ .../glog/{glog_0.3.4.bb => glog_0.3.5.bb} | 13 +++---- 3 files changed, 37 insertions(+), 41 deletions(-) delete mode 100644 meta-oe/recipes-support/glog/glog/0001-configure.ac-Allow-user-to-disable-gflags.patch create mode 100644 meta-oe/recipes-support/glog/glog/0001-find-libunwind-during-configure.patch rename meta-oe/recipes-support/glog/{glog_0.3.4.bb => glog_0.3.5.bb} (55%)meta-oe/recipes-support/glog/glog/0001-configure.ac-Allow-user-to-disable-gflags.patch deleted +0
-35@@ -1,35 +0,0 @@ -From 0fabde0515e180c53961c27346dd7a79cffa4c1f Mon Sep 17 00:00:00 2001 -From: Ricardo Ribalda Delgado <[email protected]> -Date: Thu, 11 Aug 2016 11:49:36 +0200 -Subject: [PATCH] configure.ac: Allow user to disable gflags - -Under some circumstances like cross-compilation, the user might not want -to enable support for gflags. - -This patch allows support for --without-gflags - -Signed-off-by: Ricardo Ribalda Delgado <[email protected]> ---- - configure.ac | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index 7b4d21e7ae8a..eba5e5cda1ea 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -136,7 +136,11 @@ AC_ARG_WITH(gflags, AS_HELP_STRING[--with-gflags=GFLAGS_DIR], - CFLAGS="$CFLAGS $GFLAGS_CFLAGS" - LIBS="$LIBS $GFLAGS_LIBS" - ) --AC_CHECK_LIB(gflags, main, ac_cv_have_libgflags=1, ac_cv_have_libgflags=0) -+if test x"$with_gflags" = x"no"; then -+ ac_cv_have_libgflags=0 -+else -+ AC_CHECK_LIB(gflags, main, ac_cv_have_libgflags=1, ac_cv_have_libgflags=0) -+fi - if test x"$ac_cv_have_libgflags" = x"1"; then - AC_DEFINE(HAVE_LIB_GFLAGS, 1, [define if you have google gflags library]) - if test x"$GFLAGS_LIBS" = x""; then --- -2.8.1 -meta-oe/recipes-support/glog/glog/0001-find-libunwind-during-configure.patch new file +30
-0@@ -0,0 +1,30 @@ +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_0.3.5.bb renamed from meta-oe/recipes-support/glog/glog_0.3.4.bb +3
-3@@ -9,15 +9,16 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=dc9db360e0bbd4e46672f3fd91dd6c4b" DEPENDS = "libunwind" SRC_URI = " \ - git://github.com/google/glog.git \ - file://0001-configure.ac-Allow-user-to-disable-gflags.patch \ + git://github.com/google/glog.git;branch=v035 \ + file://0001-find-libunwind-during-configure.patch \ " -SRCREV = "d8cb47f77d1c31779f3ff890e1a5748483778d6a" +SRCREV = "a6a166db069520dbbd653c97c2e5b12e08a8bb26"
meta-oe/recipes-support/glog/glog_0.3.5.bb LIC_FILES_CHKSUM = "file://COPYING;md5=dc9db360e0bbd4e46672f3fd91dd6c4b" · line 24
Quoted 10 lines
meta-oe/recipes-support/glog/glog_0.3.5.bb renamed from meta-oe/recipes-support/glog/glog_0.3.4.bb +4
-3S = "${WORKDIR}/git" -PACKAGECONFIG ??= "" -PACKAGECONFIG[gflags] = ",--without-gflags,gflags," +inherit cmake -inherit autotools pkgconfig +RDEPENDS_${PN}-dev = "" +RRECOMMENDS_${PN}-dev = "${PN}-staticdev" +RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})"
why do we need the above change
Quoted 8 lines
--
2.19.0--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
Well, two obvious reasons:
- glog fixes between 0.3.4 and 0.3.5
- cmake support, which simplifies dependency handling when SDK generation is involved (for example for libraries like ceres-solver)
I need to update my patch for finding libunwind, so I will send another version soon. The question I have now is that glog builds static library by default. What is the policy in that regard? Should a shared library be preferred by default?
Vyacheslav
Quoted 157 lines · Khem Raj
Quoted 2 lines · Vyacheslav Yurkov
Upgraded glog recipe to a new stable version in favor of cmake
configuration
Quoted 3 lines
Old configure.ac patch is removed.
Another cmake patch is added. When
UNWIND_LIBRARYis used directly as apublic
Quoted 2 lines
dependency then absolute path is stored in cmake config file. This is an issue when glog is used as part of generated SDK, which was
built
Quoted 5 lines
on another machine. When SDK is installed on developer's machine, cmake config contains a full path to non-existent location. The solution is to find libunwind during configure stage and store target name as a dependency, not a full path
Quoted 7 lines
Signed-off-by Vyacheslav Yurkov <[email protected]>--- ...gure.ac-Allow-user-to-disable-gflags.patch | 35 ------------------- ...0001-find-libunwind-during-configure.patch | 30 ++++++++++++++++ .../glog/{glog_0.3.4.bb => glog_0.3.5.bb} | 13 +++---- 3 files changed, 37 insertions(+), 41 deletions(-) delete mode 100644
meta-oe/recipes-support/glog/glog/0001-configure.ac-Allow-user-to-disable-gflags.patchQuoted 1 line
create mode 100644
meta-oe/recipes-support/glog/glog/0001-find-libunwind-during-configure.patchQuoted 1 line
rename meta-oe/recipes-support/glog/{glog_0.3.4.bb => glog_0.3.5.bb}(55%)
Quoted 2 lines
diff --git
a/meta-oe/recipes-support/glog/glog/0001-configure.ac-Allow-user-to-disable-gflags.patchb/meta-oe/recipes-support/glog/glog/0001-configure.ac-Allow-user-to-disable-gflags.patchQuoted 3 lines
deleted file mode 100644
index 596281ff6..000000000
---
a/meta-oe/recipes-support/glog/glog/0001-configure.ac-Allow-user-to-disable-gflags.patchQuoted 12 lines
+++
/dev/nullmeta-oe/recipes-support/glog/glog/0001-configure.ac-Allow-user-to-disable-gflags.patch deleted +0
-10@@ -1,35 +0,0 @@ -From 0fabde0515e180c53961c27346dd7a79cffa4c1f Mon Sep 17 00:00:00 2001 -From: Ricardo Ribalda Delgado <[email protected]> -Date: Thu, 11 Aug 2016 11:49:36 +0200 -Subject: [PATCH] configure.ac: Allow user to disable gflags - -Under some circumstances like cross-compilation, the user might not want -to enable support for gflags. - -This patch allows support for --without-gflags -meta-oe/recipes-support/glog/glog/0001-configure.ac-Allow-user-to-disable-gflags.patch line 20
Quoted 10 lines
meta-oe/recipes-support/glog/glog/0001-configure.ac-Allow-user-to-disable-gflags.patch deleted +0
-10-Signed-off-by: Ricardo Ribalda Delgado <[email protected]> ---- - configure.ac | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index 7b4d21e7ae8a..eba5e5cda1ea 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -136,7 +136,11 @@ AC_ARG_WITH(gflags,AS_HELP_STRING[--with-gflags=GFLAGS_DIR],
meta-oe/recipes-support/glog/glog/0001-configure.ac-Allow-user-to-disable-gflags.patch
Quoted 4 lines
meta-oe/recipes-support/glog/glog/0001-configure.ac-Allow-user-to-disable-gflags.patch deleted +0
-4- CFLAGS="$CFLAGS $GFLAGS_CFLAGS" - LIBS="$LIBS $GFLAGS_LIBS" - ) --AC_CHECK_LIB(gflags, main, ac_cv_have_libgflags=1,ac_cv_have_libgflags=0)
meta-oe/recipes-support/glog/glog/0001-configure.ac-Allow-user-to-disable-gflags.patch
Quoted 4 lines
meta-oe/recipes-support/glog/glog/0001-configure.ac-Allow-user-to-disable-gflags.patch deleted +0
-4-+if test x"$with_gflags" = x"no"; then -+ ac_cv_have_libgflags=0 -+else -+ AC_CHECK_LIB(gflags, main, ac_cv_have_libgflags=1,ac_cv_have_libgflags=0)
meta-oe/recipes-support/glog/glog/0001-configure.ac-Allow-user-to-disable-gflags.patch
Quoted 3 lines
meta-oe/recipes-support/glog/glog/0001-configure.ac-Allow-user-to-disable-gflags.patch deleted +0
-3-+fi - if test x"$ac_cv_have_libgflags" = x"1"; then - AC_DEFINE(HAVE_LIB_GFLAGS, 1, [define if you have google gflagslibrary])
Quoted 5 lines
meta-oe/recipes-support/glog/glog/0001-configure.ac-Allow-user-to-disable-gflags.patch deleted +0
-4- if test x"$GFLAGS_LIBS" = x""; then --- -2.8.1 -diff --git
a/meta-oe/recipes-support/glog/glog/0001-find-libunwind-during-configure.patchb/meta-oe/recipes-support/glog/glog/0001-find-libunwind-during-configure.patchQuoted 4 lines
new file mode 100644
index 000000000..33dc9d38a
---/dev/null
+++
b/meta-oe/recipes-support/glog/glog/0001-find-libunwind-during-configure.patchmeta-oe/recipes-support/glog/glog/0001-find-libunwind-during-configure.patch line 3
Quoted 4 lines
meta-oe/recipes-support/glog/glog/0001-find-libunwind-during-configure.patch new file +3
-0@@ -0,0 +1,30 @@ +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-0516: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 new file +7
-0+@@ -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 new file +5
-0++ 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) +2
-0+--- 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-0808: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 new file +10
-0+@@ -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})
Review
Quoted 4 lines
meta-oe/recipes-support/glog/glog/0001-find-libunwind-during-configure.patch new file +3
-0++endif (UNWIND_LIBRARY) ++ + include ("${CMAKE_CURRENT_LIST_DIR}/glog-targets.cmake")(quoted diff) +0
-0b/meta-oe/recipes-support/glog/glog_0.3.5.bb
meta-oe/recipes-support/glog/glog_0.3.5.bb LIC_FILES_CHKSUM =
Quoted 7 lines
similarity index 55%
rename from meta-oe/recipes-support/glog/glog_0.3.4.bb rename to meta-oe/recipes-support/glog/glog_0.3.5.bb indexd7c1974c6..bf7df53f3100644meta-oe/recipes-support/glog/glog_0.3.5.bb renamed from meta-oe/recipes-support/glog/glog_0.3.4.bb +0
-0@@ -9,15 +9,16 @@ LIC_FILES_CHKSUM ="file://COPYING;md5=dc9db360e0bbd4e46672f3fd91dd6c4b"
Quoted 12 lines
meta-oe/recipes-support/glog/glog_0.3.5.bb renamed from meta-oe/recipes-support/glog/glog_0.3.4.bb +3
-3DEPENDS = "libunwind" SRC_URI = " \ - git://github.com/google/glog.git \ - file://0001-configure.ac-Allow-user-to-disable-gflags.patch \ + git://github.com/google/glog.git;branch=v035 \ + file://0001-find-libunwind-during-configure.patch \ " -SRCREV = "d8cb47f77d1c31779f3ff890e1a5748483778d6a" +SRCREV = "a6a166db069520dbbd653c97c2e5b12e08a8bb26"meta-oe/recipes-support/glog/glog_0.3.5.bb LIC_FILES_CHKSUM = "file://COPYING;md5=dc9db360e0bbd4e46672f3fd91dd6c4b" · line 24
Quoted 10 lines
meta-oe/recipes-support/glog/glog_0.3.5.bb renamed from meta-oe/recipes-support/glog/glog_0.3.4.bb +4
-3S = "${WORKDIR}/git" -PACKAGECONFIG ??= "" -PACKAGECONFIG[gflags] = ",--without-gflags,gflags," +inherit cmake -inherit autotools pkgconfig +RDEPENDS_${PN}-dev = "" +RRECOMMENDS_${PN}-dev = "${PN}-staticdev" +RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})"why do we need the above change
Martin Jansa
AppliedQuoted 9 lines · Vyacheslav Yurkov
Well, two obvious reasons:
- glog fixes between 0.3.4 and 0.3.5
- cmake support, which simplifies dependency handling when SDK generation is involved (for example for libraries like ceres-solver)I need to update my patch for finding libunwind, so I will send another version soon. The question I have now is that glog builds static library by default. What is the policy in that regard? Should a shared library be preferred by default?
I know I'm a bit late, but I have some questions about shared library.
The preferred default should IMHO be the same as with 0.3.4 version which was shared library, but that's easy to add with small bbappend having:EXTRA_OECMAKE += "-DBUILD_SHARED_LIBS=ON"
but unfortunately the SONAME in the library changed from:
objdump -x usr/lib/libglog.so.0.0.0 | grep SONAME
SONAME libglog.so.0
in 0.3.4 to:
objdump -x usr/lib/libglog.so.0.3.5 | grep SONAME
SONAME libglog.so.0.3.5
Which breaks all our prebuilt binaries which now correctly complain that
there isn't libglog.so.0 provider in dependencies:
QA Issue: /usr/lib/libfoo.so.1.2.3 contained in package libfoo requires libglog.so.0, but no providers found in RDEPENDS_libfoo
Which is quite unfortunate for minor upgrade. Did they really change the ABI (and expect to change it in all future minor upgrades) or is this change just unexpected side-effect of using cmake instead of autotools?
It looks the later, because if I build 0.3.5 version with autotools I get:
objdump -x usr/lib/libglog.so.0.0.0 | grep SONAME
SONAME libglog.so.0
and there is patch for SOVERSION here as well:
https://github.com/google/or-tools/blob/master/patches/glog.patch
applied in master:
https://github.com/google/glog/blob/master/CMakeLists.txt#L493
https://github.com/google/glog/commit/6b6e38a7d53fe01f42ce34384cf4ba4c50e8cb65#diff-af3b638bc2a3e6c650974192a53c7291
patch coming with this change backported to make it possible again to use the shared library.
Quoted 167 lines
Vyacheslav
Quoted 157 lines · Khem Raj
Quoted 2 lines · Vyacheslav Yurkov
Upgraded glog recipe to a new stable version in favor of cmake
configuration
Quoted 3 lines
Old configure.ac patch is removed.
Another cmake patch is added. When
UNWIND_LIBRARYis used directly as apublic
Quoted 2 lines
dependency then absolute path is stored in cmake config file. This is an issue when glog is used as part of generated SDK, which was
built
Quoted 5 lines
on another machine. When SDK is installed on developer's machine, cmake config contains a full path to non-existent location. The solution is to find libunwind during configure stage and store target name as a dependency, not a full path
Quoted 7 lines
Signed-off-by Vyacheslav Yurkov <[email protected]>--- ...gure.ac-Allow-user-to-disable-gflags.patch | 35 ------------------- ...0001-find-libunwind-during-configure.patch | 30 ++++++++++++++++ .../glog/{glog_0.3.4.bb => glog_0.3.5.bb} | 13 +++---- 3 files changed, 37 insertions(+), 41 deletions(-) delete mode 100644
meta-oe/recipes-support/glog/glog/0001-configure.ac-Allow-user-to-disable-gflags.patchQuoted 1 line
create mode 100644
meta-oe/recipes-support/glog/glog/0001-find-libunwind-during-configure.patchQuoted 1 line
rename meta-oe/recipes-support/glog/{glog_0.3.4.bb => glog_0.3.5.bb}(55%)
Quoted 2 lines
diff --git
a/meta-oe/recipes-support/glog/glog/0001-configure.ac-Allow-user-to-disable-gflags.patchb/meta-oe/recipes-support/glog/glog/0001-configure.ac-Allow-user-to-disable-gflags.patchQuoted 3 lines
deleted file mode 100644
index 596281ff6..000000000
---
a/meta-oe/recipes-support/glog/glog/0001-configure.ac-Allow-user-to-disable-gflags.patchQuoted 12 lines
+++
/dev/nullmeta-oe/recipes-support/glog/glog/0001-configure.ac-Allow-user-to-disable-gflags.patch deleted +0
-10@@ -1,35 +0,0 @@ -From 0fabde0515e180c53961c27346dd7a79cffa4c1f Mon Sep 17 00:00:00 2001 -From: Ricardo Ribalda Delgado <[email protected]> -Date: Thu, 11 Aug 2016 11:49:36 +0200 -Subject: [PATCH] configure.ac: Allow user to disable gflags - -Under some circumstances like cross-compilation, the user might not want -to enable support for gflags. - -This patch allows support for --without-gflags -meta-oe/recipes-support/glog/glog/0001-configure.ac-Allow-user-to-disable-gflags.patch line 20
Quoted 10 lines
meta-oe/recipes-support/glog/glog/0001-configure.ac-Allow-user-to-disable-gflags.patch deleted +0
-10-Signed-off-by: Ricardo Ribalda Delgado <[email protected]> ---- - configure.ac | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index 7b4d21e7ae8a..eba5e5cda1ea 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -136,7 +136,11 @@ AC_ARG_WITH(gflags,AS_HELP_STRING[--with-gflags=GFLAGS_DIR],
meta-oe/recipes-support/glog/glog/0001-configure.ac-Allow-user-to-disable-gflags.patch
Quoted 4 lines
meta-oe/recipes-support/glog/glog/0001-configure.ac-Allow-user-to-disable-gflags.patch deleted +0
-4- CFLAGS="$CFLAGS $GFLAGS_CFLAGS" - LIBS="$LIBS $GFLAGS_LIBS" - ) --AC_CHECK_LIB(gflags, main, ac_cv_have_libgflags=1,ac_cv_have_libgflags=0)
meta-oe/recipes-support/glog/glog/0001-configure.ac-Allow-user-to-disable-gflags.patch
Quoted 4 lines
meta-oe/recipes-support/glog/glog/0001-configure.ac-Allow-user-to-disable-gflags.patch deleted +0
-4-+if test x"$with_gflags" = x"no"; then -+ ac_cv_have_libgflags=0 -+else -+ AC_CHECK_LIB(gflags, main, ac_cv_have_libgflags=1,ac_cv_have_libgflags=0)
meta-oe/recipes-support/glog/glog/0001-configure.ac-Allow-user-to-disable-gflags.patch
Quoted 3 lines
meta-oe/recipes-support/glog/glog/0001-configure.ac-Allow-user-to-disable-gflags.patch deleted +0
-3-+fi - if test x"$ac_cv_have_libgflags" = x"1"; then - AC_DEFINE(HAVE_LIB_GFLAGS, 1, [define if you have google gflagslibrary])
Quoted 5 lines
meta-oe/recipes-support/glog/glog/0001-configure.ac-Allow-user-to-disable-gflags.patch deleted +0
-4- if test x"$GFLAGS_LIBS" = x""; then --- -2.8.1 -diff --git
a/meta-oe/recipes-support/glog/glog/0001-find-libunwind-during-configure.patchb/meta-oe/recipes-support/glog/glog/0001-find-libunwind-during-configure.patchQuoted 4 lines
new file mode 100644
index 000000000..33dc9d38a
---/dev/null
+++
b/meta-oe/recipes-support/glog/glog/0001-find-libunwind-during-configure.patchmeta-oe/recipes-support/glog/glog/0001-find-libunwind-during-configure.patch line 3
Quoted 4 lines
meta-oe/recipes-support/glog/glog/0001-find-libunwind-during-configure.patch new file +3
-0@@ -0,0 +1,30 @@ +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-0516: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 new file +7
-0+@@ -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 new file +5
-0++ 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) +2
-0+--- 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-0808: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 new file +10
-0+@@ -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})
Review
Quoted 4 lines
meta-oe/recipes-support/glog/glog/0001-find-libunwind-during-configure.patch new file +3
-0++endif (UNWIND_LIBRARY) ++ + include ("${CMAKE_CURRENT_LIST_DIR}/glog-targets.cmake")(quoted diff) +0
-0b/meta-oe/recipes-support/glog/glog_0.3.5.bb
meta-oe/recipes-support/glog/glog_0.3.5.bb LIC_FILES_CHKSUM =
Quoted 7 lines
similarity index 55%
rename from meta-oe/recipes-support/glog/glog_0.3.4.bb rename to meta-oe/recipes-support/glog/glog_0.3.5.bb indexd7c1974c6..bf7df53f3100644meta-oe/recipes-support/glog/glog_0.3.5.bb renamed from meta-oe/recipes-support/glog/glog_0.3.4.bb +0
-0@@ -9,15 +9,16 @@ LIC_FILES_CHKSUM ="file://COPYING;md5=dc9db360e0bbd4e46672f3fd91dd6c4b"
Quoted 12 lines
meta-oe/recipes-support/glog/glog_0.3.5.bb renamed from meta-oe/recipes-support/glog/glog_0.3.4.bb +3
-3DEPENDS = "libunwind" SRC_URI = " \ - git://github.com/google/glog.git \ - file://0001-configure.ac-Allow-user-to-disable-gflags.patch \ + git://github.com/google/glog.git;branch=v035 \ + file://0001-find-libunwind-during-configure.patch \ " -SRCREV = "d8cb47f77d1c31779f3ff890e1a5748483778d6a" +SRCREV = "a6a166db069520dbbd653c97c2e5b12e08a8bb26"meta-oe/recipes-support/glog/glog_0.3.5.bb LIC_FILES_CHKSUM = "file://COPYING;md5=dc9db360e0bbd4e46672f3fd91dd6c4b" · line 24
Quoted 10 lines
meta-oe/recipes-support/glog/glog_0.3.5.bb renamed from meta-oe/recipes-support/glog/glog_0.3.4.bb +4
-3S = "${WORKDIR}/git" -PACKAGECONFIG ??= "" -PACKAGECONFIG[gflags] = ",--without-gflags,gflags," +inherit cmake -inherit autotools pkgconfig +RDEPENDS_${PN}-dev = "" +RRECOMMENDS_${PN}-dev = "${PN}-staticdev" +RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})"why do we need the above change
Signature · 4 lines
_______________________________________________ Openembedded-devel mailing list [email protected] http://lists.openembedded.org/mailman/listinfo/openembedded-devel
Signature · 1 line
Martin 'JaMa' Jansa jabber: [email protected]
Martin Jansa
AppliedPATCH 1/1 glog: enable building shared library again
* fix the soversion used by libglog as explained bellow:
The preferred default should IMHO be the same as with 0.3.4 version which was shared library, but that's easy to add with small bbappend having:EXTRA_OECMAKE += "-DBUILD_SHARED_LIBS=ON"
but unfortunately the SONAME in the library changed from:
objdump -x usr/lib/libglog.so.0.0.0 | grep SONAME
SONAME libglog.so.0
in 0.3.4 to:
objdump -x usr/lib/libglog.so.0.3.5 | grep SONAME
SONAME libglog.so.0.3.5
Which breaks all our prebuilt binaries which now correctly complain that there isn't libglog.so.0 provider in dependencies:
QA Issue: /usr/lib/libfoo.so.1.2.3 contained in package libfoo requires libglog.so.0, but no providers found in RDEPENDS_libfoo
Which is quite unfortunate for minor upgrade. Did they really change the ABI (and expect to change it in all future minor upgrades) or is this change just unexpected side-effect of using cmake instead of autotools?
It looks the later, because if I build 0.3.5 version with autotools I get:
objdump -x usr/lib/libglog.so.0.0.0 | grep SONAME
SONAME libglog.so.0
and there is patch for SOVERSION here as well:
https://github.com/google/or-tools/blob/master/patches/glog.patch
applied in master:
https://github.com/google/glog/blob/master/CMakeLists.txt#L493
https://github.com/google/glog/commit/6b6e38a7d53fe01f42ce34384cf4ba4c50e8cb65#diff-af3b638bc2a3e6c650974192a53c7291
--- ...Rework-CMake-glog-VERSION-management.patch | 71 +++++++++++++++++++ meta-oe/recipes-support/glog/glog_0.3.5.bb | 3 + 2 files changed, 74 insertions(+) create mode 100644 meta-oe/recipes-support/glog/glog/0001-Rework-CMake-glog-VERSION-management.patch
meta-oe/recipes-support/glog/glog/0001-Rework-CMake-glog-VERSION-management.patch new file +71 -0
@@ -0,0 +1,71 @@ +From 4ea11e0d7c0575316a6ccc07a931164ca29c3d2f Mon Sep 17 00:00:00 2001 +From: Corentin Le Molgat <[email protected]> +Date: Mon, 29 Jan 2018 14:59:08 +0100 +Subject: [PATCH] Rework CMake glog VERSION management. + +- Use of Project version properties instead of custom variables +- fix missmatch between VERSION (build version) and SOVERSION (API version) +src: https://cmake.org/cmake/help/latest/prop_tgt/VERSION.html#prop_tgt:VERSION + +Upstream-Status: Backport [https://github.com/google/glog/commit/6b6e38a7d53fe01f42ce34384cf4ba4c50e8cb65] +Signed-off-by: Martin Jansa <[email protected]> +--- + CMakeLists.txt | 23 ++++++++--------------- + 1 file changed, 8 insertions(+), 15 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7415eab..fb4e408 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -8,23 +8,16 @@ if (POLICY CMP0063) + cmake_policy (SET CMP0063 NEW) + endif (POLICY CMP0063) + +-project (google-glog) ++project(glog VERSION 0.3.5 LANGUAGES C CXX) + + enable_testing () + +-set (GLOG_MAJOR_VERSION 0) +-set (GLOG_MINOR_VERSION 3) +-set (GLOG_PATCH_VERSION 5) +- +-set (GLOG_VERSION +- ${GLOG_MAJOR_VERSION}.${GLOG_MINOR_VERSION}.${GLOG_PATCH_VERSION}) +- + set (CPACK_PACKAGE_NAME glog) + set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "") +-set (CPACK_PACKAGE_VERSION_MAJOR ${GLOG_MAJOR_VERSION}) +-set (CPACK_PACKAGE_VERSION_MINOR ${GLOG_MINOR_VERSION}) +-set (CPACK_PACKAGE_VERSION_PATCH ${GLOG_PATCH_VERSION}) +-set (CPACK_PACKAGE_VERSION ${GLOG_VERSION}) ++set (CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) ++set (CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR}) ++set (CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) ++set (CPACK_PACKAGE_VERSION ${PROJECT_VERSION}) + + option (WITH_GFLAGS "Use gflags" ON) + option (WITH_THREADS "Enable multithreading support" ON) +@@ -406,8 +399,8 @@ if (gflags_FOUND) + endif (NOT BUILD_SHARED_LIBS) + endif (gflags_FOUND) + +-set_target_properties (glog PROPERTIES VERSION ${GLOG_MAJOR_VERSION}) +-set_target_properties (glog PROPERTIES SOVERSION ${GLOG_VERSION}) ++set_target_properties (glog PROPERTIES VERSION ${PROJECT_VERSION}) ++set_target_properties (glog PROPERTIES SOVERSION ${PROJECT_VERSION_MAJOR}) + + if (WIN32) + target_compile_definitions (glog PUBLIC GLOG_NO_ABBREVIATED_SEVERITIES) +@@ -570,7 +563,7 @@ configure_package_config_file (glog-config.cmake.in + NO_CHECK_REQUIRED_COMPONENTS_MACRO) + + write_basic_package_version_file (glog-config-version.cmake VERSION +- ${GLOG_VERSION} COMPATIBILITY SameMajorVersion) ++ ${PROJECT_VERSION} COMPATIBILITY SameMajorVersion) + + export (TARGETS glog NAMESPACE glog:: FILE glog-targets.cmake) + export (PACKAGE glog) +-- +2.17.1 +
meta-oe/recipes-support/glog/glog_0.3.5.bb +3 -0
@@ -11,6 +11,7 @@ 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 \ " SRCREV = "a6a166db069520dbbd653c97c2e5b12e08a8bb26"
@@ -22,3 +23,5 @@ inherit cmake RDEPENDS_${PN}-dev = "" RRECOMMENDS_${PN}-dev = "${PN}-staticdev" RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})" + +EXTRA_OECMAKE += "-DBUILD_SHARED_LIBS=ON"
Signature · 1 line
2.17.1
Hi Martin,
Thanks for the comment.
Thanks for comments. I will add this patch and I also what to append RDEPENDS_${PN} += "libunwind".
I plan to send the updates this week.
Vyacheslav
Quoted 50 lines · Martin Jansa
Quoted 7 lines · Vyacheslav Yurkov
Well, two obvious reasons:
- glog fixes between 0.3.4 and 0.3.5
- cmake support, which simplifies dependency handling when SDK generation is involved (for example for libraries like ceres-solver)I need to update my patch for finding libunwind, so I will send another version soon. The question I have now is that glog builds static library
by
Quoted 2 lines
default. What is the policy in that regard? Should a shared library be preferred by default?
I know I'm a bit late, but I have some questions about shared library.
The preferred default should IMHO be the same as with 0.3.4 version which was shared library, but that's easy to add with small bbappend having:
EXTRA_OECMAKE+= "-DBUILD_SHARED_LIBS=ON"but unfortunately the SONAME in the library changed from:
objdump -xusr/lib/libglog.so.0.0.0| grep SONAME
SONAME libglog.so.0
in 0.3.4 to:
objdump -xusr/lib/libglog.so.0.3.5| grep SONAME
SONAME libglog.so.0.3.5Which breaks all our prebuilt binaries which now correctly complain that there isn't libglog.so.0 provider in dependencies:
QA Issue:/usr/lib/libfoo.so.1.2.3contained in package libfoo requires libglog.so.0, but no providers found inRDEPENDS_libfooWhich is quite unfortunate for minor upgrade. Did they really change the ABI (and expect to change it in all future minor upgrades) or is this change just unexpected side-effect of using cmake instead of autotools?
It looks the later, because if I build 0.3.5 version with autotools I get:
objdump -xusr/lib/libglog.so.0.0.0| grep SONAME
SONAME libglog.so.0and there is patch for SOVERSION here as well:
https://github.com/google/or-tools/blob/master/patches/glog.patchapplied in master:
https://github.com/google/glog/blob/master/CMakeLists.txt#L493patch coming with this change backported to make it possible again to use the shared library.